diff --git a/.gitignore b/.gitignore index d3a5dae06d..c54117203f 100644 --- a/.gitignore +++ b/.gitignore @@ -85,7 +85,5 @@ transaction.log *-shell.log apache-cxf/cxf-aegis/baeldung.xml -apache-fop/src/test/resources/input.xml -apache-fop/src/test/resources/output_herold.pdf -apache-fop/src/test/resources/output_html2fo.pdf -apache-fop/src/test/resources/output_jtidy.pdf \ No newline at end of file + +libraries-2/*.db \ No newline at end of file diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/GraphImageGenerationUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/GraphImageGenerationUnitTest.java index 3b841d574a..a0d7523f48 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/GraphImageGenerationUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/GraphImageGenerationUnitTest.java @@ -1,16 +1,21 @@ package com.baeldung.jgrapht; import static org.junit.Assert.assertTrue; + import java.awt.Color; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; + import javax.imageio.ImageIO; + import org.jgrapht.ext.JGraphXAdapter; import org.jgrapht.graph.DefaultDirectedGraph; import org.jgrapht.graph.DefaultEdge; +import org.junit.After; import org.junit.Before; import org.junit.Test; + import com.mxgraph.layout.mxCircleLayout; import com.mxgraph.layout.mxIGraphLayout; import com.mxgraph.util.mxCellRenderer; @@ -20,7 +25,7 @@ public class GraphImageGenerationUnitTest { @Before public void createGraph() throws IOException { - File imgFile = new File("src/test/resources/graph.png"); + File imgFile = new File("src/test/resources/graph1.png"); imgFile.createNewFile(); g = new DefaultDirectedGraph(DefaultEdge.class); String x1 = "x1"; @@ -34,12 +39,18 @@ public class GraphImageGenerationUnitTest { g.addEdge(x3, x1); } + @After + public void cleanup() { + File imgFile = new File("src/test/resources/graph1.png"); + imgFile.deleteOnExit(); + } + @Test public void givenAdaptedGraph_whenWriteBufferedImage_ThenFileShouldExist() throws IOException { JGraphXAdapter graphAdapter = new JGraphXAdapter(g); mxIGraphLayout layout = new mxCircleLayout(graphAdapter); layout.execute(graphAdapter.getDefaultParent()); - File imgFile = new File("src/test/resources/graph.png"); + File imgFile = new File("src/test/resources/graph1.png"); BufferedImage image = mxCellRenderer.createBufferedImage(graphAdapter, null, 2, Color.WHITE, true, null); ImageIO.write(image, "PNG", imgFile); assertTrue(imgFile.exists()); diff --git a/algorithms-miscellaneous-6/README.md b/algorithms-miscellaneous-6/README.md index 22ee51530f..6ddae75f43 100644 --- a/algorithms-miscellaneous-6/README.md +++ b/algorithms-miscellaneous-6/README.md @@ -7,4 +7,6 @@ - [Efficiently Merge Sorted Java Sequences](https://www.baeldung.com/java-merge-sorted-sequences) - [Introduction to Greedy Algorithms with Java](https://www.baeldung.com/java-greedy-algorithms) - [The Caesar Cipher in Java](https://www.baeldung.com/java-caesar-cipher) +- [Implementing a 2048 Solver in Java](https://www.baeldung.com/2048-java-solver) +- [Finding Top K Elements in an Array](https://www.baeldung.com/java-array-top-elements) - More articles: [[<-- prev]](/../algorithms-miscellaneous-5) diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Board.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Board.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Board.java rename to algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Board.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Cell.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Cell.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Cell.java rename to algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Cell.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Computer.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Computer.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Computer.java rename to algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Computer.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Human.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Human.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Human.java rename to algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Human.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Move.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Move.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Move.java rename to algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Move.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Play2048.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Play2048.java similarity index 98% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Play2048.java rename to algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Play2048.java index ec5b3dca40..2f7c4d254c 100644 --- a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/play2048/Play2048.java +++ b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/play2048/Play2048.java @@ -1,7 +1,7 @@ package com.baeldung.algorithms.play2048; public class Play2048 { - private static final int SIZE = 3; + private static final int SIZE = 4; private static final int INITIAL_NUMBERS = 2; public static void main(String[] args) { diff --git a/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/BruteForceTopKElementsFinder.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/BruteForceTopKElementsFinder.java new file mode 100644 index 0000000000..c0962c7079 --- /dev/null +++ b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/BruteForceTopKElementsFinder.java @@ -0,0 +1,26 @@ +package com.baeldung.algorithms.topkelements; + +import java.util.ArrayList; +import java.util.List; + +public class BruteForceTopKElementsFinder implements TopKElementsFinder { + + public List findTopK(List input, int k) { + List array = new ArrayList<>(input); + List topKList = new ArrayList<>(); + + for (int i = 0; i < k; i++) { + int maxIndex = 0; + + for (int j = 1; j < array.size(); j++) { + if (array.get(j) > array.get(maxIndex)) { + maxIndex = j; + } + } + + topKList.add(array.remove(maxIndex)); + } + + return topKList; + } +} diff --git a/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/MaxHeapTopKElementsFinder.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/MaxHeapTopKElementsFinder.java new file mode 100644 index 0000000000..16ae7f1254 --- /dev/null +++ b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/MaxHeapTopKElementsFinder.java @@ -0,0 +1,26 @@ +package com.baeldung.algorithms.topkelements; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.PriorityQueue; + +public class MaxHeapTopKElementsFinder implements TopKElementsFinder { + + public List findTopK(List input, int k) { + PriorityQueue maxHeap = new PriorityQueue<>(); + + input.forEach(number -> { + maxHeap.add(number); + + if (maxHeap.size() > k) { + maxHeap.poll(); + } + }); + + List topKList = new ArrayList<>(maxHeap); + Collections.reverse(topKList); + + return topKList; + } +} diff --git a/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/TopKElementsFinder.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/TopKElementsFinder.java new file mode 100644 index 0000000000..a9c7881408 --- /dev/null +++ b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/TopKElementsFinder.java @@ -0,0 +1,7 @@ +package com.baeldung.algorithms.topkelements; + +import java.util.List; + +public interface TopKElementsFinder> { + List findTopK(List input, int k); +} diff --git a/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/TreeSetTopKElementsFinder.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/TreeSetTopKElementsFinder.java new file mode 100644 index 0000000000..0b898df21d --- /dev/null +++ b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/topkelements/TreeSetTopKElementsFinder.java @@ -0,0 +1,17 @@ +package com.baeldung.algorithms.topkelements; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; + +public class TreeSetTopKElementsFinder implements TopKElementsFinder { + + public List findTopK(List input, int k) { + Set sortedSet = new TreeSet<>(Comparator.reverseOrder()); + sortedSet.addAll(input); + + return sortedSet.stream().limit(k).collect(Collectors.toList()); + } +} diff --git a/algorithms-miscellaneous-6/src/test/java/com/baeldung/algorithms/topkelements/TopKElementsFinderUnitTest.java b/algorithms-miscellaneous-6/src/test/java/com/baeldung/algorithms/topkelements/TopKElementsFinderUnitTest.java new file mode 100644 index 0000000000..41fa5e067e --- /dev/null +++ b/algorithms-miscellaneous-6/src/test/java/com/baeldung/algorithms/topkelements/TopKElementsFinderUnitTest.java @@ -0,0 +1,46 @@ +package com.baeldung.algorithms.topkelements; + +import org.junit.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.assertj.core.api.Java6Assertions.assertThat; + +public class TopKElementsFinderUnitTest { + private final TopKElementsFinder bruteForceFinder = new BruteForceTopKElementsFinder(); + private final TopKElementsFinder maxHeapFinder = new MaxHeapTopKElementsFinder(); + private final TopKElementsFinder treeSetFinder = new TreeSetTopKElementsFinder(); + + private final int k = 4; + private final List distinctIntegers = Arrays.asList(1, 2, 3, 9, 7, 6, 12); + private final List distinctIntegersTopK = Arrays.asList(9, 7, 6, 12); + private final List nonDistinctIntegers = Arrays.asList(1, 2, 3, 3, 9, 9, 7, 6, 12); + private final List nonDistinctIntegersTopK = Arrays.asList(9, 9, 7, 12); + + + @Test + public void givenArrayDistinctIntegers_whenBruteForceFindTopK_thenReturnKLargest() { + assertThat(bruteForceFinder.findTopK(distinctIntegers, k)).containsOnlyElementsOf(distinctIntegersTopK); + } + + @Test + public void givenArrayDistinctIntegers_whenMaxHeapFindTopK_thenReturnKLargest() { + assertThat(maxHeapFinder.findTopK(distinctIntegers, k)).containsOnlyElementsOf(distinctIntegersTopK); + } + + @Test + public void givenArrayDistinctIntegers_whenTreeSetFindTopK_thenReturnKLargest() { + assertThat(treeSetFinder.findTopK(distinctIntegers, k)).containsOnlyElementsOf(distinctIntegersTopK); + } + + @Test + public void givenArrayNonDistinctIntegers_whenBruteForceFindTopK_thenReturnKLargest() { + assertThat(bruteForceFinder.findTopK(nonDistinctIntegers, k)).containsOnlyElementsOf(nonDistinctIntegersTopK); + } + + @Test + public void givenArrayNonDistinctIntegers_whenMaxHeapFindTopK_thenReturnKLargest() { + assertThat(maxHeapFinder.findTopK(nonDistinctIntegers, k)).containsOnlyElementsOf(nonDistinctIntegersTopK); + } +} diff --git a/apache-avro/README.md b/apache-avro/README.md deleted file mode 100644 index b338e8e565..0000000000 --- a/apache-avro/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Apache Avro - -This module contains articles about Apache Avro - -### Relevant Articles: -- [Guide to Apache Avro](https://www.baeldung.com/java-apache-avro) diff --git a/apache-avro/pom.xml b/apache-avro/pom.xml deleted file mode 100644 index ad32ebb702..0000000000 --- a/apache-avro/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - 4.0.0 - apache-avro - 0.0.1-SNAPSHOT - apache-avro - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.slf4j - slf4j-simple - ${slf4j.version} - compile - - - org.apache.avro - avro - ${avro.version} - - - org.apache.avro - avro-compiler - ${avro.version} - - - - org.apache.avro - avro-maven-plugin - ${avro.version} - - - - - - - org.apache.avro - avro-maven-plugin - ${avro.version} - - - schemas - generate-sources - - schema - protocol - idl-protocol - - - ${project.basedir}/src/main/resources/ - ${project.basedir}/src/main/java/ - - - - - - - - - 1.8.2 - 1.7.25 - - - diff --git a/apache-beam/README.md b/apache-beam/README.md deleted file mode 100644 index a71e5256a8..0000000000 --- a/apache-beam/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [Introduction to Apache Beam](https://www.baeldung.com/apache-beam) diff --git a/apache-beam/pom.xml b/apache-beam/pom.xml deleted file mode 100644 index 7a714ac480..0000000000 --- a/apache-beam/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - com.baeldung.apache - apache-beam - 0.0.1-SNAPSHOT - - - - org.apache.beam - beam-sdks-java-core - ${beam.version} - - - - org.apache.beam - beam-runners-direct-java - ${beam.version} - runtime - - - - org.assertj - assertj-core - ${assertj.version} - test - - - - - 2.19.0 - 3.6.1 - - - diff --git a/apache-bval/README.md b/apache-bval/README.md deleted file mode 100644 index e856810378..0000000000 --- a/apache-bval/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache BVal - -This module contains articles about Apache BVal - -### Relevant Articles: - -- [Intro to Apache BVal](https://www.baeldung.com/apache-bval) diff --git a/apache-bval/pom.xml b/apache-bval/pom.xml deleted file mode 100644 index 49484f4959..0000000000 --- a/apache-bval/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - apache-bval - 0.0.1-SNAPSHOT - apache-bval - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.apache.bval - bval-jsr - ${bval.version} - - - javax.validation - validation-api - ${javax.validation.validation-api.version} - - - org.apache.bval - bval-extras - ${bval.version} - - - - - 1.1.2 - 1.1.0.Final - - - \ No newline at end of file diff --git a/apache-curator/README.md b/apache-curator/README.md deleted file mode 100644 index 4fef6a138e..0000000000 --- a/apache-curator/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache Curator - -This module contains articles about Apache Curator - -### Relevant Articles: - -- [Introduction to Apache Curator](https://www.baeldung.com/apache-curator) diff --git a/apache-curator/pom.xml b/apache-curator/pom.xml deleted file mode 100644 index 5b249127d9..0000000000 --- a/apache-curator/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - apache-curator - 0.0.1-SNAPSHOT - apache-curator - jar - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - - org.apache.curator - curator-x-async - ${curator.version} - - - org.apache.zookeeper - zookeeper - - - - - org.apache.curator - curator-recipes - ${curator.version} - - - org.apache.zookeeper - zookeeper - ${zookeeper.version} - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - - org.assertj - assertj-core - ${assertj.version} - test - - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - - - - - 4.0.1 - 3.4.11 - - 3.6.1 - 1.7.0 - - - \ No newline at end of file diff --git a/apache-geode/README.md b/apache-geode/README.md deleted file mode 100644 index 86629f7a82..0000000000 --- a/apache-geode/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache Geode - -This module contains articles about Apache Geode - -### Relevant Articles: - -- [A Quick Guide to Apache Geode](https://www.baeldung.com/apache-geode) diff --git a/apache-geode/pom.xml b/apache-geode/pom.xml deleted file mode 100644 index fc5b253c01..0000000000 --- a/apache-geode/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 4.0.0 - apache-geode - 1.0-SNAPSHOT - apache-geode - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.apache.geode - geode-core - ${geode.core} - - - - - 1.6.0 - - - \ No newline at end of file diff --git a/apache-libraries/README.md b/apache-libraries/README.md new file mode 100644 index 0000000000..1fc0dd0842 --- /dev/null +++ b/apache-libraries/README.md @@ -0,0 +1,15 @@ +## Apache Libraries + +This module contains articles about various Apache libraries and utilities + +### Relevant Articles: +- [Guide to Apache Avro](https://www.baeldung.com/java-apache-avro) +- [Introduction to Apache Beam](https://www.baeldung.com/apache-beam) +- [Intro to Apache BVal](https://www.baeldung.com/apache-bval) +- [Building a Microservice with Apache Meecrowave](https://www.baeldung.com/apache-meecrowave) +- [Intro to Apache OpenNLP](https://www.baeldung.com/apache-open-nlp) +- [Introduction to Apache Pulsar](https://www.baeldung.com/apache-pulsar) +- [Getting Started with Java and Zookeeper](https://www.baeldung.com/java-zookeeper) +- [Introduction to Apache Curator](https://www.baeldung.com/apache-curator) +- [A Quick Guide to Apache Geode](https://www.baeldung.com/apache-geode) +- [Guide to Solr in Java with Apache Solrj](https://www.baeldung.com/apache-solrj) diff --git a/apache-libraries/pom.xml b/apache-libraries/pom.xml new file mode 100644 index 0000000000..9f800f1e0b --- /dev/null +++ b/apache-libraries/pom.xml @@ -0,0 +1,223 @@ + + + 4.0.0 + apache-libraries + 0.0.1-SNAPSHOT + apache-libraries + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + + org.apache.avro + avro + ${avro.version} + + + org.apache.avro + avro-compiler + ${avro.version} + + + org.apache.avro + avro-maven-plugin + ${avro.version} + + + + + org.apache.beam + beam-sdks-java-core + ${beam.version} + + + + org.apache.beam + beam-runners-direct-java + ${beam.version} + runtime + + + + + org.apache.bval + bval-jsr + ${bval.version} + + + javax.validation + validation-api + ${javax.validation.validation-api.version} + + + org.apache.bval + bval-extras + ${bval.version} + + + + + org.apache.meecrowave + meecrowave-core + ${meecrowave-core.version} + + + + org.apache.meecrowave + meecrowave-jpa + ${meecrowave-jpa.version} + + + com.squareup.okhttp3 + okhttp + ${okhttp.version} + + + org.apache.meecrowave + meecrowave-junit + ${meecrowave-junit.version} + test + + + + + org.apache.opennlp + opennlp-tools + ${opennlp.opennlp-tools.version} + + + + + org.apache.pulsar + pulsar-client + ${pulsar-client.version} + compile + + + + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + + + + + org.apache.curator + curator-x-async + ${curator.version} + + + org.apache.zookeeper + zookeeper + + + + + org.apache.curator + curator-recipes + ${curator.version} + + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.jayway.awaitility + awaitility + ${avaitility.version} + test + + + + + org.apache.geode + geode-core + ${geode.core} + + + + + org.apache.solr + solr-solrj + ${solr.solr-solrj.version} + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + + + + org.apache.avro + avro-maven-plugin + ${avro.version} + + + schemas + generate-sources + + schema + protocol + idl-protocol + + + ${project.basedir}/src/main/resources/ + ${project.basedir}/src/main/java/ + + + + + + + + org.apache.meecrowave + meecrowave-maven-plugin + ${meecrowave-maven-plugin.version} + + + + + + 1.8 + 1.8 + 1.8.2 + 1.7.25 + 2.19.0 + 3.9.0 + 1.1.2 + 1.1.0.Final + 1.2.0 + 3.10.0 + 1.2.1 + 1.2.1 + 1.2.1 + 1.8.4 + 2.1.1-incubating + 3.4.11 + 4.0.1 + 1.7.0 + 1.6.0 + 6.4.0 + + + diff --git a/apache-beam/src/main/java/com/baeldung/apache/beam/intro/WordCount.java b/apache-libraries/src/main/java/com/baeldung/apache/beam/intro/WordCount.java similarity index 100% rename from apache-beam/src/main/java/com/baeldung/apache/beam/intro/WordCount.java rename to apache-libraries/src/main/java/com/baeldung/apache/beam/intro/WordCount.java diff --git a/apache-curator/src/main/java/com/baeldung/apache/curator/modeled/HostConfig.java b/apache-libraries/src/main/java/com/baeldung/apache/curator/modeled/HostConfig.java similarity index 100% rename from apache-curator/src/main/java/com/baeldung/apache/curator/modeled/HostConfig.java rename to apache-libraries/src/main/java/com/baeldung/apache/curator/modeled/HostConfig.java diff --git a/apache-libraries/src/main/java/com/baeldung/avro/model/Active.java b/apache-libraries/src/main/java/com/baeldung/avro/model/Active.java new file mode 100644 index 0000000000..06624df246 --- /dev/null +++ b/apache-libraries/src/main/java/com/baeldung/avro/model/Active.java @@ -0,0 +1,13 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package com.baeldung.avro.model; +@SuppressWarnings("all") +@org.apache.avro.specific.AvroGenerated +public enum Active { + YES, NO ; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"Active\",\"namespace\":\"com.baeldung.avro.model\",\"symbols\":[\"YES\",\"NO\"]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } +} diff --git a/apache-libraries/src/main/java/com/baeldung/avro/model/AvroHttpRequest.java b/apache-libraries/src/main/java/com/baeldung/avro/model/AvroHttpRequest.java new file mode 100644 index 0000000000..584ccfc21c --- /dev/null +++ b/apache-libraries/src/main/java/com/baeldung/avro/model/AvroHttpRequest.java @@ -0,0 +1,491 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package com.baeldung.avro.model; + +import org.apache.avro.specific.SpecificData; +import org.apache.avro.message.BinaryMessageEncoder; +import org.apache.avro.message.BinaryMessageDecoder; +import org.apache.avro.message.SchemaStore; + +@SuppressWarnings("all") +@org.apache.avro.specific.AvroGenerated +public class AvroHttpRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + private static final long serialVersionUID = -8649010116827875312L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroHttpRequest\",\"namespace\":\"com.baeldung.avro.model\",\"fields\":[{\"name\":\"requestTime\",\"type\":\"long\"},{\"name\":\"clientIdentifier\",\"type\":{\"type\":\"record\",\"name\":\"ClientIdentifier\",\"fields\":[{\"name\":\"hostName\",\"type\":\"string\"},{\"name\":\"ipAddress\",\"type\":\"string\"}]}},{\"name\":\"employeeNames\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"default\":null},{\"name\":\"active\",\"type\":{\"type\":\"enum\",\"name\":\"Active\",\"symbols\":[\"YES\",\"NO\"]}}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } + + private static SpecificData MODEL$ = new SpecificData(); + + private static final BinaryMessageEncoder ENCODER = + new BinaryMessageEncoder(MODEL$, SCHEMA$); + + private static final BinaryMessageDecoder DECODER = + new BinaryMessageDecoder(MODEL$, SCHEMA$); + + /** + * Return the BinaryMessageDecoder instance used by this class. + */ + public static BinaryMessageDecoder getDecoder() { + return DECODER; + } + + /** + * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. + * @param resolver a {@link SchemaStore} used to find schemas by fingerprint + */ + public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { + return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); + } + + /** Serializes this AvroHttpRequest to a ByteBuffer. */ + public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { + return ENCODER.encode(this); + } + + /** Deserializes a AvroHttpRequest from a ByteBuffer. */ + public static AvroHttpRequest fromByteBuffer( + java.nio.ByteBuffer b) throws java.io.IOException { + return DECODER.decode(b); + } + + @Deprecated public long requestTime; + @Deprecated public com.baeldung.avro.model.ClientIdentifier clientIdentifier; + @Deprecated public java.util.List employeeNames; + @Deprecated public com.baeldung.avro.model.Active active; + + /** + * Default constructor. Note that this does not initialize fields + * to their default values from the schema. If that is desired then + * one should use newBuilder(). + */ + public AvroHttpRequest() {} + + /** + * All-args constructor. + * @param requestTime The new value for requestTime + * @param clientIdentifier The new value for clientIdentifier + * @param employeeNames The new value for employeeNames + * @param active The new value for active + */ + public AvroHttpRequest(java.lang.Long requestTime, com.baeldung.avro.model.ClientIdentifier clientIdentifier, java.util.List employeeNames, com.baeldung.avro.model.Active active) { + this.requestTime = requestTime; + this.clientIdentifier = clientIdentifier; + this.employeeNames = employeeNames; + this.active = active; + } + + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return requestTime; + case 1: return clientIdentifier; + case 2: return employeeNames; + case 3: return active; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: requestTime = (java.lang.Long)value$; break; + case 1: clientIdentifier = (com.baeldung.avro.model.ClientIdentifier)value$; break; + case 2: employeeNames = (java.util.List)value$; break; + case 3: active = (com.baeldung.avro.model.Active)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'requestTime' field. + * @return The value of the 'requestTime' field. + */ + public java.lang.Long getRequestTime() { + return requestTime; + } + + /** + * Sets the value of the 'requestTime' field. + * @param value the value to set. + */ + public void setRequestTime(java.lang.Long value) { + this.requestTime = value; + } + + /** + * Gets the value of the 'clientIdentifier' field. + * @return The value of the 'clientIdentifier' field. + */ + public com.baeldung.avro.model.ClientIdentifier getClientIdentifier() { + return clientIdentifier; + } + + /** + * Sets the value of the 'clientIdentifier' field. + * @param value the value to set. + */ + public void setClientIdentifier(com.baeldung.avro.model.ClientIdentifier value) { + this.clientIdentifier = value; + } + + /** + * Gets the value of the 'employeeNames' field. + * @return The value of the 'employeeNames' field. + */ + public java.util.List getEmployeeNames() { + return employeeNames; + } + + /** + * Sets the value of the 'employeeNames' field. + * @param value the value to set. + */ + public void setEmployeeNames(java.util.List value) { + this.employeeNames = value; + } + + /** + * Gets the value of the 'active' field. + * @return The value of the 'active' field. + */ + public com.baeldung.avro.model.Active getActive() { + return active; + } + + /** + * Sets the value of the 'active' field. + * @param value the value to set. + */ + public void setActive(com.baeldung.avro.model.Active value) { + this.active = value; + } + + /** + * Creates a new AvroHttpRequest RecordBuilder. + * @return A new AvroHttpRequest RecordBuilder + */ + public static com.baeldung.avro.model.AvroHttpRequest.Builder newBuilder() { + return new com.baeldung.avro.model.AvroHttpRequest.Builder(); + } + + /** + * Creates a new AvroHttpRequest RecordBuilder by copying an existing Builder. + * @param other The existing builder to copy. + * @return A new AvroHttpRequest RecordBuilder + */ + public static com.baeldung.avro.model.AvroHttpRequest.Builder newBuilder(com.baeldung.avro.model.AvroHttpRequest.Builder other) { + return new com.baeldung.avro.model.AvroHttpRequest.Builder(other); + } + + /** + * Creates a new AvroHttpRequest RecordBuilder by copying an existing AvroHttpRequest instance. + * @param other The existing instance to copy. + * @return A new AvroHttpRequest RecordBuilder + */ + public static com.baeldung.avro.model.AvroHttpRequest.Builder newBuilder(com.baeldung.avro.model.AvroHttpRequest other) { + return new com.baeldung.avro.model.AvroHttpRequest.Builder(other); + } + + /** + * RecordBuilder for AvroHttpRequest instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase + implements org.apache.avro.data.RecordBuilder { + + private long requestTime; + private com.baeldung.avro.model.ClientIdentifier clientIdentifier; + private com.baeldung.avro.model.ClientIdentifier.Builder clientIdentifierBuilder; + private java.util.List employeeNames; + private com.baeldung.avro.model.Active active; + + /** Creates a new Builder */ + private Builder() { + super(SCHEMA$); + } + + /** + * Creates a Builder by copying an existing Builder. + * @param other The existing Builder to copy. + */ + private Builder(com.baeldung.avro.model.AvroHttpRequest.Builder other) { + super(other); + if (isValidValue(fields()[0], other.requestTime)) { + this.requestTime = data().deepCopy(fields()[0].schema(), other.requestTime); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.clientIdentifier)) { + this.clientIdentifier = data().deepCopy(fields()[1].schema(), other.clientIdentifier); + fieldSetFlags()[1] = true; + } + if (other.hasClientIdentifierBuilder()) { + this.clientIdentifierBuilder = com.baeldung.avro.model.ClientIdentifier.newBuilder(other.getClientIdentifierBuilder()); + } + if (isValidValue(fields()[2], other.employeeNames)) { + this.employeeNames = data().deepCopy(fields()[2].schema(), other.employeeNames); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.active)) { + this.active = data().deepCopy(fields()[3].schema(), other.active); + fieldSetFlags()[3] = true; + } + } + + /** + * Creates a Builder by copying an existing AvroHttpRequest instance + * @param other The existing instance to copy. + */ + private Builder(com.baeldung.avro.model.AvroHttpRequest other) { + super(SCHEMA$); + if (isValidValue(fields()[0], other.requestTime)) { + this.requestTime = data().deepCopy(fields()[0].schema(), other.requestTime); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.clientIdentifier)) { + this.clientIdentifier = data().deepCopy(fields()[1].schema(), other.clientIdentifier); + fieldSetFlags()[1] = true; + } + this.clientIdentifierBuilder = null; + if (isValidValue(fields()[2], other.employeeNames)) { + this.employeeNames = data().deepCopy(fields()[2].schema(), other.employeeNames); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.active)) { + this.active = data().deepCopy(fields()[3].schema(), other.active); + fieldSetFlags()[3] = true; + } + } + + /** + * Gets the value of the 'requestTime' field. + * @return The value. + */ + public java.lang.Long getRequestTime() { + return requestTime; + } + + /** + * Sets the value of the 'requestTime' field. + * @param value The value of 'requestTime'. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder setRequestTime(long value) { + validate(fields()[0], value); + this.requestTime = value; + fieldSetFlags()[0] = true; + return this; + } + + /** + * Checks whether the 'requestTime' field has been set. + * @return True if the 'requestTime' field has been set, false otherwise. + */ + public boolean hasRequestTime() { + return fieldSetFlags()[0]; + } + + + /** + * Clears the value of the 'requestTime' field. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder clearRequestTime() { + fieldSetFlags()[0] = false; + return this; + } + + /** + * Gets the value of the 'clientIdentifier' field. + * @return The value. + */ + public com.baeldung.avro.model.ClientIdentifier getClientIdentifier() { + return clientIdentifier; + } + + /** + * Sets the value of the 'clientIdentifier' field. + * @param value The value of 'clientIdentifier'. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder setClientIdentifier(com.baeldung.avro.model.ClientIdentifier value) { + validate(fields()[1], value); + this.clientIdentifierBuilder = null; + this.clientIdentifier = value; + fieldSetFlags()[1] = true; + return this; + } + + /** + * Checks whether the 'clientIdentifier' field has been set. + * @return True if the 'clientIdentifier' field has been set, false otherwise. + */ + public boolean hasClientIdentifier() { + return fieldSetFlags()[1]; + } + + /** + * Gets the Builder instance for the 'clientIdentifier' field and creates one if it doesn't exist yet. + * @return This builder. + */ + public com.baeldung.avro.model.ClientIdentifier.Builder getClientIdentifierBuilder() { + if (clientIdentifierBuilder == null) { + if (hasClientIdentifier()) { + setClientIdentifierBuilder(com.baeldung.avro.model.ClientIdentifier.newBuilder(clientIdentifier)); + } else { + setClientIdentifierBuilder(com.baeldung.avro.model.ClientIdentifier.newBuilder()); + } + } + return clientIdentifierBuilder; + } + + /** + * Sets the Builder instance for the 'clientIdentifier' field + * @param value The builder instance that must be set. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder setClientIdentifierBuilder(com.baeldung.avro.model.ClientIdentifier.Builder value) { + clearClientIdentifier(); + clientIdentifierBuilder = value; + return this; + } + + /** + * Checks whether the 'clientIdentifier' field has an active Builder instance + * @return True if the 'clientIdentifier' field has an active Builder instance + */ + public boolean hasClientIdentifierBuilder() { + return clientIdentifierBuilder != null; + } + + /** + * Clears the value of the 'clientIdentifier' field. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder clearClientIdentifier() { + clientIdentifier = null; + clientIdentifierBuilder = null; + fieldSetFlags()[1] = false; + return this; + } + + /** + * Gets the value of the 'employeeNames' field. + * @return The value. + */ + public java.util.List getEmployeeNames() { + return employeeNames; + } + + /** + * Sets the value of the 'employeeNames' field. + * @param value The value of 'employeeNames'. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder setEmployeeNames(java.util.List value) { + validate(fields()[2], value); + this.employeeNames = value; + fieldSetFlags()[2] = true; + return this; + } + + /** + * Checks whether the 'employeeNames' field has been set. + * @return True if the 'employeeNames' field has been set, false otherwise. + */ + public boolean hasEmployeeNames() { + return fieldSetFlags()[2]; + } + + + /** + * Clears the value of the 'employeeNames' field. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder clearEmployeeNames() { + employeeNames = null; + fieldSetFlags()[2] = false; + return this; + } + + /** + * Gets the value of the 'active' field. + * @return The value. + */ + public com.baeldung.avro.model.Active getActive() { + return active; + } + + /** + * Sets the value of the 'active' field. + * @param value The value of 'active'. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder setActive(com.baeldung.avro.model.Active value) { + validate(fields()[3], value); + this.active = value; + fieldSetFlags()[3] = true; + return this; + } + + /** + * Checks whether the 'active' field has been set. + * @return True if the 'active' field has been set, false otherwise. + */ + public boolean hasActive() { + return fieldSetFlags()[3]; + } + + + /** + * Clears the value of the 'active' field. + * @return This builder. + */ + public com.baeldung.avro.model.AvroHttpRequest.Builder clearActive() { + active = null; + fieldSetFlags()[3] = false; + return this; + } + + @Override + @SuppressWarnings("unchecked") + public AvroHttpRequest build() { + try { + AvroHttpRequest record = new AvroHttpRequest(); + record.requestTime = fieldSetFlags()[0] ? this.requestTime : (java.lang.Long) defaultValue(fields()[0]); + if (clientIdentifierBuilder != null) { + record.clientIdentifier = this.clientIdentifierBuilder.build(); + } else { + record.clientIdentifier = fieldSetFlags()[1] ? this.clientIdentifier : (com.baeldung.avro.model.ClientIdentifier) defaultValue(fields()[1]); + } + record.employeeNames = fieldSetFlags()[2] ? this.employeeNames : (java.util.List) defaultValue(fields()[2]); + record.active = fieldSetFlags()[3] ? this.active : (com.baeldung.avro.model.Active) defaultValue(fields()[3]); + return record; + } catch (java.lang.Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumWriter + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); + + @Override public void writeExternal(java.io.ObjectOutput out) + throws java.io.IOException { + WRITER$.write(this, SpecificData.getEncoder(out)); + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumReader + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); + + @Override public void readExternal(java.io.ObjectInput in) + throws java.io.IOException { + READER$.read(this, SpecificData.getDecoder(in)); + } + +} diff --git a/apache-libraries/src/main/java/com/baeldung/avro/model/ClientIdentifier.java b/apache-libraries/src/main/java/com/baeldung/avro/model/ClientIdentifier.java new file mode 100644 index 0000000000..6d1f9a7e75 --- /dev/null +++ b/apache-libraries/src/main/java/com/baeldung/avro/model/ClientIdentifier.java @@ -0,0 +1,308 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package com.baeldung.avro.model; + +import org.apache.avro.specific.SpecificData; +import org.apache.avro.message.BinaryMessageEncoder; +import org.apache.avro.message.BinaryMessageDecoder; +import org.apache.avro.message.SchemaStore; + +@SuppressWarnings("all") +@org.apache.avro.specific.AvroGenerated +public class ClientIdentifier extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + private static final long serialVersionUID = 8754570983127295424L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ClientIdentifier\",\"namespace\":\"com.baeldung.avro.model\",\"fields\":[{\"name\":\"hostName\",\"type\":\"string\"},{\"name\":\"ipAddress\",\"type\":\"string\"}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } + + private static SpecificData MODEL$ = new SpecificData(); + + private static final BinaryMessageEncoder ENCODER = + new BinaryMessageEncoder(MODEL$, SCHEMA$); + + private static final BinaryMessageDecoder DECODER = + new BinaryMessageDecoder(MODEL$, SCHEMA$); + + /** + * Return the BinaryMessageDecoder instance used by this class. + */ + public static BinaryMessageDecoder getDecoder() { + return DECODER; + } + + /** + * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. + * @param resolver a {@link SchemaStore} used to find schemas by fingerprint + */ + public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { + return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); + } + + /** Serializes this ClientIdentifier to a ByteBuffer. */ + public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { + return ENCODER.encode(this); + } + + /** Deserializes a ClientIdentifier from a ByteBuffer. */ + public static ClientIdentifier fromByteBuffer( + java.nio.ByteBuffer b) throws java.io.IOException { + return DECODER.decode(b); + } + + @Deprecated public java.lang.CharSequence hostName; + @Deprecated public java.lang.CharSequence ipAddress; + + /** + * Default constructor. Note that this does not initialize fields + * to their default values from the schema. If that is desired then + * one should use newBuilder(). + */ + public ClientIdentifier() {} + + /** + * All-args constructor. + * @param hostName The new value for hostName + * @param ipAddress The new value for ipAddress + */ + public ClientIdentifier(java.lang.CharSequence hostName, java.lang.CharSequence ipAddress) { + this.hostName = hostName; + this.ipAddress = ipAddress; + } + + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return hostName; + case 1: return ipAddress; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: hostName = (java.lang.CharSequence)value$; break; + case 1: ipAddress = (java.lang.CharSequence)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'hostName' field. + * @return The value of the 'hostName' field. + */ + public java.lang.CharSequence getHostName() { + return hostName; + } + + /** + * Sets the value of the 'hostName' field. + * @param value the value to set. + */ + public void setHostName(java.lang.CharSequence value) { + this.hostName = value; + } + + /** + * Gets the value of the 'ipAddress' field. + * @return The value of the 'ipAddress' field. + */ + public java.lang.CharSequence getIpAddress() { + return ipAddress; + } + + /** + * Sets the value of the 'ipAddress' field. + * @param value the value to set. + */ + public void setIpAddress(java.lang.CharSequence value) { + this.ipAddress = value; + } + + /** + * Creates a new ClientIdentifier RecordBuilder. + * @return A new ClientIdentifier RecordBuilder + */ + public static com.baeldung.avro.model.ClientIdentifier.Builder newBuilder() { + return new com.baeldung.avro.model.ClientIdentifier.Builder(); + } + + /** + * Creates a new ClientIdentifier RecordBuilder by copying an existing Builder. + * @param other The existing builder to copy. + * @return A new ClientIdentifier RecordBuilder + */ + public static com.baeldung.avro.model.ClientIdentifier.Builder newBuilder(com.baeldung.avro.model.ClientIdentifier.Builder other) { + return new com.baeldung.avro.model.ClientIdentifier.Builder(other); + } + + /** + * Creates a new ClientIdentifier RecordBuilder by copying an existing ClientIdentifier instance. + * @param other The existing instance to copy. + * @return A new ClientIdentifier RecordBuilder + */ + public static com.baeldung.avro.model.ClientIdentifier.Builder newBuilder(com.baeldung.avro.model.ClientIdentifier other) { + return new com.baeldung.avro.model.ClientIdentifier.Builder(other); + } + + /** + * RecordBuilder for ClientIdentifier instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase + implements org.apache.avro.data.RecordBuilder { + + private java.lang.CharSequence hostName; + private java.lang.CharSequence ipAddress; + + /** Creates a new Builder */ + private Builder() { + super(SCHEMA$); + } + + /** + * Creates a Builder by copying an existing Builder. + * @param other The existing Builder to copy. + */ + private Builder(com.baeldung.avro.model.ClientIdentifier.Builder other) { + super(other); + if (isValidValue(fields()[0], other.hostName)) { + this.hostName = data().deepCopy(fields()[0].schema(), other.hostName); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.ipAddress)) { + this.ipAddress = data().deepCopy(fields()[1].schema(), other.ipAddress); + fieldSetFlags()[1] = true; + } + } + + /** + * Creates a Builder by copying an existing ClientIdentifier instance + * @param other The existing instance to copy. + */ + private Builder(com.baeldung.avro.model.ClientIdentifier other) { + super(SCHEMA$); + if (isValidValue(fields()[0], other.hostName)) { + this.hostName = data().deepCopy(fields()[0].schema(), other.hostName); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.ipAddress)) { + this.ipAddress = data().deepCopy(fields()[1].schema(), other.ipAddress); + fieldSetFlags()[1] = true; + } + } + + /** + * Gets the value of the 'hostName' field. + * @return The value. + */ + public java.lang.CharSequence getHostName() { + return hostName; + } + + /** + * Sets the value of the 'hostName' field. + * @param value The value of 'hostName'. + * @return This builder. + */ + public com.baeldung.avro.model.ClientIdentifier.Builder setHostName(java.lang.CharSequence value) { + validate(fields()[0], value); + this.hostName = value; + fieldSetFlags()[0] = true; + return this; + } + + /** + * Checks whether the 'hostName' field has been set. + * @return True if the 'hostName' field has been set, false otherwise. + */ + public boolean hasHostName() { + return fieldSetFlags()[0]; + } + + + /** + * Clears the value of the 'hostName' field. + * @return This builder. + */ + public com.baeldung.avro.model.ClientIdentifier.Builder clearHostName() { + hostName = null; + fieldSetFlags()[0] = false; + return this; + } + + /** + * Gets the value of the 'ipAddress' field. + * @return The value. + */ + public java.lang.CharSequence getIpAddress() { + return ipAddress; + } + + /** + * Sets the value of the 'ipAddress' field. + * @param value The value of 'ipAddress'. + * @return This builder. + */ + public com.baeldung.avro.model.ClientIdentifier.Builder setIpAddress(java.lang.CharSequence value) { + validate(fields()[1], value); + this.ipAddress = value; + fieldSetFlags()[1] = true; + return this; + } + + /** + * Checks whether the 'ipAddress' field has been set. + * @return True if the 'ipAddress' field has been set, false otherwise. + */ + public boolean hasIpAddress() { + return fieldSetFlags()[1]; + } + + + /** + * Clears the value of the 'ipAddress' field. + * @return This builder. + */ + public com.baeldung.avro.model.ClientIdentifier.Builder clearIpAddress() { + ipAddress = null; + fieldSetFlags()[1] = false; + return this; + } + + @Override + @SuppressWarnings("unchecked") + public ClientIdentifier build() { + try { + ClientIdentifier record = new ClientIdentifier(); + record.hostName = fieldSetFlags()[0] ? this.hostName : (java.lang.CharSequence) defaultValue(fields()[0]); + record.ipAddress = fieldSetFlags()[1] ? this.ipAddress : (java.lang.CharSequence) defaultValue(fields()[1]); + return record; + } catch (java.lang.Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumWriter + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); + + @Override public void writeExternal(java.io.ObjectOutput out) + throws java.io.IOException { + WRITER$.write(this, SpecificData.getEncoder(out)); + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumReader + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); + + @Override public void readExternal(java.io.ObjectInput in) + throws java.io.IOException { + READER$.read(this, SpecificData.getDecoder(in)); + } + +} diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/AvroClassGenerator.java b/apache-libraries/src/main/java/com/baeldung/avro/util/AvroClassGenerator.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/AvroClassGenerator.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/AvroClassGenerator.java diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/AvroSchemaBuilder.java b/apache-libraries/src/main/java/com/baeldung/avro/util/AvroSchemaBuilder.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/AvroSchemaBuilder.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/AvroSchemaBuilder.java diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/model/Active.java b/apache-libraries/src/main/java/com/baeldung/avro/util/model/Active.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/model/Active.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/model/Active.java diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/model/AvroHttpRequest.java b/apache-libraries/src/main/java/com/baeldung/avro/util/model/AvroHttpRequest.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/model/AvroHttpRequest.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/model/AvroHttpRequest.java diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/model/ClientIdentifier.java b/apache-libraries/src/main/java/com/baeldung/avro/util/model/ClientIdentifier.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/model/ClientIdentifier.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/model/ClientIdentifier.java diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/serealization/AvroDeSerealizer.java b/apache-libraries/src/main/java/com/baeldung/avro/util/serealization/AvroDeSerealizer.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/serealization/AvroDeSerealizer.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/serealization/AvroDeSerealizer.java diff --git a/apache-avro/src/main/java/com/baeldung/avro/util/serealization/AvroSerealizer.java b/apache-libraries/src/main/java/com/baeldung/avro/util/serealization/AvroSerealizer.java similarity index 100% rename from apache-avro/src/main/java/com/baeldung/avro/util/serealization/AvroSerealizer.java rename to apache-libraries/src/main/java/com/baeldung/avro/util/serealization/AvroSerealizer.java diff --git a/apache-bval/src/main/java/com/baeldung/model/User.java b/apache-libraries/src/main/java/com/baeldung/bval/model/User.java similarity index 96% rename from apache-bval/src/main/java/com/baeldung/model/User.java rename to apache-libraries/src/main/java/com/baeldung/bval/model/User.java index 477136ddb4..95f09a4e0a 100644 --- a/apache-bval/src/main/java/com/baeldung/model/User.java +++ b/apache-libraries/src/main/java/com/baeldung/bval/model/User.java @@ -1,4 +1,4 @@ -package com.baeldung.model; +package com.baeldung.bval.model; import java.io.File; @@ -13,7 +13,7 @@ import org.apache.bval.extras.constraints.creditcard.Visa; import org.apache.bval.extras.constraints.file.Directory; import org.apache.bval.extras.constraints.net.InetAddress; -import com.baeldung.validation.Password; +import com.baeldung.bval.validation.Password; public class User { @NotNull diff --git a/apache-bval/src/main/java/com/baeldung/validation/Password.java b/apache-libraries/src/main/java/com/baeldung/bval/validation/Password.java similarity index 94% rename from apache-bval/src/main/java/com/baeldung/validation/Password.java rename to apache-libraries/src/main/java/com/baeldung/bval/validation/Password.java index 4ae06b2fb0..b278612261 100644 --- a/apache-bval/src/main/java/com/baeldung/validation/Password.java +++ b/apache-libraries/src/main/java/com/baeldung/bval/validation/Password.java @@ -1,4 +1,4 @@ -package com.baeldung.validation; +package com.baeldung.bval.validation; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/apache-bval/src/main/java/com/baeldung/validation/PasswordValidator.java b/apache-libraries/src/main/java/com/baeldung/bval/validation/PasswordValidator.java similarity index 95% rename from apache-bval/src/main/java/com/baeldung/validation/PasswordValidator.java rename to apache-libraries/src/main/java/com/baeldung/bval/validation/PasswordValidator.java index 19038d04d5..46d7ff8d9e 100644 --- a/apache-bval/src/main/java/com/baeldung/validation/PasswordValidator.java +++ b/apache-libraries/src/main/java/com/baeldung/bval/validation/PasswordValidator.java @@ -1,4 +1,4 @@ -package com.baeldung.validation; +package com.baeldung.bval.validation; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; diff --git a/apache-geode/src/main/java/com/baeldung/geode/Customer.java b/apache-libraries/src/main/java/com/baeldung/geode/Customer.java similarity index 100% rename from apache-geode/src/main/java/com/baeldung/geode/Customer.java rename to apache-libraries/src/main/java/com/baeldung/geode/Customer.java diff --git a/apache-geode/src/main/java/com/baeldung/geode/CustomerKey.java b/apache-libraries/src/main/java/com/baeldung/geode/CustomerKey.java similarity index 100% rename from apache-geode/src/main/java/com/baeldung/geode/CustomerKey.java rename to apache-libraries/src/main/java/com/baeldung/geode/CustomerKey.java diff --git a/apache-geode/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java b/apache-libraries/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java similarity index 100% rename from apache-geode/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java rename to apache-libraries/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java diff --git a/apache-meecrowave/src/main/java/com/baeldung/meecrowave/Article.java b/apache-libraries/src/main/java/com/baeldung/meecrowave/Article.java similarity index 100% rename from apache-meecrowave/src/main/java/com/baeldung/meecrowave/Article.java rename to apache-libraries/src/main/java/com/baeldung/meecrowave/Article.java diff --git a/apache-meecrowave/src/main/java/com/baeldung/meecrowave/ArticleEndpoints.java b/apache-libraries/src/main/java/com/baeldung/meecrowave/ArticleEndpoints.java similarity index 100% rename from apache-meecrowave/src/main/java/com/baeldung/meecrowave/ArticleEndpoints.java rename to apache-libraries/src/main/java/com/baeldung/meecrowave/ArticleEndpoints.java diff --git a/apache-meecrowave/src/main/java/com/baeldung/meecrowave/ArticleService.java b/apache-libraries/src/main/java/com/baeldung/meecrowave/ArticleService.java similarity index 100% rename from apache-meecrowave/src/main/java/com/baeldung/meecrowave/ArticleService.java rename to apache-libraries/src/main/java/com/baeldung/meecrowave/ArticleService.java diff --git a/apache-meecrowave/src/main/java/com/baeldung/meecrowave/Server.java b/apache-libraries/src/main/java/com/baeldung/meecrowave/Server.java similarity index 100% rename from apache-meecrowave/src/main/java/com/baeldung/meecrowave/Server.java rename to apache-libraries/src/main/java/com/baeldung/meecrowave/Server.java diff --git a/apache-pulsar/src/main/java/com/baeldung/ConsumerUnitTest.java b/apache-libraries/src/main/java/com/baeldung/pulsar/ConsumerUnitTest.java similarity index 98% rename from apache-pulsar/src/main/java/com/baeldung/ConsumerUnitTest.java rename to apache-libraries/src/main/java/com/baeldung/pulsar/ConsumerUnitTest.java index 82a0028837..be94f1a975 100644 --- a/apache-pulsar/src/main/java/com/baeldung/ConsumerUnitTest.java +++ b/apache-libraries/src/main/java/com/baeldung/pulsar/ConsumerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.pulsar; import java.io.IOException; diff --git a/apache-pulsar/src/main/java/com/baeldung/ProducerUnitTest.java b/apache-libraries/src/main/java/com/baeldung/pulsar/ProducerUnitTest.java similarity index 98% rename from apache-pulsar/src/main/java/com/baeldung/ProducerUnitTest.java rename to apache-libraries/src/main/java/com/baeldung/pulsar/ProducerUnitTest.java index 10a4b46c4d..45c4def559 100644 --- a/apache-pulsar/src/main/java/com/baeldung/ProducerUnitTest.java +++ b/apache-libraries/src/main/java/com/baeldung/pulsar/ProducerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.pulsar; import org.apache.pulsar.client.api.CompressionType; import org.apache.pulsar.client.api.Message; diff --git a/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionUnitTest.java b/apache-libraries/src/main/java/com/baeldung/pulsar/subscriptions/ExclusiveSubscriptionUnitTest.java similarity index 98% rename from apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionUnitTest.java rename to apache-libraries/src/main/java/com/baeldung/pulsar/subscriptions/ExclusiveSubscriptionUnitTest.java index 79121347e7..57d4ed5d00 100644 --- a/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionUnitTest.java +++ b/apache-libraries/src/main/java/com/baeldung/pulsar/subscriptions/ExclusiveSubscriptionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.subscriptions; +package com.baeldung.pulsar.subscriptions; import org.apache.pulsar.client.api.ConsumerBuilder; import org.apache.pulsar.client.api.Message; diff --git a/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionUnitTest.java b/apache-libraries/src/main/java/com/baeldung/pulsar/subscriptions/FailoverSubscriptionUnitTest.java similarity index 98% rename from apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionUnitTest.java rename to apache-libraries/src/main/java/com/baeldung/pulsar/subscriptions/FailoverSubscriptionUnitTest.java index 1d13b4b83a..c5395da606 100644 --- a/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionUnitTest.java +++ b/apache-libraries/src/main/java/com/baeldung/pulsar/subscriptions/FailoverSubscriptionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.subscriptions; +package com.baeldung.pulsar.subscriptions; import org.apache.pulsar.client.api.Consumer; import org.apache.pulsar.client.api.ConsumerBuilder; diff --git a/apache-solrj/src/main/java/com/baeldung/solrjava/ProductBean.java b/apache-libraries/src/main/java/com/baeldung/solrjava/ProductBean.java similarity index 100% rename from apache-solrj/src/main/java/com/baeldung/solrjava/ProductBean.java rename to apache-libraries/src/main/java/com/baeldung/solrjava/ProductBean.java diff --git a/apache-solrj/src/main/java/com/baeldung/solrjava/SolrJavaIntegration.java b/apache-libraries/src/main/java/com/baeldung/solrjava/SolrJavaIntegration.java similarity index 100% rename from apache-solrj/src/main/java/com/baeldung/solrjava/SolrJavaIntegration.java rename to apache-libraries/src/main/java/com/baeldung/solrjava/SolrJavaIntegration.java diff --git a/apache-zookeeper/src/main/java/com/baeldung/zookeeper/connection/ZKConnection.java b/apache-libraries/src/main/java/com/baeldung/zookeeper/connection/ZKConnection.java similarity index 100% rename from apache-zookeeper/src/main/java/com/baeldung/zookeeper/connection/ZKConnection.java rename to apache-libraries/src/main/java/com/baeldung/zookeeper/connection/ZKConnection.java diff --git a/apache-zookeeper/src/main/java/com/baeldung/zookeeper/manager/ZKManager.java b/apache-libraries/src/main/java/com/baeldung/zookeeper/manager/ZKManager.java similarity index 100% rename from apache-zookeeper/src/main/java/com/baeldung/zookeeper/manager/ZKManager.java rename to apache-libraries/src/main/java/com/baeldung/zookeeper/manager/ZKManager.java diff --git a/apache-zookeeper/src/main/java/com/baeldung/zookeeper/manager/ZKManagerImpl.java b/apache-libraries/src/main/java/com/baeldung/zookeeper/manager/ZKManagerImpl.java similarity index 100% rename from apache-zookeeper/src/main/java/com/baeldung/zookeeper/manager/ZKManagerImpl.java rename to apache-libraries/src/main/java/com/baeldung/zookeeper/manager/ZKManagerImpl.java diff --git a/apache-avro/src/main/resources/avroHttpRequest-schema.avsc b/apache-libraries/src/main/resources/avroHttpRequest-schema.avsc similarity index 100% rename from apache-avro/src/main/resources/avroHttpRequest-schema.avsc rename to apache-libraries/src/main/resources/avroHttpRequest-schema.avsc diff --git a/apache-avro/src/main/resources/logback.xml b/apache-libraries/src/main/resources/logback.xml similarity index 100% rename from apache-avro/src/main/resources/logback.xml rename to apache-libraries/src/main/resources/logback.xml diff --git a/apache-opennlp/src/main/resources/models/DoccatSample.txt b/apache-libraries/src/main/resources/models/DoccatSample.txt similarity index 100% rename from apache-opennlp/src/main/resources/models/DoccatSample.txt rename to apache-libraries/src/main/resources/models/DoccatSample.txt diff --git a/apache-opennlp/src/main/resources/models/en-sent.bin b/apache-libraries/src/main/resources/models/en-sent.bin similarity index 100% rename from apache-opennlp/src/main/resources/models/en-sent.bin rename to apache-libraries/src/main/resources/models/en-sent.bin diff --git a/apache-opennlp/src/main/resources/models/en-token.bin b/apache-libraries/src/main/resources/models/en-token.bin similarity index 100% rename from apache-opennlp/src/main/resources/models/en-token.bin rename to apache-libraries/src/main/resources/models/en-token.bin diff --git a/apache-beam/src/test/java/com/baeldung/apache/beam/intro/WordCountUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/beam/intro/WordCountUnitTest.java similarity index 100% rename from apache-beam/src/test/java/com/baeldung/apache/beam/intro/WordCountUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/beam/intro/WordCountUnitTest.java diff --git a/apache-curator/src/test/java/com/baeldung/apache/curator/BaseManualTest.java b/apache-libraries/src/test/java/com/baeldung/apache/curator/BaseManualTest.java similarity index 100% rename from apache-curator/src/test/java/com/baeldung/apache/curator/BaseManualTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/curator/BaseManualTest.java diff --git a/apache-curator/src/test/java/com/baeldung/apache/curator/configuration/ConfigurationManagementManualTest.java b/apache-libraries/src/test/java/com/baeldung/apache/curator/configuration/ConfigurationManagementManualTest.java similarity index 100% rename from apache-curator/src/test/java/com/baeldung/apache/curator/configuration/ConfigurationManagementManualTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/curator/configuration/ConfigurationManagementManualTest.java diff --git a/apache-curator/src/test/java/com/baeldung/apache/curator/connection/ConnectionManagementManualTest.java b/apache-libraries/src/test/java/com/baeldung/apache/curator/connection/ConnectionManagementManualTest.java similarity index 100% rename from apache-curator/src/test/java/com/baeldung/apache/curator/connection/ConnectionManagementManualTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/curator/connection/ConnectionManagementManualTest.java diff --git a/apache-curator/src/test/java/com/baeldung/apache/curator/modeled/ModelTypedExamplesManualTest.java b/apache-libraries/src/test/java/com/baeldung/apache/curator/modeled/ModelTypedExamplesManualTest.java similarity index 100% rename from apache-curator/src/test/java/com/baeldung/apache/curator/modeled/ModelTypedExamplesManualTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/curator/modeled/ModelTypedExamplesManualTest.java diff --git a/apache-curator/src/test/java/com/baeldung/apache/curator/recipes/RecipesManualTest.java b/apache-libraries/src/test/java/com/baeldung/apache/curator/recipes/RecipesManualTest.java similarity index 100% rename from apache-curator/src/test/java/com/baeldung/apache/curator/recipes/RecipesManualTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/curator/recipes/RecipesManualTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/ChunkerUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/ChunkerUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/ChunkerUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/ChunkerUnitTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/LanguageDetectorAndTrainingDataUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/LanguageDetectorAndTrainingDataUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/LanguageDetectorAndTrainingDataUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/LanguageDetectorAndTrainingDataUnitTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/LemmetizerUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/LemmetizerUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/LemmetizerUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/LemmetizerUnitTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/NamedEntityRecognitionUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/NamedEntityRecognitionUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/NamedEntityRecognitionUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/NamedEntityRecognitionUnitTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/POSTaggerUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/POSTaggerUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/POSTaggerUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/POSTaggerUnitTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/SentenceDetectionUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/SentenceDetectionUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/SentenceDetectionUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/SentenceDetectionUnitTest.java diff --git a/apache-opennlp/src/test/java/com/baeldung/apache/opennlp/TokenizerUnitTest.java b/apache-libraries/src/test/java/com/baeldung/apache/opennlp/TokenizerUnitTest.java similarity index 100% rename from apache-opennlp/src/test/java/com/baeldung/apache/opennlp/TokenizerUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/apache/opennlp/TokenizerUnitTest.java diff --git a/apache-avro/src/test/java/com/baeldung/avro/util/serealization/AvroSerealizerDeSerealizerUnitTest.java b/apache-libraries/src/test/java/com/baeldung/avro/util/serealization/AvroSerealizerDeSerealizerUnitTest.java similarity index 100% rename from apache-avro/src/test/java/com/baeldung/avro/util/serealization/AvroSerealizerDeSerealizerUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/avro/util/serealization/AvroSerealizerDeSerealizerUnitTest.java diff --git a/apache-bval/src/test/java/com/baeldung/validation/ValidationIntegrationTest.java b/apache-libraries/src/test/java/com/baeldung/bval/validation/ValidationIntegrationTest.java similarity index 97% rename from apache-bval/src/test/java/com/baeldung/validation/ValidationIntegrationTest.java rename to apache-libraries/src/test/java/com/baeldung/bval/validation/ValidationIntegrationTest.java index ecbcd100da..344aec06d0 100644 --- a/apache-bval/src/test/java/com/baeldung/validation/ValidationIntegrationTest.java +++ b/apache-libraries/src/test/java/com/baeldung/bval/validation/ValidationIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.validation; +package com.baeldung.bval.validation; import java.io.File; import java.util.Set; @@ -13,9 +13,9 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import static org.junit.Assert.*; +import com.baeldung.bval.model.User; -import com.baeldung.model.User; +import static org.junit.Assert.*; public class ValidationIntegrationTest { private static ValidatorFactory validatorFactory; diff --git a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesLiveTest.java b/apache-libraries/src/test/java/com/baeldung/geode/GeodeSamplesLiveTest.java similarity index 100% rename from apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesLiveTest.java rename to apache-libraries/src/test/java/com/baeldung/geode/GeodeSamplesLiveTest.java diff --git a/apache-meecrowave/src/test/java/com/baeldung/meecrowave/ArticleEndpointsUnitTest.java b/apache-libraries/src/test/java/com/baeldung/meecrowave/ArticleEndpointsUnitTest.java similarity index 100% rename from apache-meecrowave/src/test/java/com/baeldung/meecrowave/ArticleEndpointsUnitTest.java rename to apache-libraries/src/test/java/com/baeldung/meecrowave/ArticleEndpointsUnitTest.java diff --git a/apache-solrj/src/test/java/com/baeldung/solrjava/SolrJavaLiveTest.java b/apache-libraries/src/test/java/com/baeldung/solrjava/SolrJavaLiveTest.java similarity index 100% rename from apache-solrj/src/test/java/com/baeldung/solrjava/SolrJavaLiveTest.java rename to apache-libraries/src/test/java/com/baeldung/solrjava/SolrJavaLiveTest.java diff --git a/apache-beam/src/test/resources/wordcount.txt b/apache-libraries/src/test/resources/wordcount.txt similarity index 100% rename from apache-beam/src/test/resources/wordcount.txt rename to apache-libraries/src/test/resources/wordcount.txt diff --git a/apache-meecrowave/README.md b/apache-meecrowave/README.md deleted file mode 100644 index d360af13af..0000000000 --- a/apache-meecrowave/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache Meecrowave - -This module contains articles about Apache Meecrowave - -### Relevant Articles: - -- [Building a Microservice with Apache Meecrowave](https://www.baeldung.com/apache-meecrowave) \ No newline at end of file diff --git a/apache-meecrowave/pom.xml b/apache-meecrowave/pom.xml deleted file mode 100644 index e046599be3..0000000000 --- a/apache-meecrowave/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - apache-meecrowave - 0.0.1 - apache-meecrowave - A sample REST API application with Meecrowave - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - - org.apache.meecrowave - meecrowave-core - ${meecrowave-core.version} - - - - org.apache.meecrowave - meecrowave-jpa - ${meecrowave-jpa.version} - - - - com.squareup.okhttp3 - okhttp - ${okhttp.version} - - - org.apache.meecrowave - meecrowave-junit - ${meecrowave-junit.version} - test - - - - - - - org.apache.meecrowave - meecrowave-maven-plugin - ${meecrowave-maven-plugin.version} - - - - - - 1.8 - 1.8 - 1.2.0 - 3.10.0 - 1.2.1 - 1.2.1 - 1.2.1 - - - \ No newline at end of file diff --git a/apache-opennlp/README.md b/apache-opennlp/README.md deleted file mode 100644 index 4b1fa36540..0000000000 --- a/apache-opennlp/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache OpenNLP - -This module contains articles about Apache OpenNLP - -### Relevant Articles - -- [Intro to Apache OpenNLP](https://www.baeldung.com/apache-open-nlp) diff --git a/apache-opennlp/pom.xml b/apache-opennlp/pom.xml deleted file mode 100644 index 07ce14b4fd..0000000000 --- a/apache-opennlp/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - apache-opennlp - 1.0-SNAPSHOT - apache-opennlp - jar - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.apache.opennlp - opennlp-tools - ${org.apache.opennlp.opennlp-tools.version} - - - org.assertj - assertj-core - ${org.assertj.version} - test - - - - - 3.9.0 - 1.8.4 - - - \ No newline at end of file diff --git a/apache-pulsar/.gitignore b/apache-pulsar/.gitignore deleted file mode 100755 index 1c53e03007..0000000000 --- a/apache-pulsar/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.classpath -.project -.settings -target -.idea -*.iml -.gradle/ -build/ diff --git a/apache-pulsar/README.md b/apache-pulsar/README.md deleted file mode 100644 index c44849a490..0000000000 --- a/apache-pulsar/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache Pulsar - -This module contains articles about Apache Pulsar - -### Relevant Articles: - -- [Introduction to Apache Pulsar](https://www.baeldung.com/apache-pulsar) diff --git a/apache-pulsar/pom.xml b/apache-pulsar/pom.xml deleted file mode 100644 index 568389f9f5..0000000000 --- a/apache-pulsar/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 4.0.0 - com.baeldung.pulsar - apache-pulsar - 0.0.1 - apache-pulsar - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - .. - - - - - org.apache.pulsar - pulsar-client - ${pulsar-client.version} - compile - - - - - 2.1.1-incubating - - - diff --git a/apache-shiro/README.md b/apache-shiro/README.md index ed63c569da..3a0088072f 100644 --- a/apache-shiro/README.md +++ b/apache-shiro/README.md @@ -6,4 +6,4 @@ This module contains articles about Apache Shiro - [Introduction to Apache Shiro](https://www.baeldung.com/apache-shiro) - [Permissions-Based Access Control with Apache Shiro](https://www.baeldung.com/apache-shiro-access-control) - +- [Spring Security vs Apache Shiro](https://www.baeldung.com/spring-security-vs-apache-shiro) diff --git a/apache-shiro/pom.xml b/apache-shiro/pom.xml index 3df6283437..59bb91d400 100644 --- a/apache-shiro/pom.xml +++ b/apache-shiro/pom.xml @@ -39,10 +39,19 @@ jcl-over-slf4j runtime + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + - 1.4.0 + 1.5.3 1.2.17 diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java new file mode 100644 index 0000000000..d82fb1a5d5 --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java @@ -0,0 +1,96 @@ +package com.baeldung.comparison.shiro; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.AuthenticationInfo; +import org.apache.shiro.authc.AuthenticationToken; +import org.apache.shiro.authc.SimpleAuthenticationInfo; +import org.apache.shiro.authc.UnknownAccountException; +import org.apache.shiro.authc.UsernamePasswordToken; +import org.apache.shiro.authz.AuthorizationInfo; +import org.apache.shiro.authz.SimpleAuthorizationInfo; +import org.apache.shiro.realm.jdbc.JdbcRealm; +import org.apache.shiro.subject.PrincipalCollection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CustomRealm extends JdbcRealm { + + private Logger logger = LoggerFactory.getLogger(CustomRealm.class); + + private Map credentials = new HashMap<>(); + private Map> roles = new HashMap<>(); + private Map> permissions = new HashMap<>(); + + { + credentials.put("Tom", "password"); + credentials.put("Jerry", "password"); + + roles.put("Jerry", new HashSet<>(Arrays.asList("ADMIN"))); + roles.put("Tom", new HashSet<>(Arrays.asList("USER"))); + + permissions.put("ADMIN", new HashSet<>(Arrays.asList("READ", "WRITE"))); + permissions.put("USER", new HashSet<>(Arrays.asList("READ"))); + } + + @Override + protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { + + UsernamePasswordToken userToken = (UsernamePasswordToken) token; + + if (userToken.getUsername() == null || userToken.getUsername() + .isEmpty() || !credentials.containsKey(userToken.getUsername())) { + throw new UnknownAccountException("User doesn't exist"); + } + + return new SimpleAuthenticationInfo(userToken.getUsername(), credentials.get(userToken.getUsername()), getName()); + } + + @Override + protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { + Set roles = new HashSet<>(); + Set permissions = new HashSet<>(); + + for (Object user : principals) { + try { + roles.addAll(getRoleNamesForUser(null, (String) user)); + permissions.addAll(getPermissions(null, null, roles)); + } catch (SQLException e) { + logger.error(e.getMessage()); + } + } + SimpleAuthorizationInfo authInfo = new SimpleAuthorizationInfo(roles); + authInfo.setStringPermissions(permissions); + return authInfo; + } + + @Override + protected Set getRoleNamesForUser(Connection conn, String username) throws SQLException { + if (!roles.containsKey(username)) { + throw new SQLException("User doesn't exist"); + } + return roles.get(username); + } + + @Override + protected Set getPermissions(Connection conn, String username, Collection roles) throws SQLException { + Set userPermissions = new HashSet<>(); + + for (String role : roles) { + if (!permissions.containsKey(role)) { + throw new SQLException("Role doesn't exist"); + } + userPermissions.addAll(permissions.get(role)); + } + return userPermissions; + } + +} diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java new file mode 100644 index 0000000000..92d43ea957 --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java @@ -0,0 +1,33 @@ +package com.baeldung.comparison.shiro; + +import org.apache.shiro.realm.Realm; +import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition; +import org.apache.shiro.spring.web.config.ShiroFilterChainDefinition; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication(exclude = SecurityAutoConfiguration.class) +public class ShiroApplication { + + public static void main(String... args) { + SpringApplication.run(ShiroApplication.class, args); + } + + @Bean + public Realm customRealm() { + return new CustomRealm(); + } + + @Bean + public ShiroFilterChainDefinition shiroFilterChainDefinition() { + DefaultShiroFilterChainDefinition filter = new DefaultShiroFilterChainDefinition(); + + filter.addPathDefinition("/home", "authc"); + filter.addPathDefinition("/**", "anon"); + + return filter; + } + +} diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java new file mode 100644 index 0000000000..b819286c57 --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java @@ -0,0 +1,99 @@ +package com.baeldung.comparison.shiro.controllers; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.UsernamePasswordToken; +import org.apache.shiro.subject.Subject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +import com.baeldung.comparison.shiro.models.UserCredentials; + +@Controller +public class ShiroController { + + private Logger logger = LoggerFactory.getLogger(ShiroController.class); + + @GetMapping("/") + public String getIndex() { + return "comparison/index"; + } + + @GetMapping("/login") + public String showLoginPage() { + return "comparison/login"; + } + + @PostMapping("/login") + public String doLogin(HttpServletRequest req, UserCredentials credentials, RedirectAttributes attr) { + + Subject subject = SecurityUtils.getSubject(); + + if (!subject.isAuthenticated()) { + UsernamePasswordToken token = new UsernamePasswordToken(credentials.getUsername(), credentials.getPassword()); + try { + subject.login(token); + } catch (AuthenticationException ae) { + logger.error(ae.getMessage()); + attr.addFlashAttribute("error", "Invalid Credentials"); + return "redirect:/login"; + } + } + return "redirect:/home"; + } + + @GetMapping("/home") + public String getMeHome(Model model) { + + addUserAttributes(model); + + return "comparison/home"; + } + + @GetMapping("/admin") + public String adminOnly(Model model) { + addUserAttributes(model); + + Subject currentUser = SecurityUtils.getSubject(); + if (currentUser.hasRole("ADMIN")) { + model.addAttribute("adminContent", "only admin can view this"); + } + return "comparison/home"; + } + + @PostMapping("/logout") + public String logout() { + Subject subject = SecurityUtils.getSubject(); + subject.logout(); + return "redirect:/"; + } + + private void addUserAttributes(Model model) { + Subject currentUser = SecurityUtils.getSubject(); + String permission = ""; + + if (currentUser.hasRole("ADMIN")) { + model.addAttribute("role", "ADMIN"); + } else if (currentUser.hasRole("USER")) { + model.addAttribute("role", "USER"); + } + + if (currentUser.isPermitted("READ")) { + permission = permission + " READ"; + } + + if (currentUser.isPermitted("WRITE")) { + permission = permission + " WRITE"; + } + model.addAttribute("username", currentUser.getPrincipal()); + model.addAttribute("permission", permission); + } + +} diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java new file mode 100644 index 0000000000..100809f6ea --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java @@ -0,0 +1,28 @@ +package com.baeldung.comparison.shiro.models; + +public class UserCredentials { + + private String username; + private String password; + + 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; + } + + @Override + public String toString() { + return "username = " + getUsername(); + } +} diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java b/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java new file mode 100644 index 0000000000..6878c309df --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java @@ -0,0 +1,19 @@ +package com.baeldung.comparison.springsecurity; + +import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration; +import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration; +import org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration; +import org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication(exclude = {ShiroAutoConfiguration.class, + ShiroAnnotationProcessorAutoConfiguration.class, + ShiroWebAutoConfiguration.class, + ShiroWebFilterConfiguration.class}) +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} \ No newline at end of file diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java b/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java new file mode 100644 index 0000000000..d838eef9b3 --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java @@ -0,0 +1,45 @@ +package com.baeldung.comparison.springsecurity.config; + +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 + protected void configure(HttpSecurity http) throws Exception { + http.csrf().disable().authorizeRequests(authorize -> authorize.antMatchers("/index", "/login") + .permitAll() + .antMatchers("/home", "/logout") + .authenticated() + .antMatchers("/admin/**") + .hasRole("ADMIN")) + .formLogin(formLogin -> formLogin.loginPage("/login") + .failureUrl("/login-error")); + } + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.inMemoryAuthentication() + .withUser("Jerry") + .password(passwordEncoder().encode("password")) + .authorities("READ", "WRITE") + .roles("ADMIN") + .and() + .withUser("Tom") + .password(passwordEncoder().encode("password")) + .authorities("READ") + .roles("USER"); + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + +} diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java b/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java new file mode 100644 index 0000000000..34b6b0c0e3 --- /dev/null +++ b/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java @@ -0,0 +1,79 @@ +package com.baeldung.comparison.springsecurity.web; + +import java.util.Collection; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.User; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class SpringController { + + @GetMapping("/") + public String getIndex() { + return "comparison/index"; + } + + @GetMapping("/login") + public String showLoginPage() { + return "comparison/login"; + } + + @RequestMapping("/login-error") + public String loginError(Model model) { + model.addAttribute("error", "Invalid Credentials"); + return "comparison/login"; + } + + @PostMapping("/login") + public String doLogin(HttpServletRequest req) { + return "redirect:/home"; + } + + @GetMapping("/home") + public String showHomePage(HttpServletRequest req, Model model) { + addUserAttributes(model); + return "comparison/home"; + } + + @GetMapping("/admin") + public String adminOnly(HttpServletRequest req, Model model) { + addUserAttributes(model); + model.addAttribute("adminContent", "only admin can view this"); + return "comparison/home"; + } + + private void addUserAttributes(Model model) { + Authentication auth = SecurityContextHolder.getContext() + .getAuthentication(); + if (auth != null && !auth.getClass() + .equals(AnonymousAuthenticationToken.class)) { + User user = (User) auth.getPrincipal(); + model.addAttribute("username", user.getUsername()); + + Collection authorities = user.getAuthorities(); + + for (GrantedAuthority authority : authorities) { + if (authority.getAuthority() + .contains("USER")) { + model.addAttribute("role", "USER"); + model.addAttribute("permission", "READ"); + } else if (authority.getAuthority() + .contains("ADMIN")) { + model.addAttribute("role", "ADMIN"); + model.addAttribute("permission", "READ WRITE"); + } + } + } + } + +} diff --git a/apache-shiro/src/main/java/com/baeldung/Main.java b/apache-shiro/src/main/java/com/baeldung/intro/Main.java similarity index 99% rename from apache-shiro/src/main/java/com/baeldung/Main.java rename to apache-shiro/src/main/java/com/baeldung/intro/Main.java index 99515bb705..fbd3bc7ac7 100644 --- a/apache-shiro/src/main/java/com/baeldung/Main.java +++ b/apache-shiro/src/main/java/com/baeldung/intro/Main.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.intro; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; diff --git a/apache-shiro/src/main/java/com/baeldung/MyCustomRealm.java b/apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java similarity index 99% rename from apache-shiro/src/main/java/com/baeldung/MyCustomRealm.java rename to apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java index 6d7c01d96e..9d65e37ec4 100644 --- a/apache-shiro/src/main/java/com/baeldung/MyCustomRealm.java +++ b/apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.intro; import java.sql.Connection; import java.sql.SQLException; diff --git a/apache-shiro/src/main/java/com/baeldung/ShiroSpringApplication.java b/apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java similarity index 80% rename from apache-shiro/src/main/java/com/baeldung/ShiroSpringApplication.java rename to apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java index e12d3ebffa..dc288a273b 100644 --- a/apache-shiro/src/main/java/com/baeldung/ShiroSpringApplication.java +++ b/apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.intro; import org.apache.shiro.realm.Realm; import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition; @@ -7,12 +7,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.context.annotation.Bean; /** * Created by smatt on 21/08/2017. */ -@SpringBootApplication +@SpringBootApplication(exclude = SecurityAutoConfiguration.class) public class ShiroSpringApplication { private static final transient Logger log = LoggerFactory.getLogger(ShiroSpringApplication.class); @@ -29,7 +30,7 @@ public class ShiroSpringApplication { @Bean - public ShiroFilterChainDefinition shiroFilterChainDefinition() { + public ShiroFilterChainDefinition filterChainDefinition() { DefaultShiroFilterChainDefinition filter = new DefaultShiroFilterChainDefinition(); diff --git a/apache-shiro/src/main/java/com/baeldung/controllers/ShiroSpringController.java b/apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java similarity index 97% rename from apache-shiro/src/main/java/com/baeldung/controllers/ShiroSpringController.java rename to apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java index 2713786d71..1605f390a8 100644 --- a/apache-shiro/src/main/java/com/baeldung/controllers/ShiroSpringController.java +++ b/apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java @@ -1,6 +1,5 @@ -package com.baeldung.controllers; +package com.baeldung.intro.controllers; -import com.baeldung.models.UserCredentials; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.UsernamePasswordToken; @@ -13,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import com.baeldung.intro.models.UserCredentials; + import javax.servlet.http.HttpServletRequest; @Controller diff --git a/apache-shiro/src/main/java/com/baeldung/models/UserCredentials.java b/apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java similarity index 95% rename from apache-shiro/src/main/java/com/baeldung/models/UserCredentials.java rename to apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java index 51b429046a..6614d07257 100644 --- a/apache-shiro/src/main/java/com/baeldung/models/UserCredentials.java +++ b/apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java @@ -1,4 +1,4 @@ -package com.baeldung.models; +package com.baeldung.intro.models; public class UserCredentials { diff --git a/apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/Main.java b/apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java similarity index 98% rename from apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/Main.java rename to apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java index a902a24388..c9ab2b6e37 100644 --- a/apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/Main.java +++ b/apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java @@ -1,4 +1,4 @@ -package com.baeldung.shiro.permissions.custom; +package com.baeldung.permissions.custom; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; diff --git a/apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/PathPermission.java b/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java similarity index 90% rename from apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/PathPermission.java rename to apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java index f7dfbda06a..828484087f 100644 --- a/apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/PathPermission.java +++ b/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java @@ -1,4 +1,4 @@ -package com.baeldung.shiro.permissions.custom; +package com.baeldung.permissions.custom; import org.apache.shiro.authz.Permission; diff --git a/apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/PathPermissionResolver.java b/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java similarity index 88% rename from apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/PathPermissionResolver.java rename to apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java index 4b60d2fbd4..30bdece65f 100644 --- a/apache-shiro/src/main/java/com/baeldung/shiro/permissions/custom/PathPermissionResolver.java +++ b/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java @@ -1,4 +1,4 @@ -package com.baeldung.shiro.permissions.custom; +package com.baeldung.permissions.custom; import org.apache.shiro.authz.Permission; import org.apache.shiro.authz.permission.PermissionResolver; diff --git a/apache-shiro/src/main/resources/templates/comparison/home.ftl b/apache-shiro/src/main/resources/templates/comparison/home.ftl new file mode 100644 index 0000000000..37eb3d1812 --- /dev/null +++ b/apache-shiro/src/main/resources/templates/comparison/home.ftl @@ -0,0 +1,19 @@ + + + Home Page + + +

Welcome ${username}!

+

Role: ${role}

+

Permissions

+

${permission}

+Admin only +<#if adminContent??> + ${adminContent} + +
+
+ +
+ + \ No newline at end of file diff --git a/apache-shiro/src/main/resources/templates/comparison/index.ftl b/apache-shiro/src/main/resources/templates/comparison/index.ftl new file mode 100644 index 0000000000..8f35c0af1b --- /dev/null +++ b/apache-shiro/src/main/resources/templates/comparison/index.ftl @@ -0,0 +1,10 @@ + + + Index + + +

Welcome Guest!

+
+ Go to the secured page + + \ No newline at end of file diff --git a/apache-shiro/src/main/resources/templates/comparison/login.ftl b/apache-shiro/src/main/resources/templates/comparison/login.ftl new file mode 100644 index 0000000000..7340f47204 --- /dev/null +++ b/apache-shiro/src/main/resources/templates/comparison/login.ftl @@ -0,0 +1,25 @@ + + + Login + + +

Login

+
+
+ <#if (error?length > 0)??> +

${error}

+ <#else> + + + +
+ +

+ +
+ +

+ +
+ + \ No newline at end of file diff --git a/apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java b/apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java new file mode 100644 index 0000000000..0d150d0fad --- /dev/null +++ b/apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java @@ -0,0 +1,20 @@ +package com.baeldung.comparison.shiro; + + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import com.baeldung.comparison.shiro.ShiroApplication; + +@ExtendWith(SpringExtension.class) +@SpringBootTest(classes = { ShiroApplication.class }) +public class SpringContextTest { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + + } + +} \ No newline at end of file diff --git a/apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java b/apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java new file mode 100644 index 0000000000..5044b40e31 --- /dev/null +++ b/apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java @@ -0,0 +1,19 @@ +package com.baeldung.comparison.springsecurity; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import com.baeldung.comparison.springsecurity.Application; + +@ExtendWith(SpringExtension.class) +@SpringBootTest(classes = { Application.class }) +public class SpringContextTest { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + + } + +} \ No newline at end of file diff --git a/apache-solrj/README.md b/apache-solrj/README.md deleted file mode 100644 index 803db393e9..0000000000 --- a/apache-solrj/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache Solrj - -This module contains articles about Apache Solrj - -### Relevant Articles: - -- [Guide to Solr in Java with Apache Solrj](https://www.baeldung.com/apache-solrj) \ No newline at end of file diff --git a/apache-solrj/pom.xml b/apache-solrj/pom.xml deleted file mode 100644 index 165cd9571b..0000000000 --- a/apache-solrj/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - apache-solrj - 0.0.1-SNAPSHOT - apache-solrj - jar - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.apache.solr - solr-solrj - ${org.apache.solr.solr-solrj.version} - - - - - 6.4.0 - - - \ No newline at end of file diff --git a/apache-solrj/src/main/resources/logback.xml b/apache-solrj/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/apache-solrj/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/apache-zookeeper/README.md b/apache-zookeeper/README.md deleted file mode 100644 index cda1cd6d73..0000000000 --- a/apache-zookeeper/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Apache Zookeeper - -This module contains articles about Apache Zookeeper - -### Relevant articles: - -- [Getting Started with Java and Zookeeper](https://www.baeldung.com/java-zookeeper) diff --git a/apache-zookeeper/pom.xml b/apache-zookeeper/pom.xml deleted file mode 100644 index f441848f70..0000000000 --- a/apache-zookeeper/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - apache-zookeeper - 0.0.1-SNAPSHOT - apache-zookeeper - jar - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.apache.zookeeper - zookeeper - ${org.apache.zookeeper.version} - - - - - 3.4.11 - - - - diff --git a/apache-zookeeper/src/main/resources/logback.xml b/apache-zookeeper/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/apache-zookeeper/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/atomikos/pom.xml b/atomikos/pom.xml index 881adae074..d680a3ca77 100644 --- a/atomikos/pom.xml +++ b/atomikos/pom.xml @@ -41,7 +41,7 @@ org.springframework.data spring-data-jpa - 1.11.23.RELEASE + ${spring-data-jpa.version} org.springframework @@ -64,49 +64,49 @@ org.apache.activemq activemq-core - 5.7.0 + ${activemq-core.version} org.apache.derby derby - 10.8.1.2 + ${derby.version} junit junit - 4.12 + ${junit.version} test javax.transaction jta - 1.1 + ${jta.version} org.apache.geronimo.specs geronimo-jta_1.0.1B_spec - 1.0 + ${geronimo.version} javax.validation validation-api - 2.0.1.Final + ${validation-api.version} org.hibernate.validator hibernate-validator - 6.1.2.Final + ${hibernate-validator.version} javax.el javax.el-api - 3.0.0 + ${javax.el-api.version} org.glassfish.web javax.el - 2.2.4 + ${javax.el.version} @@ -114,6 +114,15 @@ 5.0.6 5.1.6.RELEASE 5.4.3.Final + 1.11.23.RELEASE + 5.7.0 + 10.8.1.2 + 1.1 + 1.0 + 2.0.1.Final + 6.1.2.Final + 3.0.0 + 2.2.4 \ No newline at end of file diff --git a/aws-app-sync/pom.xml b/aws-app-sync/pom.xml index 1f915978ab..5ef150de01 100644 --- a/aws-app-sync/pom.xml +++ b/aws-app-sync/pom.xml @@ -2,23 +2,16 @@ 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - - - com.baeldung aws-app-sync - 0.0.1-SNAPSHOT aws-app-sync - Spring Boot using AWS App Sync - - - 1.8 - + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationUnitTest.java similarity index 98% rename from aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java rename to aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationUnitTest.java index 2338cc29a1..8d83dd5b4b 100644 --- a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationUnitTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.*; @SpringBootTest @Disabled -class AwsAppSyncApplicationTests { +class AwsAppSyncApplicationUnitTest { @Test void givenGraphQuery_whenListEvents_thenReturnAllEvents() { diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml index 8706bd3b53..4d64307558 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.example cf-uaa-oauth2-client - uaa-client-webapp + cf-uaa-oauth2-client Demo project for Spring Boot diff --git a/core-groovy-2/determine-datatype/pom.xml b/core-groovy-2/determine-datatype/pom.xml deleted file mode 100644 index 0bcef4e5d8..0000000000 --- a/core-groovy-2/determine-datatype/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - 4.0.0 - com.baeldung.groovy - determine-datatype - 0.0.1-SNAPSHOT - - src - - - maven-compiler-plugin - 3.8.0 - - 1.8 - 1.8 - - - - org.codehaus.gmaven - groovy-maven-plugin - - - org.codehaus.groovy - groovy-all - 2.0.6 - - - - - - - - - org.junit - junit5-engine - 5.0.0-ALPHA - - - \ No newline at end of file diff --git a/core-groovy-2/determine-datatype/src/com/baeldung/groovy/determine/datatype/Person.groovy b/core-groovy-2/determine-datatype/src/com/baeldung/groovy/determine/datatype/Person.groovy deleted file mode 100644 index 1a89dce435..0000000000 --- a/core-groovy-2/determine-datatype/src/com/baeldung/groovy/determine/datatype/Person.groovy +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.groovy.determine.datatype - -class Person { - - private int ageAsInt - private Double ageAsDouble - private String ageAsString - - Person() {} - Person(int ageAsInt) { this.ageAsInt = ageAsInt} - Person(Double ageAsDouble) { this.ageAsDouble = ageAsDouble} - Person(String ageAsString) { this.ageAsString = ageAsString} -} -class Student extends Person {} diff --git a/core-groovy-2/determine-datatype/src/com/baeldung/groovy/determine/datatype/PersonTest.groovy b/core-groovy-2/determine-datatype/src/com/baeldung/groovy/determine/datatype/PersonTest.groovy deleted file mode 100644 index 56095a3f1b..0000000000 --- a/core-groovy-2/determine-datatype/src/com/baeldung/groovy/determine/datatype/PersonTest.groovy +++ /dev/null @@ -1,55 +0,0 @@ -package com.baeldung.groovy.determine.datatype; - -import org.junit.Assert -import org.junit.Test; - -public class PersonTest { - - @Test - public void givenWhenParameterTypeIsInteger_thenReturnTrue() { - Person personObj = new Person(10) - Assert.assertTrue(personObj.ageAsInt instanceof Integer); - } - - @Test - public void givenWhenParameterTypeIsDouble_thenReturnTrue() { - Person personObj = new Person(10.0) - Assert.assertTrue((personObj.ageAsDouble).getClass() == Double) - } - - @Test - public void givenWhenParameterTypeIsString_thenReturnTrue() { - Person personObj = new Person("10 years") - Assert.assertTrue(personObj.ageAsString.class == String) - } - - @Test - public void givenClassName_WhenParameterIsInteger_thenReturnTrue() { - Assert.assertTrue(Person.class.getDeclaredField('ageAsInt').type == int.class) - } - - @Test - public void givenWhenObjectIsInstanceOfType_thenReturnTrue() { - Person personObj = new Person() - Assert.assertTrue(personObj instanceof Person) - } - - @Test - public void givenWhenInstanceIsOfSubtype_thenReturnTrue() { - Student studentObj = new Student() - Assert.assertTrue(studentObj in Person) - } - - @Test - public void givenGroovyList_WhenFindClassName_thenReturnTrue() { - def ageList = ['ageAsString','ageAsDouble', 10] - Assert.assertTrue(ageList.class == ArrayList) - Assert.assertTrue(ageList.getClass() == ArrayList) - } - - @Test - public void givenGrooyMap_WhenFindClassName_thenReturnTrue() { - def ageMap = [ageAsString: '10 years', ageAsDouble: 10.0] - Assert.assertFalse(ageMap.class == LinkedHashMap) - } -} \ No newline at end of file diff --git a/core-groovy-2/pom.xml b/core-groovy-2/pom.xml index a01560781b..b1bfa19771 100644 --- a/core-groovy-2/pom.xml +++ b/core-groovy-2/pom.xml @@ -159,7 +159,7 @@ central - http://jcenter.bintray.com + https://jcenter.bintray.com diff --git a/core-groovy/README.md b/core-groovy/README.md index f852b3ccf2..70e8d262ce 100644 --- a/core-groovy/README.md +++ b/core-groovy/README.md @@ -13,4 +13,5 @@ This module contains articles about core Groovy concepts - [Converting a String to a Date in Groovy](https://www.baeldung.com/groovy-string-to-date) - [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io) - [Convert String to Integer in Groovy](https://www.baeldung.com/groovy-convert-string-to-integer) +- [Groovy Variable Scope](https://www.baeldung.com/groovy/variable-scope) - [[More -->]](/core-groovy-2) diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 69833ff74d..82a68f0ff8 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/pom.xml @@ -105,7 +105,7 @@ central - http://jcenter.bintray.com + https://jcenter.bintray.com diff --git a/core-groovy/src/main/groovy/com/baeldung/scopes/Scopes.groovy b/core-groovy/src/main/groovy/com/baeldung/scopes/Scopes.groovy new file mode 100644 index 0000000000..f17b946b1a --- /dev/null +++ b/core-groovy/src/main/groovy/com/baeldung/scopes/Scopes.groovy @@ -0,0 +1,26 @@ +package com.baeldung.scopes + +import java.util.logging.Logger + +x = 200 +logger = Logger.getLogger("Scopes.groovy") + +def getGlobalResult() { + logger.info(x.toString()) + return 1 + x +} + +def defineGlobalVariable() { + z = 234 + logger = Logger.getLogger("Scopes.groovy") + logger.info(z.toString()) +} + +logger.info("- Global variable") +logger.info(x.toString()) +logger.info("- Access global variable from inside function") +logger.info(getGlobalResult().toString()) +logger.info("- function called to create variable") +defineGlobalVariable() +logger.info("- Variable created inside a function") +logger.info(z.toString()) diff --git a/core-groovy/src/main/groovy/com/baeldung/scopes/ScopesFail.groovy b/core-groovy/src/main/groovy/com/baeldung/scopes/ScopesFail.groovy new file mode 100644 index 0000000000..d32abfc7ea --- /dev/null +++ b/core-groovy/src/main/groovy/com/baeldung/scopes/ScopesFail.groovy @@ -0,0 +1,21 @@ +package com.baeldung.scopes + +import java.util.logging.Logger + +logger = Logger.getLogger("ScopesFail.groovy") + +y = 2 + +def fLocal() { + def q = 333 + println(q) + q +} + +fLocal() + +logger.info("- Value of the created variable") +logger.info(fLocal()) +logger.info("- Local variable doesn't exist outside") +logger.info(q.toString()) + diff --git a/core-groovy/src/main/groovy/com/baeldung/scopes/ScopesFailNoPrint.groovy b/core-groovy/src/main/groovy/com/baeldung/scopes/ScopesFailNoPrint.groovy new file mode 100644 index 0000000000..3f1fdb45a2 --- /dev/null +++ b/core-groovy/src/main/groovy/com/baeldung/scopes/ScopesFailNoPrint.groovy @@ -0,0 +1,15 @@ +package com.baeldung.scopes + +import java.util.logging.Logger + +logger = Logger.getLogger("ScopesFailNoPrint.groovy") + +y = 2 + +def fLocal() { + def q = 333 + println(q) + q +} + +logger.info(y.toString()) diff --git a/core-java-modules/core-java-11/README.md b/core-java-modules/core-java-11/README.md index 70e2e66737..a3601c8339 100644 --- a/core-java-modules/core-java-11/README.md +++ b/core-java-modules/core-java-11/README.md @@ -8,7 +8,7 @@ This module contains articles about Java 11 core features - [Java 11 Local Variable Syntax for Lambda Parameters](https://www.baeldung.com/java-var-lambda-params) - [Java 11 String API Additions](https://www.baeldung.com/java-11-string-api) - [Java 11 Nest Based Access Control](https://www.baeldung.com/java-nest-based-access-control) -- [Exploring the New HTTP Client in Java 9 and 11](https://www.baeldung.com/java-9-http-client) +- [Exploring the New HTTP Client in Java](https://www.baeldung.com/java-9-http-client) - [An Introduction to Epsilon GC: A No-Op Experimental Garbage Collector](https://www.baeldung.com/jvm-epsilon-gc-garbage-collector) - [Guide to jlink](https://www.baeldung.com/jlink) - [Negate a Predicate Method Reference with Java 11](https://www.baeldung.com/java-negate-predicate-method-reference) diff --git a/core-java-modules/core-java-8-datetime-2/pom.xml b/core-java-modules/core-java-8-datetime-2/pom.xml index f66a89ca55..0e60941cc7 100644 --- a/core-java-modules/core-java-8-datetime-2/pom.xml +++ b/core-java-modules/core-java-8-datetime-2/pom.xml @@ -6,7 +6,7 @@ 4.0.0 core-java-8-datetime-2 ${project.parent.version} - core-java-8-datetime + core-java-8-datetime-2 jar com.baeldung.core-java-modules diff --git a/core-java-modules/core-java-9-improvements/pom.xml b/core-java-modules/core-java-9-improvements/pom.xml index 5cc4fce7a9..bf68cfbd47 100644 --- a/core-java-modules/core-java-9-improvements/pom.xml +++ b/core-java-modules/core-java-9-improvements/pom.xml @@ -64,7 +64,7 @@ apache.snapshots - http://repository.apache.org/snapshots/ + https://repository.apache.org/snapshots/ diff --git a/core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java b/core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java index eb32cafa31..270bf66c81 100644 --- a/core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java +++ b/core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java @@ -1,12 +1,15 @@ package com.baeldung.modules.main; +import com.baeldung.modules.hello.HelloInterface; import com.baeldung.modules.hello.HelloModules; +import java.util.ServiceLoader; public class MainApp { public static void main(String[] args) { HelloModules.doSomething(); - - HelloModules module = new HelloModules(); - module.sayHello(); + + Iterable services = ServiceLoader.load(HelloInterface.class); + HelloInterface service = services.iterator().next(); + service.sayHello(); } } diff --git a/core-java-modules/core-java-9-new-features/README.md b/core-java-modules/core-java-9-new-features/README.md index c2ef63a530..d10d0aad2d 100644 --- a/core-java-modules/core-java-9-new-features/README.md +++ b/core-java-modules/core-java-9-new-features/README.md @@ -13,3 +13,4 @@ This module contains articles about core Java features that have been introduced - [Java 9 Platform Logging API](https://www.baeldung.com/java-9-logging-api) - [Java 9 Reactive Streams](https://www.baeldung.com/java-9-reactive-streams) - [Multi-Release JAR Files with Maven](https://www.baeldung.com/maven-multi-release-jars) +- [The Difference between RxJava API and the Java 9 Flow API](https://www.baeldung.com/rxjava-vs-java-flow-api) diff --git a/core-java-modules/core-java-9-new-features/pom.xml b/core-java-modules/core-java-9-new-features/pom.xml index 4edf6e4fc5..2f07a665a4 100644 --- a/core-java-modules/core-java-9-new-features/pom.xml +++ b/core-java-modules/core-java-9-new-features/pom.xml @@ -149,7 +149,7 @@ apache.snapshots - http://repository.apache.org/snapshots/ + https://repository.apache.org/snapshots/ diff --git a/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/currentmethod/CurrentExecutingMethodUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/currentmethod/CurrentExecutingMethodUnitTest.java new file mode 100644 index 0000000000..6a130834e0 --- /dev/null +++ b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/currentmethod/CurrentExecutingMethodUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.java9.currentmethod; + +import org.junit.Test; + +import java.util.Optional; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class CurrentExecutingMethodUnitTest { + + @Test + public void givenJava9_whenWalkingTheStack_thenFindMethod() { + StackWalker walker = StackWalker.getInstance(); + Optional methodName = walker.walk(frames -> frames + .findFirst() + .map(StackWalker.StackFrame::getMethodName) + ); + + assertTrue(methodName.isPresent()); + assertEquals("givenJava9_whenWalkingTheStack_thenFindMethod", methodName.get()); + } +} diff --git a/core-java-modules/core-java-9/README.md b/core-java-modules/core-java-9/README.md index 0a9bf76ac4..cab02369cc 100644 --- a/core-java-modules/core-java-9/README.md +++ b/core-java-modules/core-java-9/README.md @@ -9,3 +9,4 @@ This module contains articles about Java 9 core features - [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) - [Immutable ArrayList in Java](https://www.baeldung.com/java-immutable-list) +- [Easy Ways to Write a Java InputStream to an OutputStream](https://www.baeldung.com/java-inputstream-to-outputstream) diff --git a/core-java-modules/core-java-9/pom.xml b/core-java-modules/core-java-9/pom.xml index b6dff0a3a4..0669d6f597 100644 --- a/core-java-modules/core-java-9/pom.xml +++ b/core-java-modules/core-java-9/pom.xml @@ -64,7 +64,7 @@ apache.snapshots - http://repository.apache.org/snapshots/ + https://repository.apache.org/snapshots/ diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/inputstream/outputstream/InputStreamToOutputStreamUnitTest.java b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/inputstream/outputstream/InputStreamToOutputStreamUnitTest.java new file mode 100644 index 0000000000..814824e580 --- /dev/null +++ b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/inputstream/outputstream/InputStreamToOutputStreamUnitTest.java @@ -0,0 +1,87 @@ +package com.baeldung.java9.inputstream.outputstream; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.junit.Assert.assertEquals; + +import java.io.*; + +import org.apache.commons.io.IOUtils; +import org.junit.Test; + +import com.google.common.io.ByteStreams; + +public class InputStreamToOutputStreamUnitTest { + + /** + * Reads all bytes from an input stream and writes them to an output stream. + * @param source - input stream to copy data from + * @param target - output stream to copy data too + */ + void copy(InputStream source, OutputStream target) throws IOException { + byte[] buf = new byte[8192]; + int length; + while ((length = source.read(buf)) > 0) { + target.write(buf, 0, length); + } + } + + @Test + public void givenUsingJavaEight_whenCopyingInputStreamToOutputStream_thenCorrect() throws IOException { + String initialString = "Hello World!"; + + try (InputStream inputStream = new ByteArrayInputStream(initialString.getBytes()); + ByteArrayOutputStream targetStream = new ByteArrayOutputStream()) { + copy(inputStream, targetStream); + + assertEquals(initialString, new String(targetStream.toByteArray())); + } + } + + @Test + public void givenUsingJavaEight_whenCopyingLongInputStreamToOutputStream_thenCorrect() throws IOException { + String initialString = randomAlphabetic(20480); + + try (InputStream inputStream = new ByteArrayInputStream(initialString.getBytes()); + ByteArrayOutputStream targetStream = new ByteArrayOutputStream()) { + copy(inputStream, targetStream); + + assertEquals(initialString, new String(targetStream.toByteArray())); + } + } + + @Test + public void givenUsingJavaNine_whenCopyingInputStreamToOutputStream_thenCorrect() throws IOException { + String initialString = "Hello World!"; + + try (InputStream inputStream = new ByteArrayInputStream(initialString.getBytes()); + ByteArrayOutputStream targetStream = new ByteArrayOutputStream()) { + inputStream.transferTo(targetStream); + + assertEquals(initialString, new String(targetStream.toByteArray())); + } + } + + @Test + public void givenUsingGuava_whenCopyingInputStreamToOutputStream_thenCorrect() throws IOException { + String initialString = "Hello World!"; + + try (InputStream inputStream = new ByteArrayInputStream(initialString.getBytes()); + ByteArrayOutputStream targetStream = new ByteArrayOutputStream()) { + ByteStreams.copy(inputStream, targetStream); + + assertEquals(initialString, new String(targetStream.toByteArray())); + } + } + + @Test + public void givenUsingCommonsIO_whenCopyingInputStreamToOutputStream_thenCorrect() throws IOException { + String initialString = "Hello World!"; + + try (InputStream inputStream = new ByteArrayInputStream(initialString.getBytes()); + ByteArrayOutputStream targetStream = new ByteArrayOutputStream()) { + IOUtils.copy(inputStream, targetStream); + + assertEquals(initialString, new String(targetStream.toByteArray())); + } + } +} diff --git a/core-java-modules/core-java-arrays-guides/README.md b/core-java-modules/core-java-arrays-guides/README.md index 2e66080002..621443e4a9 100644 --- a/core-java-modules/core-java-arrays-guides/README.md +++ b/core-java-modules/core-java-arrays-guides/README.md @@ -4,4 +4,5 @@ This module contains complete guides about arrays in Java ### Relevant Articles: - [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) -- [Guide to the java.util.Arrays Class](https://www.baeldung.com/java-util-arrays) \ No newline at end of file +- [Guide to the java.util.Arrays Class](https://www.baeldung.com/java-util-arrays) +- [What is \[Ljava.lang.Object;?](https://www.baeldung.com/java-tostring-array) diff --git a/core-java-modules/core-java-arrays-operations-basic/pom.xml b/core-java-modules/core-java-arrays-operations-basic/pom.xml index 73588d662a..64856d9b39 100644 --- a/core-java-modules/core-java-arrays-operations-basic/pom.xml +++ b/core-java-modules/core-java-arrays-operations-basic/pom.xml @@ -13,32 +13,6 @@ core-java-arrays-operations-basic jar - - - - org.apache.maven.plugins - maven-shade-plugin - ${shade.plugin.version} - - - package - - shade - - - benchmarks - - - org.openjdk.jmh.Main - - - - - - - - - org.apache.commons @@ -66,6 +40,32 @@ + + + + org.apache.maven.plugins + maven-shade-plugin + ${shade.plugin.version} + + + package + + shade + + + benchmarks + + + org.openjdk.jmh.Main + + + + + + + + + 3.2.0 diff --git a/core-java-modules/core-java-arrays-sorting/pom.xml b/core-java-modules/core-java-arrays-sorting/pom.xml index d5e2beaac4..9b307870a1 100644 --- a/core-java-modules/core-java-arrays-sorting/pom.xml +++ b/core-java-modules/core-java-arrays-sorting/pom.xml @@ -14,32 +14,6 @@ core-java-arrays-sorting jar - - - - org.apache.maven.plugins - maven-shade-plugin - ${shade.plugin.version} - - - package - - shade - - - benchmarks - - - org.openjdk.jmh.Main - - - - - - - - - @@ -74,6 +48,32 @@ + + + + org.apache.maven.plugins + maven-shade-plugin + ${shade.plugin.version} + + + package + + shade + + + benchmarks + + + org.openjdk.jmh.Main + + + + + + + + + 3.2.0 diff --git a/core-java-modules/core-java-collections-3/README.md b/core-java-modules/core-java-collections-3/README.md index fb983d9abc..4349ef6be3 100644 --- a/core-java-modules/core-java-collections-3/README.md +++ b/core-java-modules/core-java-collections-3/README.md @@ -3,6 +3,7 @@ ## Core Java Collections Cookbooks and Examples ### Relevant Articles: + - [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint) - [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector) - [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences) @@ -10,3 +11,4 @@ - [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance) - [Fail-Safe Iterator vs Fail-Fast Iterator](https://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator) - [Quick Guide to the Java Stack](https://www.baeldung.com/java-stack) +- [Convert an Array of Primitives to a List](https://www.baeldung.com/java-primitive-array-to-list) diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml index bd991bfefa..b206cd61d2 100644 --- a/core-java-modules/core-java-collections-3/pom.xml +++ b/core-java-modules/core-java-collections-3/pom.xml @@ -27,6 +27,11 @@ ${assertj.version} test + + org.apache.commons + commons-lang3 + 3.10 + diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/convertarrayprimitives/ConvertPrimitivesArrayToList.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/convertarrayprimitives/ConvertPrimitivesArrayToList.java new file mode 100644 index 0000000000..f7be99abdc --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/convertarrayprimitives/ConvertPrimitivesArrayToList.java @@ -0,0 +1,47 @@ +package com.baeldung.collections.iterators; + +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import com.google.common.primitives.Ints; +import org.apache.commons.lang3.ArrayUtils; + +public class ConvertPrimitivesArrayToList { + + public static void failConvert() { + int[] input = new int[]{1,2,3,4}; + // List inputAsList = Arrays.asList(input); + } + + public static List iterateConvert(int[] input) { + List output = new ArrayList(); + for (int value : input) { + output.add(value); + } + return output; + } + + public static List streamConvert(int[] input) { + List output = Arrays.stream(input).boxed().collect(Collectors.toList()); + return output; + } + + public static List streamConvertIntStream(int[] input) { + List output = IntStream.of(input).boxed().collect(Collectors.toList()); + return output; + } + + public static List guavaConvert(int[] input) { + List output = Ints.asList(input); + return output; + } + + public static List apacheCommonConvert(int[] input) { + Integer[] outputBoxed = ArrayUtils.toObject(input); + List output = Arrays.asList(outputBoxed); + return output; + } + +} diff --git a/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/convertarrayprimitives/ConvertPrimitivesArrayToListUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/convertarrayprimitives/ConvertPrimitivesArrayToListUnitTest.java new file mode 100644 index 0000000000..b773baf7d8 --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/convertarrayprimitives/ConvertPrimitivesArrayToListUnitTest.java @@ -0,0 +1,38 @@ +package com.baeldung.collections.iterators; + +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.stream.Collectors; +import com.google.common.primitives.Ints; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ConvertPrimitivesArrayToListUnitTest { + + @Test + public void givenArrayWithPrimitives_whenIterativeConvert_thenArrayGetsConverted() { + assertEquals(Arrays.asList(1,2,3,4), ConvertPrimitivesArrayToList.iterateConvert(new int[]{1,2,3,4})); + } + + @Test + public void givenArrayWithPrimitives_whenStreamConvert_thenArrayGetsConverted() { + assertEquals(Arrays.asList(1,2,3,4), ConvertPrimitivesArrayToList.streamConvert(new int[]{1,2,3,4})); + } + + @Test + public void givenArrayWithPrimitives_whenIntStreamConvert_thenArrayGetsConverted() { + assertEquals(Arrays.asList(1,2,3,4), ConvertPrimitivesArrayToList.streamConvertIntStream(new int[]{1,2,3,4})); + } + + @Test + public void givenArrayWithPrimitives_whenGuavaConvert_thenArrayGetsConverted() { + assertEquals(Arrays.asList(1,2,3,4), ConvertPrimitivesArrayToList.guavaConvert(new int[]{1,2,3,4})); + } + + @Test + public void givenArrayWithPrimitives_whenApacheCommonConvert_thenArrayGetsConverted() { + assertEquals(Arrays.asList(1,2,3,4), ConvertPrimitivesArrayToList.apacheCommonConvert(new int[]{1,2,3,4})); + } +} diff --git a/core-java-modules/core-java-concurrency-2/pom.xml b/core-java-modules/core-java-concurrency-2/pom.xml index 75fd3890b3..253537bc2b 100644 --- a/core-java-modules/core-java-concurrency-2/pom.xml +++ b/core-java-modules/core-java-concurrency-2/pom.xml @@ -19,31 +19,31 @@ junit junit - 4.13 + ${junit.version} test com.googlecode.thread-weaver threadweaver - 0.2 + ${threadweaver.version} test com.google.code.tempus-fugit tempus-fugit - 1.1 + ${tempus-fugit.version} test com.googlecode.multithreadedtc multithreadedtc - 1.01 + ${multithreadedtc.version} test org.openjdk.jcstress jcstress-core - 0.5 + ${jcstress-core.version} @@ -63,8 +63,8 @@ 3.1 ${javac.target} - ${javac.target} - ${javac.target} + ${java.version} + ${java.version} @@ -99,7 +99,11 @@ - 1.8 + 4.13 + 0.2 + 1.1 + 1.01 + 0.5 diff --git a/core-java-modules/core-java-concurrency-advanced-3/README.md b/core-java-modules/core-java-concurrency-advanced-3/README.md index ca29e5ca85..7d98e462d7 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/README.md +++ b/core-java-modules/core-java-concurrency-advanced-3/README.md @@ -14,4 +14,6 @@ This module contains articles about advanced topics about multithreading with co - [Guide to AtomicStampedReference in Java](https://www.baeldung.com/java-atomicstampedreference) - [The ABA Problem in Concurrency](https://www.baeldung.com/cs/aba-concurrency) - [Introduction to Lock-Free Data Structures](https://www.baeldung.com/lock-free-programming) +- [Introduction to Exchanger in Java](https://www.baeldung.com/java-exchanger) +- [Why Not To Start A Thread In The Constructor?](https://www.baeldung.com/java-thread-constructor) - [[<-- previous]](/core-java-modules/core-java-concurrency-advanced-2) diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md index c7143baf36..a8daf14ea9 100644 --- a/core-java-modules/core-java-concurrency-basic-2/README.md +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -3,10 +3,12 @@ This module contains articles about basic Java concurrency ### Relevant Articles: + - [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) - [wait and notify() Methods in Java](https://www.baeldung.com/java-wait-notify) - [Difference Between Wait and Sleep in Java](https://www.baeldung.com/java-wait-and-sleep) - [Guide to the Synchronized Keyword in Java](https://www.baeldung.com/java-synchronized) - [Life Cycle of a Thread in Java](https://www.baeldung.com/java-thread-lifecycle) - [Guide to AtomicMarkableReference](https://www.baeldung.com/java-atomicmarkablereference) +- [Why are Local Variables Thread-Safe in Java](https://www.baeldung.com/java-local-variables-thread-safe) - [[<-- Prev]](/core-java-modules/core-java-concurrency-basic) diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/localvariables/LocalAndLambda.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/localvariables/LocalAndLambda.java new file mode 100644 index 0000000000..d8e0815797 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/localvariables/LocalAndLambda.java @@ -0,0 +1,10 @@ +package com.baeldung.concurrent.localvariables; + +public class LocalAndLambda { + public static void main(String... args) { + String text = ""; + // Un-commenting the next line will break compilation, because text is no longer effectively final + // text = "675"; + new Thread(() -> System.out.println(text)).start(); + } +} diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/localvariables/LocalVariables.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/localvariables/LocalVariables.java new file mode 100644 index 0000000000..39cae8da81 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/localvariables/LocalVariables.java @@ -0,0 +1,20 @@ +package com.baeldung.concurrent.localvariables; + +import java.security.SecureRandom; + +public class LocalVariables implements Runnable { + private int field; + + public static void main(String... args) { + LocalVariables target = new LocalVariables(); + new Thread(target).start(); + new Thread(target).start(); + } + + @Override + public void run() { + field = new SecureRandom().nextInt(); + int local = new SecureRandom().nextInt(); + System.out.println(field + " - " + local); + } +} diff --git a/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java index 553b8c9906..427531a446 100644 --- a/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java +++ b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java @@ -34,4 +34,20 @@ public class BaeldungSychronizedBlockUnitTest { assertEquals(1000, BaeldungSynchronizedBlocks.getStaticCount()); } + @Test + public void givenHoldingTheLock_whenReentrant_thenCanAcquireItAgain() { + Object lock = new Object(); + synchronized (lock) { + System.out.println("First time acquiring it"); + + synchronized (lock) { + System.out.println("Entering again"); + + synchronized (lock) { + System.out.println("And again"); + } + } + } + } + } diff --git a/core-java-modules/core-java-concurrency-collections-2/README.md b/core-java-modules/core-java-concurrency-collections-2/README.md index 91da6c623c..6ad6529efc 100644 --- a/core-java-modules/core-java-concurrency-collections-2/README.md +++ b/core-java-modules/core-java-concurrency-collections-2/README.md @@ -1,3 +1,5 @@ ### Relevant Articles: - [Introduction to Lock Striping](https://www.baeldung.com/java-lock-stripping) +- [Guide to the Java TransferQueue](http://www.baeldung.com/java-transfer-queue) +- [[<-- Prev]](/core-java-modules/core-java-concurrency-collections) diff --git a/core-java-modules/core-java-concurrency-collections-2/pom.xml b/core-java-modules/core-java-concurrency-collections-2/pom.xml index 7fdd348dc5..f9ee41f6d5 100644 --- a/core-java-modules/core-java-concurrency-collections-2/pom.xml +++ b/core-java-modules/core-java-concurrency-collections-2/pom.xml @@ -3,9 +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 - com.baeldung.concurrent.lock core-java-concurrency-collections-2 - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT + core-java-concurrency-collections-2 + jar + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + ../ + @@ -30,19 +37,6 @@ test - - src - - - maven-compiler-plugin - 3.8.0 - - 1.8 - 1.8 - - - - 1.21 diff --git a/core-java-modules/core-java-concurrency-collections/src/main/java/com/baeldung/transferqueue/Consumer.java b/core-java-modules/core-java-concurrency-collections-2/src/main/java/com/baeldung/transferqueue/Consumer.java similarity index 100% rename from core-java-modules/core-java-concurrency-collections/src/main/java/com/baeldung/transferqueue/Consumer.java rename to core-java-modules/core-java-concurrency-collections-2/src/main/java/com/baeldung/transferqueue/Consumer.java diff --git a/core-java-modules/core-java-concurrency-collections/src/main/java/com/baeldung/transferqueue/Producer.java b/core-java-modules/core-java-concurrency-collections-2/src/main/java/com/baeldung/transferqueue/Producer.java similarity index 100% rename from core-java-modules/core-java-concurrency-collections/src/main/java/com/baeldung/transferqueue/Producer.java rename to core-java-modules/core-java-concurrency-collections-2/src/main/java/com/baeldung/transferqueue/Producer.java diff --git a/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/TestConcurrentLinkedQueue.java b/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/ConcurrentLinkedQueueUnitTest.java similarity index 98% rename from core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/TestConcurrentLinkedQueue.java rename to core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/ConcurrentLinkedQueueUnitTest.java index c61becc366..8821887a9e 100644 --- a/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/TestConcurrentLinkedQueue.java +++ b/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/ConcurrentLinkedQueueUnitTest.java @@ -19,7 +19,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; @FixMethodOrder -public class TestConcurrentLinkedQueue { +public class ConcurrentLinkedQueueUnitTest { @Test public void givenThereIsExistingCollection_WhenAddedIntoQueue_ThenShouldContainElements() { diff --git a/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/TestLinkedBlockingQueue.java b/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/LinkedBlockingQueueUnitTest.java similarity index 98% rename from core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/TestLinkedBlockingQueue.java rename to core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/LinkedBlockingQueueUnitTest.java index 7a78bc7b3b..c1460c5196 100644 --- a/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/TestLinkedBlockingQueue.java +++ b/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/concurrent/queue/LinkedBlockingQueueUnitTest.java @@ -18,7 +18,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; @FixMethodOrder -public class TestLinkedBlockingQueue { +public class LinkedBlockingQueueUnitTest { @Test public void givenThereIsExistingCollection_WhenAddedIntoQueue_ThenShouldContainElements() { diff --git a/core-java-modules/core-java-concurrency-collections/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java b/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java similarity index 92% rename from core-java-modules/core-java-concurrency-collections/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java rename to core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java index e49738e983..928597f81e 100644 --- a/core-java-modules/core-java-concurrency-collections/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java +++ b/core-java-modules/core-java-concurrency-collections-2/src/test/java/com/baeldung/transferqueue/TransferQueueIntegrationTest.java @@ -4,7 +4,11 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -import java.util.concurrent.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedTransferQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TransferQueue; import static junit.framework.TestCase.assertEquals; diff --git a/core-java-modules/core-java-concurrency-collections/README.md b/core-java-modules/core-java-concurrency-collections/README.md index af6e7a8b59..94f93d1bfd 100644 --- a/core-java-modules/core-java-concurrency-collections/README.md +++ b/core-java-modules/core-java-concurrency-collections/README.md @@ -10,7 +10,7 @@ This module contains articles about concurrent Java collections - [Custom Thread Pools In Java 8 Parallel Streams](http://www.baeldung.com/java-8-parallel-streams-custom-threadpool) - [Guide to DelayQueue](http://www.baeldung.com/java-delay-queue) - [A Guide to Java SynchronousQueue](http://www.baeldung.com/java-synchronous-queue) -- [Guide to the Java TransferQueue](http://www.baeldung.com/java-transfer-queue) - [Guide to the ConcurrentSkipListMap](http://www.baeldung.com/java-concurrent-skip-list-map) - [Guide to CopyOnWriteArrayList](http://www.baeldung.com/java-copy-on-write-arraylist) - [LinkedBlockingQueue vs ConcurrentLinkedQueue](https://www.baeldung.com/java-queue-linkedblocking-concurrentlinked) +- [[Next -->]](/core-java-modules/core-java-concurrency-collections-2) diff --git a/core-java-modules/core-java-date-operations-2/README.md b/core-java-modules/core-java-date-operations-2/README.md index 6dc1302d99..557e4c3517 100644 --- a/core-java-modules/core-java-date-operations-2/README.md +++ b/core-java-modules/core-java-date-operations-2/README.md @@ -2,6 +2,7 @@ This module contains articles about date operations in Java. ### Relevant Articles: + - [Get the Current Date Prior to Java 8](https://www.baeldung.com/java-get-the-current-date-legacy) - [Skipping Weekends While Adding Days to LocalDate in Java 8](https://www.baeldung.com/java-localdate-add-days-skip-weekends) - [Checking If Two Java Dates Are on the Same Day](https://www.baeldung.com/java-check-two-dates-on-same-day) @@ -9,4 +10,5 @@ This module contains articles about date operations in Java. - [How to Set the JVM Time Zone](https://www.baeldung.com/java-jvm-time-zone) - [How to determine day of week by passing specific date in Java?](https://www.baeldung.com/java-get-day-of-week) - [Finding Leap Years in Java](https://www.baeldung.com/java-leap-year) +- [Getting the Week Number From Any Date](https://www.baeldung.com/java-get-week-number) - [[<-- Prev]](/core-java-modules/core-java-date-operations-1) diff --git a/core-java-modules/core-java-exceptions-2/README.md b/core-java-modules/core-java-exceptions-2/README.md index 46ffd490be..e6441c2c12 100644 --- a/core-java-modules/core-java-exceptions-2/README.md +++ b/core-java-modules/core-java-exceptions-2/README.md @@ -12,3 +12,5 @@ This module contains articles about core java exceptions - [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) - [Java Global Exception Handler](https://www.baeldung.com/java-global-exception-handler) - [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause) +- [Java IOException “Too many open files”](https://www.baeldung.com/java-too-many-open-files) +- [When Does Java Throw the ExceptionInInitializerError?](https://www.baeldung.com/java-exceptionininitializererror) diff --git a/core-java-modules/core-java-exceptions-2/pom.xml b/core-java-modules/core-java-exceptions-2/pom.xml index a53bf37b77..4497874640 100644 --- a/core-java-modules/core-java-exceptions-2/pom.xml +++ b/core-java-modules/core-java-exceptions-2/pom.xml @@ -33,7 +33,6 @@ http://maven.apache.org - UTF-8 3.10 3.10.0 diff --git a/core-java-modules/core-java-exceptions-2/src/test/java/com/baeldung/exceptionininitializererror/ExceptionInInitializerErrorUnitTest.java b/core-java-modules/core-java-exceptions-2/src/test/java/com/baeldung/exceptionininitializererror/ExceptionInInitializerErrorUnitTest.java new file mode 100644 index 0000000000..352d5ab50e --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/src/test/java/com/baeldung/exceptionininitializererror/ExceptionInInitializerErrorUnitTest.java @@ -0,0 +1,55 @@ +package com.baeldung.exceptionininitializererror; + +import org.junit.Test; + +import java.lang.reflect.Constructor; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +public class ExceptionInInitializerErrorUnitTest { + + @Test + public void givenStaticVar_whenThrows_thenWrapsItInAnExceptionInInitializerError() { + assertThatThrownBy(StaticVar::new) + .isInstanceOf(ExceptionInInitializerError.class) + .hasCauseInstanceOf(RuntimeException.class); + } + + @Test + public void givenStaticBlock_whenThrows_thenWrapsItInAnExceptionInInitializerError() { + assertThatThrownBy(StaticBlock::new) + .isInstanceOf(ExceptionInInitializerError.class) + .hasCauseInstanceOf(ArithmeticException.class); + } + + private static class CheckedConvention { + + private static Constructor constructor; + + static { + try { + constructor = CheckedConvention.class.getDeclaredConstructor(); + } catch (NoSuchMethodException e) { + throw new ExceptionInInitializerError(e); + } + } + } + + private static class StaticVar { + + private static int state = initializeState(); + + private static int initializeState() { + throw new RuntimeException(); + } + } + + private static class StaticBlock { + + private static int state; + + static { + state = 42 / 0; + } + } +} diff --git a/core-java-modules/core-java-io-2/README.md b/core-java-modules/core-java-io-2/README.md index 84cabc5992..b078a66a7a 100644 --- a/core-java-modules/core-java-io-2/README.md +++ b/core-java-modules/core-java-io-2/README.md @@ -13,4 +13,4 @@ This module contains articles about core Java input and output (IO) - [How to Copy a File with Java](https://www.baeldung.com/java-copy-file) - [Create a Directory in Java](https://www.baeldung.com/java-create-directory) - [Java IO vs NIO](https://www.baeldung.com/java-io-vs-nio) -- [[<-- Prev]](/core-java-modules/core-java-io) +- [[<-- Prev]](/core-java-modules/core-java-io)[[More -->]](/core-java-modules/core-java-io-3) diff --git a/core-java-modules/core-java-io-2/pom.xml b/core-java-modules/core-java-io-2/pom.xml index bdc2ee37f5..c0aae2b1ce 100644 --- a/core-java-modules/core-java-io-2/pom.xml +++ b/core-java-modules/core-java-io-2/pom.xml @@ -50,7 +50,7 @@ com.github.tomakehurst wiremock - 2.26.3 + ${wiremock.version} test @@ -80,6 +80,7 @@ 3.6.1 3.0.0-M1 + 2.26.3 \ No newline at end of file diff --git a/core-java-modules/core-java-io-3/README.md b/core-java-modules/core-java-io-3/README.md new file mode 100644 index 0000000000..61a040c1ce --- /dev/null +++ b/core-java-modules/core-java-io-3/README.md @@ -0,0 +1,9 @@ +## Core Java IO + +This module contains articles about core Java input and output (IO) + +### Relevant Articles: + +- [Java – Create a File](https://www.baeldung.com/java-how-to-create-a-file) +- [Check If a Directory Is Empty in Java](https://www.baeldung.com/java-check-empty-directory) +- [[<-- Prev]](/core-java-modules/core-java-io-2) diff --git a/core-java-modules/core-java-io-3/pom.xml b/core-java-modules/core-java-io-3/pom.xml new file mode 100644 index 0000000000..cc4dca5fa5 --- /dev/null +++ b/core-java-modules/core-java-io-3/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + core-java-io-3 + 0.1.0-SNAPSHOT + core-java-io-3 + jar + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + ../ + + + + + + com.google.guava + guava + ${guava.version} + + + + commons-io + commons-io + ${commons-io.version} + + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + + + + + 3.6.1 + + + \ No newline at end of file diff --git a/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java b/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java new file mode 100644 index 0000000000..f3cdb22f4d --- /dev/null +++ b/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java @@ -0,0 +1,50 @@ +package com.baeldung.createfile; + +import org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class CreateFileUnitTest { + + private final String FILE_NAME = "src/test/resources/fileToCreate.txt"; + + @AfterEach + @BeforeEach + public void cleanUpFiles() { + File targetFile = new File(FILE_NAME); + targetFile.delete(); + } + + @Test + public void givenUsingNio_whenCreatingFile_thenCorrect() throws IOException { + Path newFilePath = Paths.get(FILE_NAME); + Files.createFile(newFilePath); + } + + @Test + public void givenUsingFile_whenCreatingFile_thenCorrect() throws IOException { + File newFile = new File(FILE_NAME); + boolean success = newFile.createNewFile(); + assertTrue(success); + } + + @Test + public void givenUsingGuava_whenCreatingFile_thenCorrect() throws IOException { + com.google.common.io.Files.touch(new File(FILE_NAME)); + } + + @Test + public void givenUsingCommonsIo_whenCreatingFile_thenCorrect() throws IOException { + FileUtils.touch(new File(FILE_NAME)); + } + +} diff --git a/core-java-modules/core-java-io-3/src/test/java/com/baeldung/emptiness/DirectoryEmptinessUnitTest.java b/core-java-modules/core-java-io-3/src/test/java/com/baeldung/emptiness/DirectoryEmptinessUnitTest.java new file mode 100644 index 0000000000..a44aea1383 --- /dev/null +++ b/core-java-modules/core-java-io-3/src/test/java/com/baeldung/emptiness/DirectoryEmptinessUnitTest.java @@ -0,0 +1,63 @@ +package com.baeldung.emptiness; + +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Stream; + +import static org.assertj.core.api.Assertions.assertThat; + +public class DirectoryEmptinessUnitTest { + + @Test + public void givenPath_whenInvalid_thenReturnsFalse() throws IOException { + assertThat(isEmpty(Paths.get("invalid-addr"))).isFalse(); + } + + @Test + public void givenPath_whenNotDirectory_thenReturnsFalse() throws IOException { + Path aFile = Paths.get(getClass().getResource("/notDir.txt").getPath()); + assertThat(isEmpty(aFile)).isFalse(); + } + + @Test + public void givenPath_whenNotEmptyDir_thenReturnsFalse() throws IOException { + Path currentDir = new File("").toPath().toAbsolutePath(); + assertThat(isEmpty(currentDir)).isFalse(); + } + + @Test + public void givenPath_whenIsEmpty_thenReturnsTrue() throws Exception { + Path path = Files.createTempDirectory("baeldung-empty"); + assertThat(isEmpty(path)).isTrue(); + } + + private static boolean isEmpty(Path path) throws IOException { + if (Files.isDirectory(path)) { + try (DirectoryStream directory = Files.newDirectoryStream(path)) { + return !directory.iterator().hasNext(); + } + } + + return false; + } + + private static boolean isEmpty2(Path path) throws IOException { + if (Files.isDirectory(path)) { + try (Stream entries = Files.list(path)) { + return !entries.findFirst().isPresent(); + } + } + + return false; + } + + private static boolean isEmptyInefficient(Path path) { + return path.toFile().listFiles().length == 0; + } +} diff --git a/core-java-modules/core-java-io-3/src/test/resources/dummy.txt b/core-java-modules/core-java-io-3/src/test/resources/dummy.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core-java-modules/core-java-io-3/src/test/resources/notDir.txt b/core-java-modules/core-java-io-3/src/test/resources/notDir.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core-java-modules/core-java-io-apis/README.md b/core-java-modules/core-java-io-apis/README.md index 4d2bb0afb1..9399443ebd 100644 --- a/core-java-modules/core-java-io-apis/README.md +++ b/core-java-modules/core-java-io-apis/README.md @@ -7,7 +7,6 @@ This module contains articles about core Java input/output(IO) APIs. - [A Guide to the Java FileReader Class](https://www.baeldung.com/java-filereader) - [The Java File Class](https://www.baeldung.com/java-io-file) - [Java FileWriter](https://www.baeldung.com/java-filewriter) -- [Differences Between the Java WatchService API and the Apache Commons IO Monitor Library](https://www.baeldung.com/java-watchservice-vs-apache-commons-io-monitor-library) - [Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java](https://www.baeldung.com/java-path) - [Quick Use of FilenameFilter](https://www.baeldung.com/java-filename-filter) - [Guide to BufferedReader](https://www.baeldung.com/java-buffered-reader) diff --git a/core-java-modules/core-java-io-conversions-2/README.md b/core-java-modules/core-java-io-conversions-2/README.md index 9ce36e7437..b2153b3669 100644 --- a/core-java-modules/core-java-io-conversions-2/README.md +++ b/core-java-modules/core-java-io-conversions-2/README.md @@ -6,4 +6,6 @@ This module contains articles about core Java input/output(IO) conversions. - [Java InputStream to String](https://www.baeldung.com/convert-input-stream-to-string) - [Java – Write an InputStream to a File](https://www.baeldung.com/convert-input-stream-to-a-file) - [Converting a BufferedReader to a JSONObject](https://www.baeldung.com/java-bufferedreader-to-jsonobject) +- [Reading a CSV File into an Array](https://www.baeldung.com/java-csv-file-array) +- [How to Write to a CSV File in Java](https://www.baeldung.com/java-csv) - More articles: [[<-- prev]](/core-java-modules/core-java-io-conversions) diff --git a/core-java-modules/core-java-io-conversions-2/pom.xml b/core-java-modules/core-java-io-conversions-2/pom.xml index 46bce7988b..b8b5074c7c 100644 --- a/core-java-modules/core-java-io-conversions-2/pom.xml +++ b/core-java-modules/core-java-io-conversions-2/pom.xml @@ -24,7 +24,13 @@ org.json json - 20200518 + ${json.version} + + + com.opencsv + opencsv + ${opencsv.version} + test @@ -38,4 +44,9 @@ + + 20200518 + 4.1 + + \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/csv/WriteCsvFileExample.java b/core-java-modules/core-java-io-conversions-2/src/main/java/com/baeldung/csv/WriteCsvFileExample.java similarity index 100% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/csv/WriteCsvFileExample.java rename to core-java-modules/core-java-io-conversions-2/src/main/java/com/baeldung/csv/WriteCsvFileExample.java diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java b/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java similarity index 92% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java rename to core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java index 2593eee82b..7e4c1a127f 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java +++ b/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java @@ -1,20 +1,11 @@ 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 com.opencsv.CSVReader; import org.junit.Assert; import org.junit.Test; -import com.opencsv.CSVReader; +import java.io.*; +import java.util.*; public class ReadCSVInArrayUnitTest { public static final String COMMA_DELIMITER = ","; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/csv/WriteCsvFileExampleUnitTest.java b/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/csv/WriteCsvFileExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/csv/WriteCsvFileExampleUnitTest.java rename to core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/csv/WriteCsvFileExampleUnitTest.java index 5f4827bc21..fa76472685 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/csv/WriteCsvFileExampleUnitTest.java +++ b/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/csv/WriteCsvFileExampleUnitTest.java @@ -1,7 +1,9 @@ package com.baeldung.csv; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileNotFoundException; @@ -10,10 +12,8 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class WriteCsvFileExampleUnitTest { private static final Logger LOG = LoggerFactory.getLogger(WriteCsvFileExampleUnitTest.class); diff --git a/core-java-modules/core-java-io/src/test/resources/book.csv b/core-java-modules/core-java-io-conversions-2/src/test/resources/book.csv similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/book.csv rename to core-java-modules/core-java-io-conversions-2/src/test/resources/book.csv diff --git a/core-java-modules/core-java-io/README.md b/core-java-modules/core-java-io/README.md index 2c6c3363cb..c8a189ac81 100644 --- a/core-java-modules/core-java-io/README.md +++ b/core-java-modules/core-java-io/README.md @@ -8,10 +8,9 @@ This module contains articles about core Java input and output (IO) - [Java – Directory Size](https://www.baeldung.com/java-folder-size) - [File Size in Java](https://www.baeldung.com/java-file-size) - [Zipping and Unzipping in Java](https://www.baeldung.com/java-compress-and-uncompress) -- [Reading a CSV File into an Array](https://www.baeldung.com/java-csv-file-array) - [How to Get the File Extension of a File in Java](https://www.baeldung.com/java-file-extension) - [Getting a File’s Mime Type in Java](https://www.baeldung.com/java-file-mime-type) -- [How to Write to a CSV File in Java](https://www.baeldung.com/java-csv) - [How to Avoid the Java FileNotFoundException When Loading Resources](https://www.baeldung.com/java-classpath-resource-cannot-be-opened) - [Create a Directory in Java](https://www.baeldung.com/java-create-directory) +- [Java – Rename or Move a File](https://www.baeldung.com/java-how-to-rename-or-move-a-file) - [[More -->]](/core-java-modules/core-java-io-2) diff --git a/core-java-modules/core-java-io/pom.xml b/core-java-modules/core-java-io/pom.xml index ccfb57e909..0968536e65 100644 --- a/core-java-modules/core-java-io/pom.xml +++ b/core-java-modules/core-java-io/pom.xml @@ -29,12 +29,6 @@ ${hsqldb.version} runtime - - com.opencsv - opencsv - ${opencsv.version} - test - org.apache.tika @@ -142,8 +136,6 @@ - - 4.1 3.6.1 diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/rename/RenameFileUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/rename/RenameFileUnitTest.java new file mode 100644 index 0000000000..f4c4e99dac --- /dev/null +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/rename/RenameFileUnitTest.java @@ -0,0 +1,64 @@ +package com.baeldung.rename; + +import org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.FileSystemException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class RenameFileUnitTest { + + private final String FILE_TO_MOVE = "src/test/resources/originalFileToMove.txt"; + private final String TARGET_FILE = "src/test/resources/targetFileToMove.txt"; + + @BeforeEach + public void createFileToMove() throws IOException { + File fileToMove = new File(FILE_TO_MOVE); + fileToMove.createNewFile(); + } + + @AfterEach + public void cleanUpFiles() { + File targetFile = new File(TARGET_FILE); + targetFile.delete(); + } + + @Test + public void givenUsingNio_whenMovingFile_thenCorrect() throws IOException { + Path fileToMovePath = Paths.get(FILE_TO_MOVE); + Path targetPath = Paths.get(TARGET_FILE); + Files.move(fileToMovePath, targetPath); + } + + @Test + public void givenUsingFileClass_whenMovingFile_thenCorrect() throws IOException { + File fileToMove = new File(FILE_TO_MOVE); + boolean isMoved = fileToMove.renameTo(new File(TARGET_FILE)); + if (!isMoved) { + throw new FileSystemException(TARGET_FILE); + } + } + + @Test + public void givenUsingGuava_whenMovingFile_thenCorrect() + throws IOException { + File fileToMove = new File(FILE_TO_MOVE); + File targetFile = new File(TARGET_FILE); + + com.google.common.io.Files.move(fileToMove, targetFile); + } + + @Test + public void givenUsingApache_whenMovingFile_thenCorrect() throws IOException { + FileUtils.moveFile( + FileUtils.getFile(FILE_TO_MOVE), + FileUtils.getFile(TARGET_FILE)); + } + +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java index 467da4f76a..7fd7641a61 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java @@ -72,7 +72,7 @@ public class JavaFolderSizeUnitTest { public void whenGetFolderSizeUsingGuava_thenCorrect() { final File folder = new File(path); - final Iterable files = com.google.common.io.Files.fileTreeTraverser().breadthFirstTraversal(folder); + final Iterable files = com.google.common.io.Files.fileTraverser().breadthFirst(folder); final long size = StreamSupport.stream(files.spliterator(), false).filter(File::isFile).mapToLong(File::length).sum(); assertEquals(EXPECTED_SIZE, size); diff --git a/core-java-modules/core-java-jvm-2/README.md b/core-java-modules/core-java-jvm-2/README.md new file mode 100644 index 0000000000..7206a9eef7 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/README.md @@ -0,0 +1,13 @@ +## Core Java JVM Cookbooks and Examples + +This module contains articles about working with the Java Virtual Machine (JVM). + +### Relevant Articles: + +- [Memory Layout of Objects in Java](https://www.baeldung.com/java-memory-layout) +- [Measuring Object Sizes in the JVM](https://www.baeldung.com/jvm-measuring-object-sizes) +- [Adding Shutdown Hooks for JVM Applications](https://www.baeldung.com/jvm-shutdown-hooks) +- [boolean and boolean[] Memory Layout in the JVM](https://www.baeldung.com/jvm-boolean-memory-layout) +- [Where Is the Array Length Stored in JVM?](https://www.baeldung.com/java-jvm-array-length) +- [Memory Address of Objects in Java](https://www.baeldung.com/java-object-memory-address) +- More articles: [[<-- prev]](/core-java-modules/core-java-jvm) diff --git a/core-java-modules/core-java-jvm-2/pom.xml b/core-java-modules/core-java-jvm-2/pom.xml new file mode 100644 index 0000000000..71dca18094 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + core-java-jvm-2 + 0.1.0-SNAPSHOT + core-java-jvm-2 + jar + + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + ../ + + + + + junit + junit + ${junit.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.openjdk.jol + jol-core + ${jol-core.version} + + + + + 3.6.1 + 0.10 + + + diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/arraylength/ArrayLengthUnitTest.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/arraylength/ArrayLengthUnitTest.java new file mode 100644 index 0000000000..1b85ea7ebe --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/arraylength/ArrayLengthUnitTest.java @@ -0,0 +1,13 @@ +package com.baeldung.arraylength; + +import org.junit.Test; +import org.openjdk.jol.info.ClassLayout; + +public class ArrayLengthUnitTest { + + @Test + public void printingTheArrayLength() { + int[] ints = new int[42]; + System.out.println(ClassLayout.parseInstance(ints).toPrintable()); + } +} diff --git a/core-java-modules/core-java-jvm/src/test/java/com/baeldung/boolsize/BooleanSizeUnitTest.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/boolsize/BooleanSizeUnitTest.java similarity index 100% rename from core-java-modules/core-java-jvm/src/test/java/com/baeldung/boolsize/BooleanSizeUnitTest.java rename to core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/boolsize/BooleanSizeUnitTest.java diff --git a/core-java-modules/core-java-jvm/src/test/java/com/baeldung/boolsize/BooleanWrapper.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/boolsize/BooleanWrapper.java similarity index 100% rename from core-java-modules/core-java-jvm/src/test/java/com/baeldung/boolsize/BooleanWrapper.java rename to core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/boolsize/BooleanWrapper.java diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/memaddress/MemoryAddressUnitTest.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/memaddress/MemoryAddressUnitTest.java new file mode 100644 index 0000000000..5d4ba0a129 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/memaddress/MemoryAddressUnitTest.java @@ -0,0 +1,24 @@ +package com.baeldung.memaddress; + +import org.junit.Test; +import org.openjdk.jol.vm.VM; + +public class MemoryAddressUnitTest { + + @Test + public void printTheMemoryAddress() { + String answer = "42"; + + System.out.println("The memory address is " + VM.current().addressOf(answer)); + } + + @Test + public void identityHashCodeAndMemoryAddress() { + Object obj = new Object(); + + System.out.println("Memory address: " + VM.current().addressOf(obj)); + System.out.println("hashCode: " + obj.hashCode()); + System.out.println("hashCode: " + System.identityHashCode(obj)); + System.out.println("toString: " + obj); + } +} diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/memlayout/MemoryLayoutUnitTest.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/memlayout/MemoryLayoutUnitTest.java new file mode 100644 index 0000000000..2f226d7657 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/memlayout/MemoryLayoutUnitTest.java @@ -0,0 +1,108 @@ +package com.baeldung.memlayout; + +import org.junit.Test; +import org.openjdk.jol.info.ClassLayout; +import org.openjdk.jol.vm.VM; +import sun.misc.Contended; + +public class MemoryLayoutUnitTest { + + private volatile Object consumer; + + @Test + public void printingTheVMDetails() { + System.out.println(VM.current().details()); + } + + @Test + public void simpleMemoryLayout() { + System.out.println(ClassLayout.parseClass(SimpleInt.class).toPrintable()); + } + + @Test + public void identityHashCodeMemoryLayout() { + SimpleInt instance = new SimpleInt(); + System.out.println(ClassLayout.parseInstance(instance).toPrintable()); + + System.out.println("The identity hash code is " + System.identityHashCode(instance)); + System.out.println(ClassLayout.parseInstance(instance).toPrintable()); + } + + @Test + public void alignmentMemoryLayout() { + System.out.println(ClassLayout.parseClass(SimpleLong.class).toPrintable()); + } + + @Test + public void fieldPackingMemoryLayout() { + System.out.println(ClassLayout.parseClass(FieldsArrangement.class).toPrintable()); + } + + @Test + public void monitorLockMemoryLayout() { + Lock lock = new Lock(); + System.out.println(ClassLayout.parseInstance(lock).toPrintable()); + + synchronized (lock) { + System.out.println(ClassLayout.parseInstance(lock).toPrintable()); + } + } + + @Test + public void ageAndTenuringMemoryLayout() { + Object instance = new Object(); + long lastAddr = VM.current().addressOf(instance); + ClassLayout layout = ClassLayout.parseInstance(instance); + + for (int i = 0; i < 10_000; i++) { + long currentAddr = VM.current().addressOf(instance); + if (currentAddr != lastAddr) { + System.out.println(layout.toPrintable()); + } + + for (int j = 0; j < 10_000; j++) { + consumer = new Object(); + } + + lastAddr = currentAddr; + } + } + + @Test + public void contendedMemoryLayout() { + System.out.println(ClassLayout.parseClass(Isolated.class).toPrintable()); + } + + @Test + public void arrayMemoryLayout() { + boolean[] booleans = new boolean[3]; + System.out.println(ClassLayout.parseInstance(booleans).toPrintable()); + } + + private static class SimpleInt { + private int state; + } + + private static class SimpleLong { + private long state; + } + + private static class FieldsArrangement { + private boolean first; + private char second; + private double third; + private int fourth; + private boolean fifth; + } + + private static class Lock {} + + private static class Isolated { + + @Contended + private int i; + + @Contended + private long l; + } +} diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/Course.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/Course.java new file mode 100644 index 0000000000..cbe2eed47f --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/Course.java @@ -0,0 +1,10 @@ +package com.baeldung.objectsize; + +public class Course { + + private String name; + + public Course(String name) { + this.name = name; + } +} diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/InstrumentedSize.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/InstrumentedSize.java new file mode 100644 index 0000000000..54177caf30 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/InstrumentedSize.java @@ -0,0 +1,11 @@ +package com.baeldung.objectsize; + +public class InstrumentedSize { + + public static void main(String[] args) { + String ds = "Data Structures"; + Course course = new Course(ds); + + System.out.println(ObjectSizeCalculator.sizeOf(course)); + } +} diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/MANIFEST.MF b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/MANIFEST.MF new file mode 100644 index 0000000000..5366581b2f --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/MANIFEST.MF @@ -0,0 +1 @@ +Premain-Class: com.baeldung.objectsize.ObjectSizeCalculator diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/ObjectSizeCalculator.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/ObjectSizeCalculator.java new file mode 100644 index 0000000000..9c1e4c96a0 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/ObjectSizeCalculator.java @@ -0,0 +1,16 @@ +package com.baeldung.objectsize; + +import java.lang.instrument.Instrumentation; + +public class ObjectSizeCalculator { + + private static Instrumentation instrumentation; + + public static void premain(String args, Instrumentation inst) { + instrumentation = inst; + } + + public static long sizeOf(Object o) { + return instrumentation.getObjectSize(o); + } +} diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/ObjectSizeUnitTest.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/ObjectSizeUnitTest.java new file mode 100644 index 0000000000..f2ba748d84 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/ObjectSizeUnitTest.java @@ -0,0 +1,40 @@ +package com.baeldung.objectsize; + +import org.junit.Test; +import org.openjdk.jol.info.ClassLayout; +import org.openjdk.jol.info.GraphLayout; +import org.openjdk.jol.vm.VM; + +public class ObjectSizeUnitTest { + + @Test + public void printingTheVMDetails() { + System.out.println(VM.current().details()); + } + + @Test + public void printingTheProfClassLayout() { + System.out.println(ClassLayout.parseClass(Professor.class).toPrintable()); + } + + @Test + public void printingTheCourseClassLayout() { + System.out.println(ClassLayout.parseClass(Course.class).toPrintable()); + } + + @Test + public void printingACourseInstanceLayout() { + String ds = "Data Structures"; + Course course = new Course(ds); + + System.out.println("The shallow size is :" + VM.current().sizeOf(course)); + + System.out.println(ClassLayout.parseInstance(course).toPrintable()); + System.out.println(ClassLayout.parseInstance(ds).toPrintable()); + System.out.println(ClassLayout.parseInstance(ds.toCharArray()).toPrintable()); + + System.out.println(GraphLayout.parseInstance(course).totalSize()); + System.out.println(GraphLayout.parseInstance(course).toFootprint()); + System.out.println(GraphLayout.parseInstance(course).toPrintable()); + } +} diff --git a/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/Professor.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/Professor.java new file mode 100644 index 0000000000..6cd421f273 --- /dev/null +++ b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/objectsize/Professor.java @@ -0,0 +1,24 @@ +package com.baeldung.objectsize; + +import java.time.LocalDate; +import java.util.List; + +public class Professor { + + private String name; + private boolean tenured; + private List courses; + private int level; + private LocalDate birthDay; + private double lastEvaluation; + + public Professor(String name, boolean tenured, List courses, + int level, LocalDate birthDay, double lastEvaluation) { + this.name = name; + this.tenured = tenured; + this.courses = courses; + this.level = level; + this.birthDay = birthDay; + this.lastEvaluation = lastEvaluation; + } +} diff --git a/core-java-modules/core-java-jvm/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java b/core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java similarity index 100% rename from core-java-modules/core-java-jvm/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java rename to core-java-modules/core-java-jvm-2/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java diff --git a/core-java-modules/core-java-jvm/README.md b/core-java-modules/core-java-jvm/README.md index 0dae790ec0..431cf021c8 100644 --- a/core-java-modules/core-java-jvm/README.md +++ b/core-java-modules/core-java-jvm/README.md @@ -11,5 +11,7 @@ This module contains articles about working with the Java Virtual Machine (JVM). - [A Guide to System.exit()](https://www.baeldung.com/java-system-exit) - [Guide to System.gc()](https://www.baeldung.com/java-system-gc) - [Runtime.getRuntime().halt() vs System.exit() in Java](https://www.baeldung.com/java-runtime-halt-vs-system-exit) -- [Adding Shutdown Hooks for JVM Applications](https://www.baeldung.com/jvm-shutdown-hooks) - [How to Get the Size of an Object in Java](http://www.baeldung.com/java-size-of-object) +- [What Causes java.lang.OutOfMemoryError: unable to create new native thread](https://www.baeldung.com/java-outofmemoryerror-unable-to-create-new-native-thread) +- [View Bytecode of a Class File in Java](https://www.baeldung.com/java-class-view-bytecode) +- More articles: [[next -->]](/core-java-modules/core-java-jvm-2) diff --git a/core-java-modules/core-java-lang-2/README.md b/core-java-modules/core-java-lang-2/README.md index 3ade982397..c043d29811 100644 --- a/core-java-modules/core-java-lang-2/README.md +++ b/core-java-modules/core-java-lang-2/README.md @@ -11,4 +11,6 @@ This module contains articles about core features in the Java language - [Guide to the Java finally Keyword](https://www.baeldung.com/java-finally-keyword) - [The Java Headless Mode](https://www.baeldung.com/java-headless-mode) - [Comparing Long Values in Java](https://www.baeldung.com/java-compare-long-values) -- [[<-- Prev]](/core-java-modules/core-java-lang) +- [Comparing Objects in Java](https://www.baeldung.com/java-comparing-objects) +- [Casting int to Enum in Java](https://www.baeldung.com/java-cast-int-to-enum) +[[ <-- Prev]](/core-java-modules/core-java-lang)[[Next --> ]](/core-java-modules/core-java-lang-3) diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEquals.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEquals.java index e3a61fc05a..1358393538 100644 --- a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEquals.java +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEquals.java @@ -22,15 +22,15 @@ public class PersonWithEquals { this.birthDate = birthDate; } - public String firstName() { + public String getFirstName() { return firstName; } - public String lastName() { + public String getLastName() { return lastName; } - public LocalDate birthDate() { + public LocalDate getBirthDate() { return birthDate; } diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEqualsAndComparable.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEqualsAndComparable.java index 5611ce8a09..b358271cae 100644 --- a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEqualsAndComparable.java +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/comparing/PersonWithEqualsAndComparable.java @@ -22,6 +22,18 @@ public class PersonWithEqualsAndComparable implements Comparable timeToDeliveryToEnumValuesMapping = new HashMap<>(); static { - PizzaStatus[] pizzaStatuses = PizzaStatus.values(); - for (int pizzaStatusIndex = 0; pizzaStatusIndex < pizzaStatuses.length; pizzaStatusIndex++) { + for (PizzaStatus pizzaStatus : PizzaStatus.values()) { timeToDeliveryToEnumValuesMapping.put( - pizzaStatuses[pizzaStatusIndex].getTimeToDelivery(), - pizzaStatuses[pizzaStatusIndex] + pizzaStatus.getTimeToDelivery(), + pizzaStatus ); } } diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/ComparatorInterfaceUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/ComparatorInterfaceUnitTest.java index 769ae60bed..e2f66a5ebd 100644 --- a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/ComparatorInterfaceUnitTest.java +++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/ComparatorInterfaceUnitTest.java @@ -20,7 +20,7 @@ class ComparatorInterfaceUnitTest { Comparator compareByFirstNames = new Comparator() { @Override public int compare(PersonWithEquals o1, PersonWithEquals o2) { - return o1.firstName().compareTo(o2.firstName()); + return o1.getFirstName().compareTo(o2.getFirstName()); } }; people.sort(compareByFirstNames); @@ -37,7 +37,7 @@ class ComparatorInterfaceUnitTest { people.add(joe); people.add(allan); - Comparator compareByFirstNames = Comparator.comparing(PersonWithEquals::firstName); + Comparator compareByFirstNames = Comparator.comparing(PersonWithEquals::getFirstName); people.sort(compareByFirstNames); assertThat(people).containsExactly(allan, joe); diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/GuavaUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/GuavaUnitTest.java index 5c8591e134..129efd54ea 100644 --- a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/GuavaUnitTest.java +++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/comparing/GuavaUnitTest.java @@ -63,8 +63,8 @@ class GuavaUnitTest { PersonWithEquals joe = new PersonWithEquals("Joe", "Portman"); int comparisonResult = ComparisonChain.start() - .compare(natalie.lastName(), joe.lastName()) - .compare(natalie.firstName(), joe.firstName()) + .compare(natalie.getLastName(), joe.getLastName()) + .compare(natalie.getFirstName(), joe.getFirstName()) .result(); assertThat(comparisonResult).isPositive(); diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java index 876c230827..aed8ce0a2b 100644 --- a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java +++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java @@ -1,7 +1,12 @@ package com.baeldung.inttoenum; +import org.assertj.core.api.Assertions; import org.junit.Test; +import java.util.Arrays; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; public class IntToEnumUnitTest { @@ -9,19 +14,33 @@ public class IntToEnumUnitTest { @Test public void whenIntToEnumUsingValuesMethod_thenReturnEnumObject() { int timeToDeliveryForOrderedPizzaStatus = 5; - PizzaStatus[] pizzaStatuses = PizzaStatus.values(); + PizzaStatus pizzaOrderedStatus = null; - for (int pizzaStatusIndex = 0; pizzaStatusIndex < pizzaStatuses.length; pizzaStatusIndex++) { - if (pizzaStatuses[pizzaStatusIndex].getTimeToDelivery() == timeToDeliveryForOrderedPizzaStatus) { - pizzaOrderedStatus = pizzaStatuses[pizzaStatusIndex]; + + for (PizzaStatus pizzaStatus : PizzaStatus.values()) { + if (pizzaStatus.getTimeToDelivery() == timeToDeliveryForOrderedPizzaStatus) { + pizzaOrderedStatus = pizzaStatus; } } - assertEquals(pizzaOrderedStatus, PizzaStatus.ORDERED); + + assertThat(pizzaOrderedStatus).isEqualTo(PizzaStatus.ORDERED); } @Test public void whenIntToEnumUsingMap_thenReturnEnumObject() { int timeToDeliveryForOrderedPizzaStatus = 5; - assertEquals(PizzaStatus.castIntToEnum(timeToDeliveryForOrderedPizzaStatus), PizzaStatus.ORDERED); + + assertThat(PizzaStatus.castIntToEnum(timeToDeliveryForOrderedPizzaStatus)).isEqualTo(PizzaStatus.ORDERED); + } + + @Test + public void whenIntToEnumUsingStream_thenReturnEnumObject() { + int timeToDeliveryForOrderedPizzaStatus = 5; + + Optional pizzaStatus = Arrays.stream(PizzaStatus.values()) + .filter(p -> p.getTimeToDelivery() == timeToDeliveryForOrderedPizzaStatus) + .findFirst(); + + assertThat(pizzaStatus).hasValue(PizzaStatus.ORDERED); } } \ No newline at end of file diff --git a/core-java-modules/core-java-lang-3/README.md b/core-java-modules/core-java-lang-3/README.md new file mode 100644 index 0000000000..9ce49da868 --- /dev/null +++ b/core-java-modules/core-java-lang-3/README.md @@ -0,0 +1,7 @@ +## Core Java Lang (Part 3) + +This module contains articles about core features in the Java language + +- [Class.isInstance vs Class.isAssignableFrom](https://www.baeldung.com/java-isinstance-isassignablefrom) +- [Converting a Java String Into a Boolean](https://www.baeldung.com/java-string-to-boolean) +- [[<-- Prev]](/core-java-modules/core-java-lang-2) diff --git a/core-java-modules/core-java-lang-3/pom.xml b/core-java-modules/core-java-lang-3/pom.xml new file mode 100644 index 0000000000..de290717b1 --- /dev/null +++ b/core-java-modules/core-java-lang-3/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + core-java-lang-3 + 0.1.0-SNAPSHOT + core-java-lang-3 + jar + + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + ../ + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-lang-3 + + + src/main/resources + true + + + + + + 3.12.2 + + + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/IsoscelesTriangle.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/IsoscelesTriangle.java new file mode 100644 index 0000000000..25392320fe --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/IsoscelesTriangle.java @@ -0,0 +1,5 @@ +package com.baeldung.isinstancevsisassignablefrom; + +public class IsoscelesTriangle extends Triangle { + +} diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/Shape.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/Shape.java new file mode 100644 index 0000000000..c83626a3b6 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/Shape.java @@ -0,0 +1,5 @@ +package com.baeldung.isinstancevsisassignablefrom; + +public interface Shape { + +} diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/Triangle.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/Triangle.java new file mode 100644 index 0000000000..c35dfd9eca --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/isinstancevsisassignablefrom/Triangle.java @@ -0,0 +1,5 @@ +package com.baeldung.isinstancevsisassignablefrom; + +public class Triangle implements Shape { + +} diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/staticvariables/StaticVariableDemo.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/staticvariables/StaticVariableDemo.java new file mode 100644 index 0000000000..917e9b0953 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/staticvariables/StaticVariableDemo.java @@ -0,0 +1,23 @@ +package com.baeldung.staticvariables; + +public class StaticVariableDemo { + public static int i; + public static int j = 20; + public static int z; + + static { + z = 30; + a = 40; + } + + public static int a = 50; + + public static final int b = 100; + + public StaticVariableDemo() { + } + + static class Nested { + public static String nestedClassStaticVariable = "test"; + } +} diff --git a/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/isinstancevsisassignablefrom/IsInstanceIsAssignableFromUnitTest.java b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/isinstancevsisassignablefrom/IsInstanceIsAssignableFromUnitTest.java new file mode 100644 index 0000000000..e0ad264797 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/isinstancevsisassignablefrom/IsInstanceIsAssignableFromUnitTest.java @@ -0,0 +1,67 @@ +package com.baeldung.isinstancevsisassignablefrom; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class IsInstanceIsAssignableFromUnitTest { + + @Test + public void whenUsingIsInstanceProperly_desiredResultsHappen() { + Shape shape = new Triangle(); + Triangle triangle = new Triangle(); + IsoscelesTriangle isoscelesTriangle = new IsoscelesTriangle(); + Triangle isoscelesTriangle2 = new IsoscelesTriangle(); + Shape nonspecificShape = null; + + assertTrue(Shape.class.isInstance(shape)); + assertTrue(Shape.class.isInstance(triangle)); + assertTrue(Shape.class.isInstance(isoscelesTriangle)); + assertTrue(Shape.class.isInstance(isoscelesTriangle2)); + assertFalse(Shape.class.isInstance(nonspecificShape)); + + assertTrue(Triangle.class.isInstance(shape)); + assertTrue(Triangle.class.isInstance(triangle)); + assertTrue(Triangle.class.isInstance(isoscelesTriangle)); + assertTrue(Triangle.class.isInstance(isoscelesTriangle2)); + + assertFalse(IsoscelesTriangle.class.isInstance(shape)); + assertFalse(IsoscelesTriangle.class.isInstance(triangle)); + assertTrue(IsoscelesTriangle.class.isInstance(isoscelesTriangle)); + assertTrue(IsoscelesTriangle.class.isInstance(isoscelesTriangle2)); + } + + @Test + public void whenUsingIsAssignableFromProperly_desiredResultsHappen() { + Shape shape = new Triangle(); + Triangle triangle = new Triangle(); + IsoscelesTriangle isoscelesTriangle = new IsoscelesTriangle(); + Triangle isoscelesTriangle2 = new IsoscelesTriangle(); + + assertFalse(shape.getClass().isAssignableFrom(Shape.class)); + assertTrue(shape.getClass().isAssignableFrom(shape.getClass())); + assertTrue(shape.getClass().isAssignableFrom(triangle.getClass())); + assertTrue(shape.getClass().isAssignableFrom(isoscelesTriangle.getClass())); + assertTrue(shape.getClass().isAssignableFrom(isoscelesTriangle2.getClass())); + + assertFalse(triangle.getClass().isAssignableFrom(Shape.class)); + assertTrue(triangle.getClass().isAssignableFrom(shape.getClass())); + assertTrue(triangle.getClass().isAssignableFrom(triangle.getClass())); + assertTrue(triangle.getClass().isAssignableFrom(isoscelesTriangle.getClass())); + assertTrue(triangle.getClass().isAssignableFrom(isoscelesTriangle2.getClass())); + + assertFalse(isoscelesTriangle.getClass().isAssignableFrom(Shape.class)); + assertFalse(isoscelesTriangle.getClass().isAssignableFrom(shape.getClass())); + assertFalse(isoscelesTriangle.getClass().isAssignableFrom(triangle.getClass())); + assertTrue(isoscelesTriangle.getClass().isAssignableFrom(isoscelesTriangle.getClass())); + assertTrue(isoscelesTriangle.getClass().isAssignableFrom(isoscelesTriangle2.getClass())); + + assertFalse(isoscelesTriangle2.getClass().isAssignableFrom(Shape.class)); + assertFalse(isoscelesTriangle2.getClass().isAssignableFrom(shape.getClass())); + assertFalse(isoscelesTriangle2.getClass().isAssignableFrom(triangle.getClass())); + assertTrue(isoscelesTriangle2.getClass().isAssignableFrom(isoscelesTriangle.getClass())); + assertTrue(isoscelesTriangle2.getClass().isAssignableFrom(isoscelesTriangle2.getClass())); + } + +} diff --git a/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/staticvariables/StaticVariableUnitTest.java b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/staticvariables/StaticVariableUnitTest.java new file mode 100644 index 0000000000..06711a888b --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/staticvariables/StaticVariableUnitTest.java @@ -0,0 +1,113 @@ +package com.baeldung.staticvariables; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Field; + +import org.junit.jupiter.api.Test; + +public class StaticVariableUnitTest { + + @Test + public void initializeStaticVariable_checkAssignedValues() { + + try { + Class staticVariableDemo = this.getClass() + .getClassLoader() + .loadClass("com.baeldung.staticvariables.StaticVariableDemo"); + + Field field1 = staticVariableDemo.getField("i"); + + assertThat(field1.getInt(staticVariableDemo)).isEqualTo(0); + + Field field2 = staticVariableDemo.getField("j"); + + assertThat(field2.getInt(staticVariableDemo)).isEqualTo(20); + + } catch (ClassNotFoundException | NoSuchFieldException | SecurityException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + } + + @Test + public void initializeStaticVariable_checkStaticBlock() { + + try { + Class staticVariableDemo = this.getClass() + .getClassLoader() + .loadClass("com.baeldung.staticvariables.StaticVariableDemo"); + + Field field1 = staticVariableDemo.getField("z"); + + assertThat(field1.getInt(staticVariableDemo)).isEqualTo(30); + + Field field2 = staticVariableDemo.getField("a"); + + assertThat(field2.getInt(staticVariableDemo)).isEqualTo(50); + + } catch (ClassNotFoundException | NoSuchFieldException | SecurityException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + } + + @Test + public void initializeStaticVariable_checkFinalValues() { + + try { + Class staticVariableDemo = this.getClass() + .getClassLoader() + .loadClass("com.baeldung.staticvariables.StaticVariableDemo"); + + Field field1 = staticVariableDemo.getField("b"); + + assertThat(field1.getInt(staticVariableDemo)).isEqualTo(100); + + } catch (ClassNotFoundException | NoSuchFieldException | SecurityException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + } + + @Test + public void initializeStaticVariable_checkInnerClassValues() { + + try { + Class staticVariableDemo = this.getClass() + .getClassLoader() + .loadClass("com.baeldung.staticvariables.StaticVariableDemo"); + + Class[] nestedClasses = staticVariableDemo.getClasses(); + + for (Class nestedClass : nestedClasses) { + if (nestedClass.getName() + .equals("Nested")) { + + Field field1 = nestedClass.getField("nestedClassStaticVariable"); + assertThat(field1.get(nestedClass)).isEqualTo("test"); + } + } + + } catch (ClassNotFoundException | NoSuchFieldException | SecurityException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + } +} diff --git a/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/stringtoboolean/StringToBooleanUnitTest.java b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/stringtoboolean/StringToBooleanUnitTest.java new file mode 100644 index 0000000000..8b10d78fe3 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/stringtoboolean/StringToBooleanUnitTest.java @@ -0,0 +1,30 @@ +package com.baeldung.stringtoboolean; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.Test; + +public class StringToBooleanUnitTest { + + @Test + public void givenStringTrue_whenUsingParseBoolean_thenTrue() { + assertThat(Boolean.parseBoolean("true")).isTrue(); + } + + @Test + public void givenStringTrue_whenUsingValueOf_thenTrue() { + assertThat(Boolean.valueOf("true")).isTrue(); + } + + @Test + public void givenStringTrue_whenUsingGetBoolean_thenFalse() { + assertThat(Boolean.getBoolean("true")).isFalse(); + } + + @Test + public void givenSystemProperty_whenUsingGetBoolean_thenTrue() { + System.setProperty("CODING_IS_FUN", "true"); + + assertThat(Boolean.getBoolean("CODING_IS_FUN")).isTrue(); + } +} diff --git a/core-java-modules/core-java-lang-oop-generics/README.md b/core-java-modules/core-java-lang-oop-generics/README.md index f0213c5659..74b9df7c65 100644 --- a/core-java-modules/core-java-lang-oop-generics/README.md +++ b/core-java-modules/core-java-lang-oop-generics/README.md @@ -6,3 +6,4 @@ This module contains articles about generics in Java - [Generic Constructors in Java](https://www.baeldung.com/java-generic-constructors) - [Type Erasure in Java Explained](https://www.baeldung.com/java-type-erasure) - [Raw Types in Java](https://www.baeldung.com/raw-types-java) +- [Super Type Tokens in Java Generics](https://www.baeldung.com/java-super-type-tokens) diff --git a/core-java-modules/core-java-lang-oop-methods/README.md b/core-java-modules/core-java-lang-oop-methods/README.md index fa474c9795..afceaded9a 100644 --- a/core-java-modules/core-java-lang-oop-methods/README.md +++ b/core-java-modules/core-java-lang-oop-methods/README.md @@ -3,7 +3,9 @@ This module contains articles about methods in Java ### Relevant Articles: + - [Methods in Java](https://www.baeldung.com/java-methods) - [Method Overloading and Overriding in Java](https://www.baeldung.com/java-method-overload-override) - [Java equals() and hashCode() Contracts](https://www.baeldung.com/java-equals-hashcode-contracts) - [Guide to hashCode() in Java](https://www.baeldung.com/java-hashcode) +- [The Covariant Return Type in Java](https://www.baeldung.com/java-covariant-return-type) diff --git a/core-java-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/covariance/IntegerProducer.java b/core-java-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/covariance/IntegerProducer.java new file mode 100644 index 0000000000..6a631d45b0 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/covariance/IntegerProducer.java @@ -0,0 +1,8 @@ +package com.baeldung.covariance; + +public class IntegerProducer extends Producer { + @Override + public Integer produce(String input) { + return Integer.parseInt(input); + } +} diff --git a/core-java-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/covariance/Producer.java b/core-java-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/covariance/Producer.java new file mode 100644 index 0000000000..94f79ae525 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-methods/src/main/java/com/baeldung/covariance/Producer.java @@ -0,0 +1,8 @@ +package com.baeldung.covariance; + +public class Producer { + public Object produce(String input) { + Object result = input.toLowerCase(); + return result; + } +} diff --git a/core-java-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/covariance/CovariantProducersUnitTest.java b/core-java-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/covariance/CovariantProducersUnitTest.java new file mode 100644 index 0000000000..2645889ac8 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-methods/src/test/java/com/baeldung/covariance/CovariantProducersUnitTest.java @@ -0,0 +1,49 @@ +package com.baeldung.covariance; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class CovariantProducersUnitTest { + + @Test + public void whenInputIsArbitrary_thenProducerProducesString() { + String arbitraryInput = "just a random text"; + Producer producer = new Producer(); + + Object objectOutput = producer.produce(arbitraryInput); + + assertEquals(arbitraryInput, objectOutput); + assertEquals(String.class, objectOutput.getClass()); + } + + @Test + public void whenInputIsArbitrary_thenIntegerProducerFails() { + String arbitraryInput = "just a random text"; + Producer producer = new IntegerProducer(); + + assertThrows(NumberFormatException.class, () -> producer.produce(arbitraryInput)); + } + + @Test + public void whenInputIsSupported_thenProducerCreatesInteger() { + String integerAsString = "42"; + Producer producer = new IntegerProducer(); + + Object result = producer.produce(integerAsString); + + assertEquals(Integer.class, result.getClass()); + assertEquals(Integer.parseInt(integerAsString), result); + } + + @Test + public void whenInputIsSupported_thenIntegerProducerCreatesIntegerWithoutCasting() { + String integerAsString = "42"; + IntegerProducer producer = new IntegerProducer(); + + Integer result = producer.produce(integerAsString); + + assertEquals(Integer.parseInt(integerAsString), result); + } +} diff --git a/core-java-modules/core-java-lang/README.md b/core-java-modules/core-java-lang/README.md index 9166b93b7f..963a1e623e 100644 --- a/core-java-modules/core-java-lang/README.md +++ b/core-java-modules/core-java-lang/README.md @@ -13,4 +13,5 @@ This module contains articles about core features in the Java language - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) - [The Java continue and break Keywords](https://www.baeldung.com/java-continue-and-break) - [Infinite Loops in Java](https://www.baeldung.com/infinite-loops-java) -- [[More --> ]](/core-java-modules/core-java-lang-2) + +[[Next --> ]](/core-java-modules/core-java-lang-2) diff --git a/core-java-modules/core-java-networking-2/README.md b/core-java-modules/core-java-networking-2/README.md index 662d97252e..dbda8bdc7c 100644 --- a/core-java-modules/core-java-networking-2/README.md +++ b/core-java-modules/core-java-networking-2/README.md @@ -12,4 +12,5 @@ This module contains articles about networking in Java - [Authentication with HttpUrlConnection](https://www.baeldung.com/java-http-url-connection) - [Download a File from an URL in Java](https://www.baeldung.com/java-download-file) - [Handling java.net.ConnectException](https://www.baeldung.com/java-net-connectexception) +- [Getting MAC addresses in Java](https://www.baeldung.com/java-mac-address) - [[<-- Prev]](/core-java-modules/core-java-networking) diff --git a/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/macaddress/GetAllMacAddressesDemo.java b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/macaddress/GetAllMacAddressesDemo.java new file mode 100644 index 0000000000..8f07d4133e --- /dev/null +++ b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/macaddress/GetAllMacAddressesDemo.java @@ -0,0 +1,23 @@ +package com.baeldung.macaddress; + +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.Enumeration; + +public class GetAllMacAddressesDemo { + + public static void main(String[] args) throws SocketException { + Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); + while (networkInterfaces.hasMoreElements()) { + NetworkInterface ni = networkInterfaces.nextElement(); + byte[] hardwareAddress = ni.getHardwareAddress(); + if (hardwareAddress != null) { + String[] hexadecimalFormat = new String[hardwareAddress.length]; + for (int i = 0; i < hardwareAddress.length; i++) { + hexadecimalFormat[i] = String.format("%02X", hardwareAddress[i]); + } + System.out.println(String.join("-", hexadecimalFormat)); + } + } + } +} diff --git a/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/macaddress/MacAddressUnitTest.java b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/macaddress/MacAddressUnitTest.java new file mode 100644 index 0000000000..293e92c690 --- /dev/null +++ b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/macaddress/MacAddressUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.macaddress; + +import org.junit.Test; + +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.net.UnknownHostException; + +import static org.junit.Assert.assertEquals; + +public class MacAddressUnitTest { + + @Test + public void givenNetworkInterface_whenUsingLocalHost_thenGetMacAddress() throws UnknownHostException, SocketException { + InetAddress localHost = InetAddress.getLocalHost(); + NetworkInterface ni = NetworkInterface.getByInetAddress(localHost); + byte[] macAddress = ni.getHardwareAddress(); + assertEquals(6, macAddress.length); + } +} diff --git a/core-java-modules/core-java-reflection-2/README.md b/core-java-modules/core-java-reflection-2/README.md new file mode 100644 index 0000000000..342fbd73bd --- /dev/null +++ b/core-java-modules/core-java-reflection-2/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Reading the Value of ‘private’ Fields from a Different Class in Java](https://www.baeldung.com/java-reflection-read-private-field-value) diff --git a/core-java-modules/core-java-reflection-2/pom.xml b/core-java-modules/core-java-reflection-2/pom.xml new file mode 100644 index 0000000000..ea76ee8c98 --- /dev/null +++ b/core-java-modules/core-java-reflection-2/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + core-java-reflection-2 + 0.1.0-SNAPSHOT + core-java-reflection-2 + jar + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + ../ + + + + core-java-reflection-2 + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${source.version} + ${target.version} + -parameters + + + + + + + 3.8.0 + 1.8 + 1.8 + + \ No newline at end of file diff --git a/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/access/privatefields/Person.java b/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/access/privatefields/Person.java new file mode 100755 index 0000000000..4e2f0fc0cc --- /dev/null +++ b/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/access/privatefields/Person.java @@ -0,0 +1,87 @@ +package com.baeldung.reflection.access.privatefields; + +public class Person { + + private String name = "John"; + private byte age = 30; + private short uidNumber = 5555; + private int pinCode = 452002; + private long contactNumber = 123456789L; + private float height = 6.1242f; + private double weight = 75.2564; + private char gender = 'M'; + private boolean active = true; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public byte getAge() { + return age; + } + + public void setAge(byte age) { + this.age = age; + } + + public short getUidNumber() { + return uidNumber; + } + + public void setUidNumber(short uidNumber) { + this.uidNumber = uidNumber; + } + + public int getPinCode() { + return pinCode; + } + + public void setPinCode(int pinCode) { + this.pinCode = pinCode; + } + + public long getContactNumber() { + return contactNumber; + } + + public void setContactNumber(long contactNumber) { + this.contactNumber = contactNumber; + } + + public float getHeight() { + return height; + } + + public void setHeight(float height) { + this.height = height; + } + + public double getWeight() { + return weight; + } + + public void setWeight(double weight) { + this.weight = weight; + } + + public char getGender() { + return gender; + } + + public void setGender(char gender) { + this.gender = gender; + } + + public boolean isActive() { + return active; + } + + public void setActive(boolean active) { + this.active = active; + } + +} diff --git a/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/access/privatefields/AccessPrivateFieldsUnitTest.java b/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/access/privatefields/AccessPrivateFieldsUnitTest.java new file mode 100644 index 0000000000..49e1b917b1 --- /dev/null +++ b/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/access/privatefields/AccessPrivateFieldsUnitTest.java @@ -0,0 +1,168 @@ +package com.baeldung.reflection.access.privatefields; + +import java.lang.reflect.Field; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class AccessPrivateFieldsUnitTest { + + @Test + public void whenGetIntegerFields_thenSuccess() throws Exception { + Person person = new Person(); + + Field ageField = person.getClass() + .getDeclaredField("age"); + ageField.setAccessible(true); + + byte age = ageField.getByte(person); + Assertions.assertEquals(30, age); + + Field uidNumberField = person.getClass() + .getDeclaredField("uidNumber"); + uidNumberField.setAccessible(true); + + short uidNumber = uidNumberField.getShort(person); + Assertions.assertEquals(5555, uidNumber); + + Field pinCodeField = person.getClass() + .getDeclaredField("pinCode"); + pinCodeField.setAccessible(true); + + int pinCode = pinCodeField.getInt(person); + Assertions.assertEquals(452002, pinCode); + + Field contactNumberField = person.getClass() + .getDeclaredField("contactNumber"); + contactNumberField.setAccessible(true); + + long contactNumber = contactNumberField.getLong(person); + Assertions.assertEquals(123456789L, contactNumber); + + } + + @Test + public void whenDoAutoboxing_thenSuccess() throws Exception { + Person person = new Person(); + + Field pinCodeField = person.getClass() + .getDeclaredField("pinCode"); + pinCodeField.setAccessible(true); + + Integer pinCode = pinCodeField.getInt(person); + Assertions.assertEquals(452002, pinCode); + } + + @Test + public void whenDoWidening_thenSuccess() throws Exception { + Person person = new Person(); + + Field pinCodeField = person.getClass() + .getDeclaredField("pinCode"); + pinCodeField.setAccessible(true); + + Long pinCode = pinCodeField.getLong(person); + Assertions.assertEquals(452002L, pinCode); + } + + @Test + public void whenGetFloatingTypeFields_thenSuccess() throws Exception { + Person person = new Person(); + + Field heightField = person.getClass() + .getDeclaredField("height"); + heightField.setAccessible(true); + + float height = heightField.getFloat(person); + Assertions.assertEquals(6.1242f, height); + + Field weightField = person.getClass() + .getDeclaredField("weight"); + weightField.setAccessible(true); + + double weight = weightField.getDouble(person); + Assertions.assertEquals(75.2564, weight); + } + + @Test + public void whenGetCharacterFields_thenSuccess() throws Exception { + Person person = new Person(); + + Field genderField = person.getClass() + .getDeclaredField("gender"); + genderField.setAccessible(true); + + char gender = genderField.getChar(person); + Assertions.assertEquals('M', gender); + } + + @Test + public void whenGetBooleanFields_thenSuccess() throws Exception { + Person person = new Person(); + + Field activeField = person.getClass() + .getDeclaredField("active"); + activeField.setAccessible(true); + + boolean active = activeField.getBoolean(person); + Assertions.assertTrue(active); + } + + @Test + public void whenGetObjectFields_thenSuccess() throws Exception { + Person person = new Person(); + + Field nameField = person.getClass() + .getDeclaredField("name"); + nameField.setAccessible(true); + + String name = (String) nameField.get(person); + Assertions.assertEquals("John", name); + } + + @Test + public void givenInt_whenGetStringField_thenIllegalArgumentException() throws Exception { + Person person = new Person(); + Field nameField = person.getClass() + .getDeclaredField("name"); + nameField.setAccessible(true); + + Assertions.assertThrows(IllegalArgumentException.class, () -> nameField.getInt(person)); + } + + @Test + public void givenInt_whenGetLongField_thenIllegalArgumentException() throws Exception { + Person person = new Person(); + Field contactNumberField = person.getClass() + .getDeclaredField("contactNumber"); + contactNumberField.setAccessible(true); + + Assertions.assertThrows(IllegalArgumentException.class, () -> contactNumberField.getInt(person)); + } + + @Test + public void whenFieldNotSetAccessible_thenIllegalAccessException() throws Exception { + Person person = new Person(); + Field nameField = person.getClass() + .getDeclaredField("name"); + + Assertions.assertThrows(IllegalAccessException.class, () -> nameField.get(person)); + } + + @Test + public void whenAccessingWrongProperty_thenNoSuchFieldException() throws Exception { + Person person = new Person(); + + Assertions.assertThrows(NoSuchFieldException.class, () -> person.getClass() + .getDeclaredField("firstName")); + } + + @Test + public void whenAccessingNullProperty_thenNullPointerException() throws Exception { + Person person = new Person(); + + Assertions.assertThrows(NullPointerException.class, () -> person.getClass() + .getDeclaredField(null)); + } + +} diff --git a/core-java-modules/core-java-reflection/README.MD b/core-java-modules/core-java-reflection/README.MD index d6b3a02e6a..5d8c54414b 100644 --- a/core-java-modules/core-java-reflection/README.MD +++ b/core-java-modules/core-java-reflection/README.MD @@ -8,5 +8,4 @@ - [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) - [What Causes java.lang.reflect.InvocationTargetException?](https://www.baeldung.com/java-lang-reflect-invocationtargetexception) -- [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) - [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) diff --git a/core-java-modules/core-java-regex/README.md b/core-java-modules/core-java-regex/README.md index 8830af2c2d..ad8ba1e4ae 100644 --- a/core-java-modules/core-java-regex/README.md +++ b/core-java-modules/core-java-regex/README.md @@ -3,6 +3,7 @@ ## Core Java 8 Cookbooks and Examples ### Relevant Articles: + - [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) - [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) - [Guide to Escaping Characters in Java RegExps](http://www.baeldung.com/java-regexp-escape-char) @@ -11,3 +12,4 @@ - [How to Use Regular Expressions to Replace Tokens in Strings](https://www.baeldung.com/java-regex-token-replacement) - [Regular Expressions \s and \s+ in Java](https://www.baeldung.com/java-regex-s-splus) - [Validate Phone Numbers With Java Regex](https://www.baeldung.com/java-regex-validate-phone-numbers) +- [How to Count the Number of Matches for a Regex?](https://www.baeldung.com/java-count-regex-matches) diff --git a/core-java-modules/core-java-regex/pom.xml b/core-java-modules/core-java-regex/pom.xml index 9e2d91d5d9..f26218877c 100644 --- a/core-java-modules/core-java-regex/pom.xml +++ b/core-java-modules/core-java-regex/pom.xml @@ -29,7 +29,7 @@ org.assertj assertj-core - 3.15.0 + ${assertj-core.version} test @@ -44,4 +44,8 @@ + + 3.15.0 + + diff --git a/core-java-modules/core-java-regex/src/test/java/com/baeldung/regex/countmatches/CountMatchesUnitTest.java b/core-java-modules/core-java-regex/src/test/java/com/baeldung/regex/countmatches/CountMatchesUnitTest.java new file mode 100644 index 0000000000..6427d11dd6 --- /dev/null +++ b/core-java-modules/core-java-regex/src/test/java/com/baeldung/regex/countmatches/CountMatchesUnitTest.java @@ -0,0 +1,110 @@ +package com.baeldung.regex.countmatches; + +import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.junit.Test; + +/** + * Unit Test intended to count number of matches of a RegEx using Java 8 and 9. + * + * Java 9 is needed to run the commented out tests. + */ +public class CountMatchesUnitTest { + + private static final Pattern EMAIL_ADDRESS_PATTERN = Pattern.compile("([a-z0-9_.-]+)@([a-z0-9_.-]+[a-z])"); + private static final String TEXT_CONTAINING_EMAIL_ADDRESSES = "You can contact me through: writer@baeldung.com, editor@baeldung.com and team@bealdung.com"; + private static final String TEXT_CONTAINING_FIVE_EMAIL_ADDRESSES = "Valid emails are: me@gmail.com, you@baeldung.com, contact@hotmail.com, press@anysite.com and support@bealdung.com"; + private static final String TEXT_CONTAINING_OVERLAP_EMAIL_ADDRESSES = "Try to contact us at team@baeldung.comeditor@baeldung.com, support@baeldung.com."; + + @Test + public void givenContainingEmailString_whenJava8Match_thenCountMacthesFound() { + Matcher countEmailMatcher = EMAIL_ADDRESS_PATTERN.matcher(TEXT_CONTAINING_EMAIL_ADDRESSES); + + int count = 0; + while (countEmailMatcher.find()) { + count++; + } + + assertEquals(3, count); + } + + @Test + public void givenContainingFiveEmailsString_whenJava8Match_thenCountMacthesFound() { + Matcher countFiveEmailsMatcher = EMAIL_ADDRESS_PATTERN.matcher(TEXT_CONTAINING_FIVE_EMAIL_ADDRESSES); + + int count = 0; + while (countFiveEmailsMatcher.find()) { + count++; + } + + assertEquals(5, count); + } + + @Test + public void givenStringWithoutEmails_whenJava8Match_thenCountMacthesNotFound() { + Matcher noEmailMatcher = EMAIL_ADDRESS_PATTERN.matcher("Simple text without emails."); + + int count = 0; + while (noEmailMatcher.find()) { + count++; + } + + assertEquals(0, count); + } + + @Test + public void givenStringWithOverlappingEmails_whenJava8Match_thenCountWrongMatches() { + Matcher countOverlappingEmailsMatcher = EMAIL_ADDRESS_PATTERN.matcher(TEXT_CONTAINING_OVERLAP_EMAIL_ADDRESSES); + + int count = 0; + while (countOverlappingEmailsMatcher.find()) { + count++; + } + + assertNotEquals(3, count); + } + + @Test + public void givenContainingEmailString_whenStartingInJava9Match_thenCountMacthesFound() { + // uncomment to try with Java 9 + // Matcher countEmailMatcher = EMAIL_ADDRESS_PATTERN.matcher(TEXT_CONTAINING_EMAIL_ADDRESSES); + + // long count = countEmailMatcher.results().count(); + + // assertEquals(3, count); + } + + @Test + public void givenContainingFiveEmailsString_whenStartingInJava9Match_thenCountMacthesFound() { + // uncomment to try with Java 9 + // Matcher countFiveEmailsMatcher = EMAIL_ADDRESS_PATTERN.matcher(TEXT_CONTAINING_FIVE_EMAIL_ADDRESSES); + + // long count = countFiveEmailsMatcher.results().count(); + + // assertEquals(5, count); + } + + @Test + public void givenStringWithoutEmails_whenJava9Match_thenCountMacthesNotFound() { + // uncomment to try with Java 9 + // Matcher noEmailMatcher = EMAIL_ADDRESS_PATTERN.matcher("Simple text without emails."); + + // long count = noEmailMatcher.results().count(); + + // assertEquals(0, count); + } + + @Test + public void givenStringWithOverlappingEmails_whenJava9Match_thenCountWrongMatches() { + // uncomment to try with Java 9 + // Matcher countOverlappingEmailsMatcher = EMAIL_ADDRESS_PATTERN.matcher(TEXT_CONTAINING_OVERLAP_EMAIL_ADDRESSES); + + // long count = countOverlappingEmailsMatcher.results().count(); + + // assertNotEquals(3, count); + } +} diff --git a/core-java-modules/core-java-security-2/README.md b/core-java-modules/core-java-security-2/README.md index 24a821bd4d..ba8cce46a0 100644 --- a/core-java-modules/core-java-security-2/README.md +++ b/core-java-modules/core-java-security-2/README.md @@ -9,4 +9,5 @@ This module contains articles about core Java Security - [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing) - [SHA-256 and SHA3-256 Hashing in Java](https://www.baeldung.com/sha-256-hashing-java) - [Checksums in Java](https://www.baeldung.com/java-checksums) +- [How to Read PEM File to Get Public and Private Keys](https://www.baeldung.com/java-read-pem-file-keys) - More articles: [[<-- prev]](/core-java-modules/core-java-security) diff --git a/core-java-modules/core-java-security-2/pom.xml b/core-java-modules/core-java-security-2/pom.xml index 85aa3869b3..890b4147ca 100644 --- a/core-java-modules/core-java-security-2/pom.xml +++ b/core-java-modules/core-java-security-2/pom.xml @@ -41,7 +41,7 @@ javax.xml.bind jaxb-api - 2.3.1 + ${jaxb-api.version} @@ -54,6 +54,7 @@ 3.10.0 + 2.3.1 diff --git a/core-java-modules/core-java-security-2/src/main/java/com/baeldung/pem/JavaSecurityPemUtils.java b/core-java-modules/core-java-security-2/src/main/java/com/baeldung/pem/JavaSecurityPemUtils.java new file mode 100644 index 0000000000..2697072e27 --- /dev/null +++ b/core-java-modules/core-java-security-2/src/main/java/com/baeldung/pem/JavaSecurityPemUtils.java @@ -0,0 +1,48 @@ +package com.baeldung.pem; + +import org.apache.commons.codec.binary.Base64; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; + +public class JavaSecurityPemUtils { + + public static RSAPrivateKey readPKCS8PrivateKey(File file) throws GeneralSecurityException, IOException { + String key = new String(Files.readAllBytes(file.toPath()), Charset.defaultCharset()); + + String privateKeyPEM = key + .replace("-----BEGIN PRIVATE KEY-----", "") + .replaceAll(System.lineSeparator(), "") + .replace("-----END PRIVATE KEY-----", ""); + + byte[] encoded = Base64.decodeBase64(privateKeyPEM); + + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded); + return (RSAPrivateKey) keyFactory.generatePrivate(keySpec); + } + + public static RSAPublicKey readX509PublicKey(File file) throws GeneralSecurityException, IOException { + String key = new String(Files.readAllBytes(file.toPath()), Charset.defaultCharset()); + + String publicKeyPEM = key + .replace("-----BEGIN PUBLIC KEY-----", "") + .replaceAll(System.lineSeparator(), "") + .replace("-----END PUBLIC KEY-----", ""); + + byte[] encoded = Base64.decodeBase64(publicKeyPEM); + + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encoded); + return (RSAPublicKey) keyFactory.generatePublic(keySpec); + } + +} diff --git a/core-java-modules/core-java-security-2/src/main/resources/pem/private-key-pkcs8.pem b/core-java-modules/core-java-security-2/src/main/resources/pem/private-key-pkcs8.pem new file mode 100644 index 0000000000..903f903d7a --- /dev/null +++ b/core-java-modules/core-java-security-2/src/main/resources/pem/private-key-pkcs8.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCyO0YiTxLEP44S +IGk/b9MlQAXS6nC4oYyTrAfxHCi/zxW/MmtWbY0K2JxOTkVSD5QbmvwkCutXi0k9 +EdDK+orAXg2KSy686O/cfIh/iho6FmNPyEOd7UF+/5wWpknrUaTQyMA2H9Pmr2/E +RH/tN1Q0cqmhFX41WUo3lsRT81DkVCNVeJx+zDGHpjp+XY8gWpPYJ+MP4WQE9TWJ +P2rIlgcDfwhG/A21yK0WAJ5nB0Y+jGI8+HVYdjxXGlRUG//YmxS2sH+sAhsapmjE +Aha+KMk972jVNjdWU7OT0BJnUB5q286Kv6INUnk6kqYufNzjpCAY9SyMjKjpKN71 +3Gka2gZBAgMBAAECggEAFlPam12wiik0EQ1CYhIOL3JvyFZaPKbwR2ebrxbJ/A1j +OgqE69TZgGxWWHDxui/9a9/kildb2CG40Q+0SllMnICrzZFRj5TWx5ZKOz//vRsk +4c/CuLwKInC/Cw9V30bhEM61VZJzJ0j/BWVXaU4vHEro+ScKIoDHDWOzwJiQn6m9 +C+Ti5lFpax3hx8ZrgPqmBCFYNvErrWkOr7mCYl0jS+E22c68yn8+LjdlF1LWUa6N +zutk3MPj5UwEyR0h7EZReCeGkPTMQNyOBhDcmAtlEno4fjtZzUDHRjh8/QpG1Mz/ +alavvrkjswc1DmRUOdgiYu+Waxan5noBhxEAvd/hyQKBgQDjYJD0n+m0tUrpNtX0 ++mdzHstClHrpx5oNxs4sIBjCoCwEXaSpeY8+JxCdnZ6n29mLZLq/wPXxZ3EJcOSZ +PYUvZJfV/IUvoLPFbtT3ILzDTcAAeHj2GAOpzYP8J1JSFsc78ZjKMF1XeNjXcq8T +XNXoWfY7N/fShoycVeG42JJCFwKBgQDIqvHL0QfJ8r6yM8Efj7Zq6Wa4C9okORes +8UVWfBoO6UOWvpK+D9IjnaEisJcnEalwNi8/eKudR9hfvmzATV+t3YJIgktto3TT +BWLsEyniNU4vSTl7GPBrV2xabWogbChlt7TXUfw6YogaBKm43snYXBbJFc+NcpQH +ONB5igppZwKBgGDyYHvc3wGsttb/CXTde1RLUfD+a/XXpCixlmCcAtKhBoOKBdY4 +vUmL0HrTpLz/cR8NAM8XkAWwzDJxTxbDc1EEu/SCKatoAp5wph8Ed1dyhCXvN+v9 +yzoQJXFStrfHfIVjenji7DmKjjI2dM11rMLX8LPJJkI+Gh/iQk7VEG9bAoGAH/aS +sztleTZwR6RUw7k5fkgVM4W3xoNNkR+RQthbsjpXqMBMUXflqgSmsQbd3LxEd/o5 +hmurMk9KWN3VJsBsWB5rbS9L4nfh2OcHvcDDsCN7g66vODtduEthl/nLqMRxnton +NRD7EzW0pihN/IOINS1d98PAnrA8gfX7xxBE3ksCgYBvoljHGjvy3bPJ++vDGKJK +y6JuEeRVzgdPXEb60uU+BR7kdh+MMsZLmgfFTgza3R+/xeZcC/cuOPsbzeooRQi/ +9NpKwSCXjVNk9nglUWBoPRh4uYqrArWn+HoR7MI/BxeRJm5e1+ii8P19Y9joX5s0 +Q3OLn8GeH56ClJmNiWDhsA== +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/core-java-modules/core-java-security-2/src/main/resources/pem/public-key.pem b/core-java-modules/core-java-security-2/src/main/resources/pem/public-key.pem new file mode 100644 index 0000000000..54262dca03 --- /dev/null +++ b/core-java-modules/core-java-security-2/src/main/resources/pem/public-key.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjtGIk8SxD+OEiBpP2/T +JUAF0upwuKGMk6wH8Rwov88VvzJrVm2NCticTk5FUg+UG5r8JArrV4tJPRHQyvqK +wF4NiksuvOjv3HyIf4oaOhZjT8hDne1Bfv+cFqZJ61Gk0MjANh/T5q9vxER/7TdU +NHKpoRV+NVlKN5bEU/NQ5FQjVXicfswxh6Y6fl2PIFqT2CfjD+FkBPU1iT9qyJYH +A38IRvwNtcitFgCeZwdGPoxiPPh1WHY8VxpUVBv/2JsUtrB/rAIbGqZoxAIWvijJ +Pe9o1TY3VlOzk9ASZ1AeatvOir+iDVJ5OpKmLnzc46QgGPUsjIyo6Sje9dxpGtoG +QQIDAQAB +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/core-java-modules/core-java-security-2/src/test/java/com/baeldung/pem/JavaSecurityPemUtilsUnitTest.java b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/pem/JavaSecurityPemUtilsUnitTest.java new file mode 100644 index 0000000000..9c6db9c122 --- /dev/null +++ b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/pem/JavaSecurityPemUtilsUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.pem; + + +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class JavaSecurityPemUtilsUnitTest { + + @Test + public void whenReadPublicKeyFromPEMFile_thenSuccess() throws Exception { + File pemFile = new File(JavaSecurityPemUtilsUnitTest.class.getResource("/pem/public-key.pem").getFile()); + + RSAPublicKey publicKey = JavaSecurityPemUtils.readX509PublicKey(pemFile); + + assertEquals("X.509", publicKey.getFormat()); + assertEquals("RSA", publicKey.getAlgorithm()); + } + + @Test + public void whenReadPrivateKeyFromPEMFile_thenSuccess() throws Exception { + File pemFile = new File(JavaSecurityPemUtilsUnitTest.class.getResource("/pem/private-key-pkcs8.pem").getFile()); + + RSAPrivateKey privateKey = JavaSecurityPemUtils.readPKCS8PrivateKey(pemFile); + + assertEquals("PKCS#8", privateKey.getFormat()); + assertEquals("RSA", privateKey.getAlgorithm()); + } +} diff --git a/core-java-modules/core-java-streams/README.md b/core-java-modules/core-java-streams/README.md index e556c231fe..b950325e40 100644 --- a/core-java-modules/core-java-streams/README.md +++ b/core-java-modules/core-java-streams/README.md @@ -9,8 +9,8 @@ This module contains articles about the Stream API in Java. - [Iterable to Stream in Java](https://www.baeldung.com/java-iterable-to-stream) - [How to Iterate Over a Stream With Indices](https://www.baeldung.com/java-stream-indices) - [Stream Ordering in Java](https://www.baeldung.com/java-stream-ordering) -- [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) - [Java Stream Filter with Lambda Expression](https://www.baeldung.com/java-stream-filter-lambda) - [Counting Matches on a Stream Filter](https://www.baeldung.com/java-stream-filter-count) - [Summing Numbers with Java Streams](https://www.baeldung.com/java-stream-sum) -- More articles: [[next -->]](/../core-java-streams-2) \ No newline at end of file +- [How to Find all Getters Returning Null](https://www.baeldung.com/java-getters-returning-null) +- More articles: [[next -->]](/../core-java-streams-2) diff --git a/core-java-modules/core-java-string-operations-2/README.md b/core-java-modules/core-java-string-operations-2/README.md index cafb3b9017..d66515d372 100644 --- a/core-java-modules/core-java-string-operations-2/README.md +++ b/core-java-modules/core-java-string-operations-2/README.md @@ -10,7 +10,6 @@ This module contains articles about string operations. - [Java String equalsIgnoreCase()](https://www.baeldung.com/java-string-equalsignorecase) - [Case-Insensitive String Matching in Java](https://www.baeldung.com/java-case-insensitive-string-matching) - [L-Trim and R-Trim Alternatives in Java](https://www.baeldung.com/java-trim-alternatives) -- [Java Convert PDF to Base64](https://www.baeldung.com/java-convert-pdf-to-base64) - [Encode a String to UTF-8 in Java](https://www.baeldung.com/java-string-encode-utf-8) - [Guide to Character Encoding](https://www.baeldung.com/java-char-encoding) - [Convert Hex to ASCII in Java](https://www.baeldung.com/java-convert-hex-to-ascii) #remove additional readme file diff --git a/core-java-modules/core-java-string-operations-3/README.md b/core-java-modules/core-java-string-operations-3/README.md new file mode 100644 index 0000000000..4e46849c11 --- /dev/null +++ b/core-java-modules/core-java-string-operations-3/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Version Comparison in Java](https://www.baeldung.com/java-comparing-versions) diff --git a/core-java-modules/core-java-string-operations-3/pom.xml b/core-java-modules/core-java-string-operations-3/pom.xml new file mode 100644 index 0000000000..5edff0e090 --- /dev/null +++ b/core-java-modules/core-java-string-operations-3/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + core-java-string-operations-3 + 0.1.0-SNAPSHOT + core-java-string-operations-3 + jar + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + ../ + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.apache.maven + maven-artifact + ${maven-artifact.version} + + + org.gradle + gradle-core + ${gradle-core.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-core.version} + + + com.vdurmont + semver4j + ${semver4j.version} + + + + + 3.6.1 + 3.6.3 + 6.1.1 + 2.11.1 + 3.1.0 + + + + + gradle-repo + https://repo.gradle.org/gradle/libs-releases-local/ + + + diff --git a/core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/versioncomparison/VersionCompare.java b/core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/versioncomparison/VersionCompare.java new file mode 100644 index 0000000000..5a1663e50d --- /dev/null +++ b/core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/versioncomparison/VersionCompare.java @@ -0,0 +1,25 @@ +package com.baeldung.versioncomparison; + +public class VersionCompare { + + public static int compareVersions(String version1, String version2) { + int comparisonResult = 0; + + String[] version1Splits = version1.split("\\."); + String[] version2Splits = version2.split("\\."); + + int maxLengthOfVersionSplits = Math.max(version1Splits.length, version2Splits.length); + for (int i = 0; i < maxLengthOfVersionSplits; i++){ + Integer v1 = i < version1Splits.length ? Integer.parseInt(version1Splits[i]) : 0; + Integer v2 = i < version2Splits.length ? Integer.parseInt(version2Splits[i]) : 0; + int compare = v1.compareTo(v2); + if (compare != 0) { + comparisonResult = compare; + break; + } + } + + return comparisonResult; + } + +} diff --git a/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/versioncomparison/VersionComparisonUnitTest.java b/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/versioncomparison/VersionComparisonUnitTest.java new file mode 100644 index 0000000000..145e9788e4 --- /dev/null +++ b/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/versioncomparison/VersionComparisonUnitTest.java @@ -0,0 +1,136 @@ +package com.baeldung.versioncomparison; + +import org.junit.Test; + +import com.fasterxml.jackson.core.Version; +import com.vdurmont.semver4j.Semver; +import com.vdurmont.semver4j.Semver.VersionDiff; + +import org.apache.maven.artifact.versioning.ComparableVersion; +import org.gradle.util.VersionNumber; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class VersionComparisonUnitTest { + + @Test + public void givenVersionStrings_whenUsingMavenArtifact_thenCompareVersions() { + ComparableVersion version1_1 = new ComparableVersion("1.1"); + ComparableVersion version1_2 = new ComparableVersion("1.2"); + ComparableVersion version1_3 = new ComparableVersion("1.3"); + + assertTrue(version1_1.compareTo(version1_2) < 0); + assertTrue(version1_3.compareTo(version1_2) > 0); + + ComparableVersion version1_1_0 = new ComparableVersion("1.1.0"); + assertEquals(0, version1_1.compareTo(version1_1_0)); + + ComparableVersion version1_1_alpha = new ComparableVersion("1.1-alpha"); + assertTrue(version1_1.compareTo(version1_1_alpha) > 0); + + ComparableVersion version1_1_beta = new ComparableVersion("1.1-beta"); + ComparableVersion version1_1_milestone = new ComparableVersion("1.1-milestone"); + ComparableVersion version1_1_rc = new ComparableVersion("1.1-rc"); + ComparableVersion version1_1_snapshot = new ComparableVersion("1.1-snapshot"); + + assertTrue(version1_1_alpha.compareTo(version1_1_beta) < 0); + assertTrue(version1_1_beta.compareTo(version1_1_milestone) < 0); + assertTrue(version1_1_rc.compareTo(version1_1_snapshot) < 0); + assertTrue(version1_1_snapshot.compareTo(version1_1) < 0); + + ComparableVersion version1_1_c = new ComparableVersion("1.1-c"); + ComparableVersion version1_1_z = new ComparableVersion("1.1-z"); + ComparableVersion version1_1_1 = new ComparableVersion("1.1.1"); + + assertTrue(version1_1_c.compareTo(version1_1_z) < 0); + assertTrue(version1_1_z.compareTo(version1_1_1) < 0); + } + + @Test + public void givenVersionStrings_whenUsingGradle_thenCompareVersions() { + VersionNumber version1_1 = VersionNumber.parse("1.1"); + VersionNumber version1_2 = VersionNumber.parse("1.2"); + VersionNumber version1_3 = VersionNumber.parse("1.3"); + + assertTrue(version1_1.compareTo(version1_2) < 0); + assertTrue(version1_3.compareTo(version1_2) > 0); + + VersionNumber version1_1_0 = VersionNumber.parse("1.1.0"); + assertEquals(0, version1_1.compareTo(version1_1_0)); + + VersionNumber version1_1_1_1_alpha = VersionNumber.parse("1.1.1.1-alpha"); + assertTrue(version1_1.compareTo(version1_1_1_1_alpha) < 0); + + VersionNumber version1_1_beta = VersionNumber.parse("1.1.0.0-beta"); + assertTrue(version1_1_beta.compareTo(version1_1_1_1_alpha) < 0); + + VersionNumber version1_1_1_snapshot = VersionNumber.parse("1.1.1-snapshot"); + assertTrue(version1_1_1_1_alpha.compareTo(version1_1_1_snapshot) < 0); + } + + @Test + public void givenVersionStrings_whenUsingJackson_thenCompareVersions() { + Version version1_1 = new Version(1, 1, 0, null, null, null); + Version version1_2 = new Version(1, 2, 0, null, null, null); + Version version1_3 = new Version(1, 3, 0, null, null, null); + + assertTrue(version1_1.compareTo(version1_2) < 0); + assertTrue(version1_3.compareTo(version1_2) > 0); + + Version version1_1_1 = new Version(1, 1, 1, null, null, null); + assertTrue(version1_1.compareTo(version1_1_1) < 0); + + Version version1_1_maven = new Version(1, 1, 0, null, "org.apache.maven", null); + Version version1_1_gradle = new Version(1, 1, 0, null, "org.gradle", null); + assertTrue(version1_1_maven.compareTo(version1_1_gradle) < 0); + + Version version1_1_snapshot = new Version(1, 1, 0, "snapshot", null, null); + assertEquals(0, version1_1.compareTo(version1_1_snapshot)); + + assertTrue(version1_1_snapshot.isSnapshot()); + } + + @Test + public void givenVersionStrings_whenUsingSemver_thenCompareVersions() { + Semver version1_1 = new Semver("1.1.0"); + Semver version1_2 = new Semver("1.2.0"); + Semver version1_3 = new Semver("1.3.0"); + + assertTrue(version1_1.compareTo(version1_2) < 0); + assertTrue(version1_3.compareTo(version1_2) > 0); + + Semver version1_1_alpha = new Semver("1.1.0-alpha"); + assertTrue(version1_1.isGreaterThan(version1_1_alpha)); + + Semver version1_1_beta = new Semver("1.1.0-beta"); + Semver version1_1_milestone = new Semver("1.1.0-milestone"); + Semver version1_1_rc = new Semver("1.1.0-rc"); + Semver version1_1_snapshot = new Semver("1.1.0-snapshot"); + + assertTrue(version1_1_alpha.isLowerThan(version1_1_beta)); + assertTrue(version1_1_beta.compareTo(version1_1_milestone) < 0); + assertTrue(version1_1_rc.compareTo(version1_1_snapshot) < 0); + assertTrue(version1_1_snapshot.compareTo(version1_1) < 0); + + assertTrue(version1_1.isEqualTo("1.1.0")); + + assertEquals(VersionDiff.MAJOR, version1_1.diff("2.1.0")); + assertEquals(VersionDiff.MINOR, version1_1.diff("1.2.3")); + assertEquals(VersionDiff.PATCH, version1_1.diff("1.1.1")); + + assertTrue(version1_1.isStable()); + assertFalse(version1_1_alpha.isStable()); + } + + @Test + public void givenVersionStrings_whenUsingCustomVersionCompare_thenCompareVersions() { + assertTrue(VersionCompare.compareVersions("1.0.1", "1.1.2") < 0); + assertTrue(VersionCompare.compareVersions("1.0.1", "1.10") < 0); + assertTrue(VersionCompare.compareVersions("1.1.2", "1.0.1") > 0); + assertTrue(VersionCompare.compareVersions("1.1.2", "1.2") < 0); + assertEquals(0, VersionCompare.compareVersions("1.3.0", "1.3")); + } + +} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/DefaultSerial.java b/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/DefaultSerial.java new file mode 100644 index 0000000000..ddfef9a1d2 --- /dev/null +++ b/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/DefaultSerial.java @@ -0,0 +1,15 @@ +package com.baeldung.deserialization; + +import java.io.IOException; +import java.io.Serializable; + +public class DefaultSerial implements Serializable { + + private String name; + + public static void main(String[] args) throws IOException, ClassNotFoundException { + String digest = "rO0ABXNyACpjb20uYmFlbGR1bmcuZGVzZXJpY" + + "WxpemF0aW9uLkRlZmF1bHRTZXJpYWx9iVz3Lz/mdAIAAHhw"; + DefaultSerial instance = (DefaultSerial) DeserializationUtility.deSerializeObjectFromString(digest); + } +} diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index 26c374b51d..589097cf48 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/pom.xml @@ -72,6 +72,7 @@ core-java-io core-java-io-2 + core-java-io-3 core-java-io-apis core-java-io-conversions core-java-io-conversions-2 @@ -80,10 +81,12 @@ core-java-jndi core-java-jvm + core-java-jvm-2 core-java-lambdas core-java-lang core-java-lang-2 + core-java-lang-3 core-java-lang-math core-java-lang-math-2 core-java-lang-oop-constructors @@ -109,6 +112,7 @@ core-java-perf core-java-reflection + core-java-reflection-2 core-java-security core-java-security-2 @@ -123,6 +127,7 @@ core-java-string-conversions-2 core-java-string-operations core-java-string-operations-2 + core-java-string-operations-3 core-java-strings core-java-sun @@ -133,18 +138,6 @@ pre-jpms - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - - - @@ -162,6 +155,18 @@ + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + + 2.22.2 5.6.2 diff --git a/core-kotlin-modules/core-kotlin-collections/README.md b/core-kotlin-modules/core-kotlin-collections/README.md index 997680c2bc..2ebb748cba 100644 --- a/core-kotlin-modules/core-kotlin-collections/README.md +++ b/core-kotlin-modules/core-kotlin-collections/README.md @@ -3,6 +3,7 @@ This module contains articles about core Kotlin collections. ### Relevant articles: + - [Split a List Into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts) - [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list) - [Overview of Kotlin Collections API](https://www.baeldung.com/kotlin-collections-api) @@ -11,3 +12,5 @@ This module contains articles about core Kotlin collections. - [Collection Transformations in Kotlin](https://www.baeldung.com/kotlin-collection-transformations) - [Difference between fold and reduce in Kotlin](https://www.baeldung.com/kotlin/fold-vs-reduce) - [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort) +- [Working With Lists in Kotlin](https://www.baeldung.com/kotlin/lists) +- [Iterating Collections by Index in Kotlin](https://www.baeldung.com/kotlin/iterating-collections-by-index) diff --git a/core-kotlin-modules/core-kotlin-collections/src/main/kotlin/com/baeldung/index/IndexedIteration.kt b/core-kotlin-modules/core-kotlin-collections/src/main/kotlin/com/baeldung/index/IndexedIteration.kt new file mode 100644 index 0000000000..07fb595ede --- /dev/null +++ b/core-kotlin-modules/core-kotlin-collections/src/main/kotlin/com/baeldung/index/IndexedIteration.kt @@ -0,0 +1,33 @@ +package com.baeldung.index + +fun main() { + + // Index only + val colors = listOf("Red", "Green", "Blue") + for (i in colors.indices) { + println(colors[i]) + } + + val colorArray = arrayOf("Red", "Green", "Blue") + for (i in colorArray.indices) { + println(colorArray[i]) + } + + (0 until colors.size).forEach { println(colors[it]) } + for (i in 0 until colors.size) { + println(colors[i]) + } + + // Index and Value + colors.forEachIndexed { i, v -> println("The value for index $i is $v") } + for (indexedValue in colors.withIndex()) { + println("The value for index ${indexedValue.index} is ${indexedValue.value}") + } + + for ((i, v) in colors.withIndex()) { + println("The value for index $i is $v") + } + + colors.filterIndexed { i, _ -> i % 2 == 0 } + colors.filterIndexed { _, v -> v == "RED" } +} diff --git a/core-kotlin-modules/core-kotlin-collections/src/main/kotlin/com/baeldung/kotlin/collections/ListExample.kt b/core-kotlin-modules/core-kotlin-collections/src/main/kotlin/com/baeldung/kotlin/collections/ListExample.kt new file mode 100644 index 0000000000..a29eabe623 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-collections/src/main/kotlin/com/baeldung/kotlin/collections/ListExample.kt @@ -0,0 +1,204 @@ +package com.baeldung.kotlin.collections + +import kotlin.collections.List + +class ListExample { + + private val countries = listOf("Germany", "India", "Japan", "Brazil", "Australia") + private val cities = mutableListOf("Berlin", "Calcutta", "Seoul", "Sao Paulo", "Sydney") + + fun createList(): List { + val countryList = listOf("Germany", "India", "Japan", "Brazil") + return countryList + } + + fun createMutableList(): MutableList { + val cityList = mutableListOf("Berlin", "Calcutta", "Seoul", "Sao Paulo") + return cityList + } + + fun iterateUsingForEachLoop(): List { + val countryLength = mutableListOf() + countries.forEach { it -> + print("$it ") + println(" Length: ${it.length}") + countryLength.add(it.length) + } + return countryLength + } + + fun iterateUsingForLoop(): List { + val countryLength = mutableListOf() + for (country in countries) { + print("$country ") + println(" Length: ${country.length}") + countryLength.add(country.length) + } + return countryLength + } + + fun iterateUsingForLoopRange(): List { + val countryLength = mutableListOf() + for (i in 0 until countries.size) { + print("${countries[i]} ") + println(" Length: ${countries[i].length}") + countryLength.add(countries[i].length) + } + return countryLength + } + + fun iterateUsingForEachIndexedLoop(): List { + val countryLength = mutableListOf() + countries.forEachIndexed { i, e -> + println("country[$i] = $e") + print(" Index: $i") + println(" Length: ${e.length}") + countryLength.add(e.length) + } + return countryLength + } + + fun iterateUsingListIterator() { + val iterator = countries.listIterator() + while (iterator.hasNext()) { + val country = iterator.next() + print("$country ") + } + println() + + while (iterator.hasPrevious()) { + println("Index: ${iterator.previousIndex()}") + } + } + + fun iterateUsingIterator() { + val iterator = cities.iterator() + iterator.next() + iterator.remove() + println(cities) + } + + fun iterateUsingMutableListIterator() { + val iterator = cities.listIterator(1) + iterator.next() + iterator.add("London") + iterator.next() + iterator.set("Milan") + println(cities) + } + + fun retrieveElementsInList(): String { + println(countries[2]) + return countries[2] + } + + fun retrieveElementsUsingGet(): String { + println(countries.get(3)) + return countries.get(3) + } + + fun retrieveElementsFirstAndLast(): String? { + println(countries.first()) + println(countries.last()) + println(countries.first { it.length > 7 }) + println(countries.last { it.startsWith("J") }) + println(countries.firstOrNull { it.length > 8 }) + return countries.firstOrNull { it.length > 8 } + } + + fun retrieveSubList(): List { + val subList = countries.subList(1, 4) + println(subList) + return subList + } + + fun retrieveListSliceUsingIndices(): List { + val sliceList = countries.slice(1..4) + println(sliceList) + return sliceList + } + + fun retrieveListSliceUsingIndicesList(): List { + val sliceList = countries.slice(listOf(1, 4)) + println(sliceList) + return sliceList + } + + fun countList(): Int { + val count = countries.count() + println(count) + return count + } + + fun countListUsingPredicate(): Int { + val count = countries.count { it.length > 5 } + println(count) + return count + } + + fun countListUsingProperty(): Int { + val size = countries.size + println(size) + return size + } + + fun addToList(): List { + cities.add("Barcelona") + println(cities) + cities.add(3, "London") + println(cities) + cities.addAll(listOf("Singapore", "Moscow")) + println(cities) + cities.addAll(2, listOf("Prague", "Amsterdam")) + println(cities) + return cities + } + + fun removeFromList(): List { + cities.remove("Seoul") + println(cities) + cities.removeAt(1) + println(cities) + return cities + } + + fun replaceFromList(): List { + cities.set(3, "Prague") + println(cities) + cities[4] = "Moscow" + println(cities) + cities.fill("Barcelona") + println(cities) + return cities + } + + fun sortMutableList(): List { + cities.sort() + println(cities) + cities.sortDescending() + println(cities) + return cities + } + + fun sortList(): List { + val sortedCountries = countries.sorted() + println("countries = $countries") + println("sortedCountries = $sortedCountries") + val sortedCountriesDescending = countries.sortedDescending() + println("countries = $countries") + println("sortedCountriesDescending = $sortedCountriesDescending") + return sortedCountriesDescending + } + + fun checkOneElementInList(): Boolean { + return countries.contains("Germany") + } + + fun checkOneElementInListUsingOperator(): Boolean { + return "Spain" in countries + } + + fun checkElementsInList(): Boolean { + return cities.containsAll(listOf("Calcutta", "Sao Paulo", "Sydney")) + } +} \ No newline at end of file diff --git a/core-kotlin-modules/core-kotlin-collections/src/test/kotlin/com/baeldung/kotlin/collections/ListExampleUnitTest.kt b/core-kotlin-modules/core-kotlin-collections/src/test/kotlin/com/baeldung/kotlin/collections/ListExampleUnitTest.kt new file mode 100644 index 0000000000..71fe3bf1e0 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-collections/src/test/kotlin/com/baeldung/kotlin/collections/ListExampleUnitTest.kt @@ -0,0 +1,126 @@ +package com.baeldung.kotlin.collections + +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.Assertions.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class ListExampleUnitTest { + + private val classUnderTest: ListExample = ListExample() + + @Test + fun whenListIsCreated_thenContainsElements() { + assertTrue(classUnderTest.createList().contains("India")) + assertTrue(classUnderTest.createMutableList().contains("Seoul")) + } + + @Test + fun whenIterateUsingForEachLoop_thenSuccess() { + assertEquals(7, classUnderTest.iterateUsingForEachLoop()[0]) + } + + @Test + fun whenIterateUsingForLoop_thenSuccess() { + assertEquals(5, classUnderTest.iterateUsingForLoop()[1]) + } + + @Test + fun whenIterateUsingForLoopRange_thenSuccess() { + assertEquals(6, classUnderTest.iterateUsingForLoopRange()[3]) + } + + @Test + fun whenIterateUsingForEachIndexedLoop_thenSuccess() { + assertEquals(9, classUnderTest.iterateUsingForEachIndexedLoop()[4]) + } + + @Test + fun whenRetrieveElementsInList_thenSuccess() { + assertEquals("Japan", classUnderTest.retrieveElementsInList()) + } + + @Test + fun whenRetrieveElementsUsingGet_thenSuccess() { + assertEquals("Brazil", classUnderTest.retrieveElementsUsingGet()) + } + + @Test + fun whenRetrieveElementsFirstAndLast_thenSuccess() { + assertEquals("Australia", classUnderTest.retrieveElementsFirstAndLast()) + } + + @Test + fun whenRetrieveSubList_thenSuccess() { + assertEquals(3, classUnderTest.retrieveSubList().size) + } + + @Test + fun whenRetrieveListSliceUsingIndices_thenSuccess() { + assertEquals(4, classUnderTest.retrieveListSliceUsingIndices().size) + } + + @Test + fun whenRetrieveListSliceUsingIndicesList_thenSuccess() { + assertEquals(2, classUnderTest.retrieveListSliceUsingIndicesList().size) + } + + @Test + fun whenCountList_thenSuccess() { + assertEquals(5, classUnderTest.countList()) + } + + @Test + fun whenCountListUsingPredicate_thenSuccess() { + assertEquals(3, classUnderTest.countListUsingPredicate()) + } + + @Test + fun whenCountListUsingProperty_thenSuccess() { + assertEquals(5, classUnderTest.countListUsingProperty()) + } + + @Test + fun whenAddToList_thenSuccess() { + assertEquals(11, classUnderTest.addToList().count()) + } + + @Test + fun whenRemoveFromList_thenSuccess() { + val list = classUnderTest.removeFromList() + assertEquals(3, list.size) + assertEquals("Sao Paulo", list[1]) + } + + @Test + fun whenReplaceFromList_thenSuccess() { + val list = classUnderTest.replaceFromList() + assertEquals(5, list.size) + assertEquals("Barcelona", list[1]) + } + + @Test + fun whenSortMutableList_thenSuccess() { + assertEquals("Sydney", classUnderTest.sortMutableList()[0]) + } + + @Test + fun whenSortList_thenSuccess() { + assertEquals("India", classUnderTest.sortList()[1]) + } + + @Test + fun whenCheckOneElementInList_thenSuccess() { + assertTrue(classUnderTest.checkOneElementInList()) + } + + @Test + fun whenCheckOneElementInListUsingOperator_thenSuccess() { + assertFalse(classUnderTest.checkOneElementInListUsingOperator()) + } + + @Test + fun whenCheckElementsInList_thenSuccess() { + assertTrue(classUnderTest.checkElementsInList()) + } +} \ No newline at end of file diff --git a/core-kotlin-modules/core-kotlin-lang-2/README.md b/core-kotlin-modules/core-kotlin-lang-2/README.md index 4c47f28088..e7f232856b 100644 --- a/core-kotlin-modules/core-kotlin-lang-2/README.md +++ b/core-kotlin-modules/core-kotlin-lang-2/README.md @@ -7,9 +7,10 @@ This module contains articles about core features in the Kotlin language. - [Infix Functions in Kotlin](https://www.baeldung.com/kotlin-infix-functions) - [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions) - [Creating Java static final Equivalents in Kotlin](https://www.baeldung.com/kotlin-java-static-final) -- [Initializing Arrays in Kotlin](https://www.baeldung.com/kotlin-initialize-array) - [Lazy Initialization in Kotlin](https://www.baeldung.com/kotlin-lazy-initialization) - [Comprehensive Guide to Null Safety in Kotlin](https://www.baeldung.com/kotlin-null-safety) - [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions) +- [If-Else Expression in Kotlin](https://www.baeldung.com/kotlin/if-else-expression) - [Checking Whether a lateinit var Is Initialized in Kotlin](https://www.baeldung.com/kotlin/checking-lateinit) +- [Not-Null Assertion (!!) Operator in Kotlin](https://www.baeldung.com/kotlin/not-null-assertion) - [[<-- Prev]](/core-kotlin-modules/core-kotlin-lang) diff --git a/core-kotlin-modules/core-kotlin-lang-2/src/test/kotlin/com/baeldung/arrayinitialization/ArrayInitializationTest.kt b/core-kotlin-modules/core-kotlin-lang-2/src/test/kotlin/com/baeldung/arrayinitialization/ArrayInitializationTest.kt deleted file mode 100644 index d4b9d607fb..0000000000 --- a/core-kotlin-modules/core-kotlin-lang-2/src/test/kotlin/com/baeldung/arrayinitialization/ArrayInitializationTest.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.baeldung.arrayinitialization - -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 diff --git a/core-kotlin-modules/core-kotlin-lang-oop-2/README.md b/core-kotlin-modules/core-kotlin-lang-oop-2/README.md index 27536273dc..a62a25c01d 100644 --- a/core-kotlin-modules/core-kotlin-lang-oop-2/README.md +++ b/core-kotlin-modules/core-kotlin-lang-oop-2/README.md @@ -7,4 +7,5 @@ This module contains articles about Object-Oriented Programming in Kotlin - [Generics in Kotlin](https://www.baeldung.com/kotlin-generics) - [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties) - [Delegation Pattern in Kotlin](https://www.baeldung.com/kotlin-delegation-pattern) +- [Anonymous Inner Classes in Kotlin](https://www.baeldung.com/kotlin/anonymous-inner-classes) - [[<-- Prev]](/core-kotlin-modules/core-kotlin-lang-oop) diff --git a/core-kotlin-modules/core-kotlin-lang-oop-2/src/main/kotlin/com/baeldung/anonymous/Anonymous.kt b/core-kotlin-modules/core-kotlin-lang-oop-2/src/main/kotlin/com/baeldung/anonymous/Anonymous.kt new file mode 100644 index 0000000000..ea471f5d00 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-lang-oop-2/src/main/kotlin/com/baeldung/anonymous/Anonymous.kt @@ -0,0 +1,41 @@ +package com.baeldung.anonymous + +import java.io.Serializable +import java.nio.channels.Channel + +fun main() { + val channel = object : Channel { + override fun isOpen() = false + + override fun close() { + } + } + + val maxEntries = 10 + val lruCache = object : LinkedHashMap(10, 0.75f) { + + override fun removeEldestEntry(eldest: MutableMap.MutableEntry?): Boolean { + return size > maxEntries + } + } + + val map = object : LinkedHashMap() { + // omitted + } + + val serializableChannel = object : Channel, Serializable { + override fun isOpen(): Boolean { + TODO("Not yet implemented") + } + + override fun close() { + TODO("Not yet implemented") + } + } + + val obj = object { + val question = "answer" + val answer = 42 + } + println("The ${obj.question} is ${obj.answer}") +} \ No newline at end of file diff --git a/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/operators/Page.kt b/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/operators/Page.kt index 1077eb94f9..8a0ee48a36 100644 --- a/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/operators/Page.kt +++ b/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/operators/Page.kt @@ -6,6 +6,7 @@ interface Page { fun elements(): MutableList } +operator fun Page.invoke(index: Int): T = elements()[index] 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) { diff --git a/core-kotlin-modules/core-kotlin-lang/src/test/kotlin/com/baeldung/operators/PageTest.kt b/core-kotlin-modules/core-kotlin-lang/src/test/kotlin/com/baeldung/operators/PageTest.kt index 4217fc0c08..fa6e1773bd 100644 --- a/core-kotlin-modules/core-kotlin-lang/src/test/kotlin/com/baeldung/operators/PageTest.kt +++ b/core-kotlin-modules/core-kotlin-lang/src/test/kotlin/com/baeldung/operators/PageTest.kt @@ -14,6 +14,11 @@ class PageTest { assertEquals(page[1, 3], listOf("Kotlin", "Scala")) } + @Test + fun `Invoke convention should work as expected`() { + assertEquals(page(1), "Kotlin") + } + @Test fun `In convention should work on a page as expected`() { assertTrue("Kotlin" in page) diff --git a/core-kotlin-modules/core-kotlin/README.md b/core-kotlin-modules/core-kotlin/README.md index 48d19c987a..359c5a4787 100644 --- a/core-kotlin-modules/core-kotlin/README.md +++ b/core-kotlin-modules/core-kotlin/README.md @@ -9,3 +9,4 @@ This module contains articles about Kotlin core features. - [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) - [Kotlin Ternary Conditional Operator](https://www.baeldung.com/kotlin-ternary-operator) - [Sequences in Kotlin](https://www.baeldung.com/kotlin/sequences) +- [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) diff --git a/data-structures/README.md b/data-structures/README.md index e3436695ce..0a29bd8964 100644 --- a/data-structures/README.md +++ b/data-structures/README.md @@ -11,3 +11,4 @@ This module contains articles about data structures in Java - [Introduction to Big Queue](https://www.baeldung.com/java-big-queue) - [Guide to AVL Trees in Java](https://www.baeldung.com/java-avl-trees) - [Graphs in Java](https://www.baeldung.com/java-graphs) +- [Implementing a Ring Buffer in Java](https://www.baeldung.com/java-ring-buffer) diff --git a/data-structures/src/main/java/com/baeldung/circularbuffer/CircularBuffer.java b/data-structures/src/main/java/com/baeldung/circularbuffer/CircularBuffer.java new file mode 100644 index 0000000000..6b315265b4 --- /dev/null +++ b/data-structures/src/main/java/com/baeldung/circularbuffer/CircularBuffer.java @@ -0,0 +1,75 @@ +package com.baeldung.circularbuffer; + +public class CircularBuffer { + + private static final int DEFAULT_CAPACITY = 8; + + private final int capacity; + private final E[] data; + private volatile int writeSequence, readSequence; + + @SuppressWarnings("unchecked") + public CircularBuffer(int capacity) { + + this.capacity = (capacity < 1) ? DEFAULT_CAPACITY : capacity; + this.data = (E[]) new Object[capacity]; + + this.readSequence = 0; + this.writeSequence = -1; + } + + public boolean offer(E element) { + + if (isNotFull()) { + + int nextWriteSeq = writeSequence + 1; + data[nextWriteSeq % capacity] = element; + + writeSequence++; + return true; + } + + return false; + } + + public E poll() { + + if (isNotEmpty()) { + + E nextValue = data[readSequence % capacity]; + readSequence++; + return nextValue; + } + + return null; + } + + public int capacity() { + return capacity; + } + + public int size() { + + return (writeSequence - readSequence) + 1; + } + + public boolean isEmpty() { + + return writeSequence < readSequence; + } + + public boolean isFull() { + + return size() >= capacity; + } + + private boolean isNotEmpty() { + + return !isEmpty(); + } + + private boolean isNotFull() { + + return !isFull(); + } +} diff --git a/data-structures/src/test/java/com/baeldung/circularbuffer/CircularBufferUnitTest.java b/data-structures/src/test/java/com/baeldung/circularbuffer/CircularBufferUnitTest.java new file mode 100644 index 0000000000..4b8e8646f3 --- /dev/null +++ b/data-structures/src/test/java/com/baeldung/circularbuffer/CircularBufferUnitTest.java @@ -0,0 +1,72 @@ +package com.baeldung.circularbuffer; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class CircularBufferUnitTest { + + private final String[] shapes = { "Circle", "Triangle", "Rectangle", "Square", "Rhombus", "Trapezoid", "Pentagon", "Pentagram", "Hexagon", "Hexagram" }; + private final int defaultCapacity = shapes.length; + + @Test + public void givenCircularBuffer_whenAnElementIsEnqueued_thenSizeIsOne() { + CircularBuffer buffer = new CircularBuffer<>(defaultCapacity); + + assertTrue(buffer.offer("Square")); + assertEquals(1, buffer.size()); + } + + @Test + public void givenCircularBuffer_whenAnElementIsDequeued_thenElementMatchesEnqueuedElement() { + CircularBuffer buffer = new CircularBuffer<>(defaultCapacity); + + buffer.offer("Triangle"); + + String shape = buffer.poll(); + assertEquals("Triangle", shape); + } + + @Test + public void givenCircularBuffer_whenAnElementIsEnqueuedAndDeququed_thenBufferIsEmpty() { + + CircularBuffer buffer = new CircularBuffer<>(defaultCapacity); + + buffer.offer("Rectangle"); + + assertFalse(buffer.isEmpty()); + assertEquals(1, buffer.size()); + + buffer.poll(); + + assertTrue(buffer.isEmpty()); + } + + @Test + public void givenCircularBuffer_whenFilledToCapacity_thenNoMoreElementsCanBeEnqueued() { + + int capacity = shapes.length; + CircularBuffer buffer = new CircularBuffer<>(capacity); + + assertTrue(buffer.isEmpty()); + + for (String shape : shapes) { + buffer.offer(shape); + } + + assertTrue(buffer.isFull()); + assertFalse(buffer.offer("Octagon")); + } + + @Test + public void givenCircularBuffer_whenBufferIsEmpty_thenReturnsNull() { + + CircularBuffer buffer = new CircularBuffer<>(1); + + assertTrue(buffer.isEmpty()); + assertNull(buffer.poll()); + } +} diff --git a/data-structures/src/test/java/com/baeldung/circularbuffer/ProducerConsumerLiveTest.java b/data-structures/src/test/java/com/baeldung/circularbuffer/ProducerConsumerLiveTest.java new file mode 100644 index 0000000000..83ce27043b --- /dev/null +++ b/data-structures/src/test/java/com/baeldung/circularbuffer/ProducerConsumerLiveTest.java @@ -0,0 +1,80 @@ +package com.baeldung.circularbuffer; + +import static org.junit.Assert.assertArrayEquals; + +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.LockSupport; + +import org.junit.jupiter.api.Test; + +public class ProducerConsumerLiveTest { + + private final String[] shapes = { "Circle", "Triangle", "Rectangle", "Square", "Rhombus", "Trapezoid", "Pentagon", "Pentagram", "Hexagon", "Hexagram" }; + + @Test + public void givenACircularBuffer_whenInterleavingProducerConsumer_thenElementsMatch() throws Exception { + CircularBuffer buffer = new CircularBuffer(shapes.length); + + ExecutorService executorService = Executors.newFixedThreadPool(2); + + executorService.submit(new Producer(buffer, shapes)); + Future consumed = executorService.submit(new Consumer(buffer, shapes.length)); + + String[] shapesConsumed = consumed.get(5L, TimeUnit.SECONDS); + assertArrayEquals(shapes, shapesConsumed); + } + + static class Producer implements Runnable { + + private CircularBuffer buffer; + private T[] items; + + public Producer(CircularBuffer buffer, T[] items) { + this.buffer = buffer; + this.items = items; + } + + @Override + public void run() { + + for (int i = 0; i < items.length;) { + if (buffer.offer(items[i])) { + System.out.println("Produced: " + items[i]); + i++; + LockSupport.parkNanos(5); + } + } + } + } + + @SuppressWarnings("unchecked") + static class Consumer implements Callable { + + private CircularBuffer buffer; + private int expectedCount; + + public Consumer(CircularBuffer buffer, int expectedCount) { + this.buffer = buffer; + this.expectedCount = expectedCount; + } + + @Override + public T[] call() throws Exception { + T[] items = (T[]) new Object[expectedCount]; + for (int i = 0; i < items.length;) { + T item = buffer.poll(); + if (item != null) { + items[i++] = item; + + LockSupport.parkNanos(5); + System.out.println("Consumed: " + item); + } + } + return items; + } + } +} diff --git a/ddd/pom.xml b/ddd/pom.xml index 422f9ccd15..9f960502a3 100644 --- a/ddd/pom.xml +++ b/ddd/pom.xml @@ -17,16 +17,6 @@ ../parent-boot-2 - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - - @@ -105,6 +95,16 @@ + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + 2.22.2 diff --git a/ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java b/ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java new file mode 100644 index 0000000000..fcc6a50267 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java @@ -0,0 +1,46 @@ +package com.baeldung.ddd.order.config; + +import org.bson.Document; +import org.joda.money.CurrencyUnit; +import org.joda.money.Money; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.convert.converter.Converter; +import org.springframework.data.convert.ReadingConverter; +import org.springframework.data.mongodb.core.convert.MongoCustomConversions; + +import java.math.BigDecimal; +import java.util.Collections; + +@Configuration +public class CustomMongoConfiguration { + + @Bean + public MongoCustomConversions customConversions() { + return new MongoCustomConversions(Collections.singletonList(DocumentToMoneyConverter.INSTANCE)); + } + + @ReadingConverter + enum DocumentToMoneyConverter implements Converter { + + INSTANCE; + + @Override + public Money convert(Document source) { + Document money = source.get("money", Document.class); + + return Money.of(getCurrency(money), getAmount(money)); + } + + private CurrencyUnit getCurrency(Document money) { + Document currency = money.get("currency", Document.class); + String currencyCode = currency.getString("code"); + return CurrencyUnit.of(currencyCode); + } + + private BigDecimal getAmount(Document money) { + String amount = money.getString("amount"); + return BigDecimal.valueOf(Double.parseDouble(amount)); + } + } +} diff --git a/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java b/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java similarity index 84% rename from ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java rename to ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java index c503c9960b..8f30bc14a7 100644 --- a/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java +++ b/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java @@ -1,19 +1,24 @@ 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; +import java.math.BigDecimal; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; + +/* + To run this test we need to run the databases first. + A dedicated docker-compose.yml file is located under the resources directory. + We can run it by simple executing `docker-compose up`. + */ @SpringJUnitConfig @SpringBootTest -public class PersistOrderIntegrationTest { +public class PersistOrderLiveTest { @Autowired private JpaOrderRepository repository; diff --git a/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java b/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java similarity index 87% rename from ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java rename to ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java index ca4315c416..38e00be0b0 100644 --- a/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java +++ b/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java @@ -17,9 +17,14 @@ import com.baeldung.ddd.order.Order; import com.baeldung.ddd.order.OrderLine; import com.baeldung.ddd.order.Product; +/* + To run this test we need to run the databases first. + A dedicated docker-compose.yml file is located under the resources directory. + We can run it by simple executing `docker-compose up`. + */ @SpringJUnitConfig @SpringBootTest -public class OrderMongoIntegrationTest { +public class OrderMongoLiveTest { @Autowired private OrderMongoRepository repo; diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryIntegrationTest.java b/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java similarity index 87% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryIntegrationTest.java rename to ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java index 668d1e5e34..4b44e1d7b4 100644 --- a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryIntegrationTest.java +++ b/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java @@ -18,10 +18,15 @@ import com.baeldung.dddhexagonalspring.domain.Product; import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository; import com.baeldung.dddhexagonalspring.infrastracture.repository.cassandra.SpringDataCassandraOrderRepository; +/* + To run this test we need to run the databases first. + A dedicated docker-compose.yml file is located under the resources directory. + We can run it by simple executing `docker-compose up`. + */ @SpringJUnitConfig @SpringBootTest @TestPropertySource("classpath:ddd-layers-test.properties") -class CassandraDbOrderRepositoryIntegrationTest { +class CassandraDbOrderRepositoryLiveTest { @Autowired private SpringDataCassandraOrderRepository cassandraOrderRepository; diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryIntegrationTest.java b/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java similarity index 87% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryIntegrationTest.java rename to ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java index 9a7736c419..3cb3528448 100644 --- a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryIntegrationTest.java +++ b/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java @@ -18,10 +18,15 @@ import com.baeldung.dddhexagonalspring.domain.Product; import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository; import com.baeldung.dddhexagonalspring.infrastracture.repository.mongo.SpringDataMongoOrderRepository; +/* + To run this test we need to run the databases first. + A dedicated docker-compose.yml file is located under the resources directory. + We can run it by simple executing `docker-compose up`. + */ @SpringJUnitConfig @SpringBootTest @TestPropertySource("classpath:ddd-layers-test.properties") -class MongoDbOrderRepositoryIntegrationTest { +class MongoDbOrderRepositoryLiveTest { @Autowired private SpringDataMongoOrderRepository mongoOrderRepository; diff --git a/docker/docker-spring-boot/mvnw b/docker/docker-spring-boot/mvnw new file mode 100755 index 0000000000..a16b5431b4 --- /dev/null +++ b/docker/docker-spring-boot/mvnw @@ -0,0 +1,310 @@ +#!/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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven 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)`" +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 + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + 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 $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + 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 + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +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/docker/docker-spring-boot/mvnw.cmd b/docker/docker-spring-boot/mvnw.cmd new file mode 100644 index 0000000000..c8d43372c9 --- /dev/null +++ b/docker/docker-spring-boot/mvnw.cmd @@ -0,0 +1,182 @@ +@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 https://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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%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/docker/docker-spring-boot/pom.xml b/docker/docker-spring-boot/pom.xml new file mode 100644 index 0000000000..b9c80bc43a --- /dev/null +++ b/docker/docker-spring-boot/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.3.1.RELEASE + + + com.baeldung.docker + spring-boot-docker + 0.0.1-SNAPSHOT + spring-boot-docker + Demo project showing Spring Boot and Docker + + + 8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + true + + + + + + + diff --git a/docker/docker-spring-boot/src/main/docker/Dockerfile b/docker/docker-spring-boot/src/main/docker/Dockerfile new file mode 100644 index 0000000000..fa147dd69b --- /dev/null +++ b/docker/docker-spring-boot/src/main/docker/Dockerfile @@ -0,0 +1,15 @@ +# To build, run the following command from the top level project directory: +# +# docker build -f src/main/docker/Dockerfile . + +FROM adoptopenjdk:11-jre-hotspot as builder +ARG JAR_FILE=target/*.jar +COPY ${JAR_FILE} application.jar +RUN java -Djarmode=layertools -jar application.jar extract + +FROM adoptopenjdk:11-jre-hotspot +COPY --from=builder dependencies/ ./ +COPY --from=builder snapshot-dependencies/ ./ +COPY --from=builder spring-boot-loader/ ./ +COPY --from=builder application/ ./ +ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] \ No newline at end of file diff --git a/docker/docker-spring-boot/src/main/java/com/baeldung/docker/DemoApplication.java b/docker/docker-spring-boot/src/main/java/com/baeldung/docker/DemoApplication.java new file mode 100644 index 0000000000..e0c1d57e89 --- /dev/null +++ b/docker/docker-spring-boot/src/main/java/com/baeldung/docker/DemoApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.docker; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/docker/docker-spring-boot/src/main/java/com/baeldung/docker/HelloController.java b/docker/docker-spring-boot/src/main/java/com/baeldung/docker/HelloController.java new file mode 100644 index 0000000000..b463bb557f --- /dev/null +++ b/docker/docker-spring-boot/src/main/java/com/baeldung/docker/HelloController.java @@ -0,0 +1,16 @@ +package com.baeldung.docker; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/hello") + public ResponseEntity hello() + { + return ResponseEntity.ok("hello2 "); + } + +} diff --git a/docker/docker-spring-boot/src/main/resources/application.properties b/docker/docker-spring-boot/src/main/resources/application.properties new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/docker/docker-spring-boot/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/gradle-5/.gitignore b/gradle-5/.gitignore new file mode 100644 index 0000000000..4ded91f387 --- /dev/null +++ b/gradle-5/.gitignore @@ -0,0 +1,2 @@ +**/build/** +/build/ diff --git a/gradle-5/README.md b/gradle-5/README.md index 7c9aeff07e..e37c100534 100644 --- a/gradle-5/README.md +++ b/gradle-5/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Run a Java main Method Using Gradle](https://www.baeldung.com/gradle-run-java-main) +- [Finding Unused Gradle Dependencies](https://www.baeldung.com/gradle-finding-unused-dependencies) diff --git a/gradle-5/build.gradle b/gradle-5/build.gradle index a728845dff..84cf05bad6 100644 --- a/gradle-5/build.gradle +++ b/gradle-5/build.gradle @@ -1,54 +1,21 @@ -plugins { - id "application" -} -apply plugin :"java" - -description = "Java MainClass execution examples" -group = "com.baeldung" -version = "0.0.1" -sourceCompatibility = "1.8" -targetCompatibility = "1.8" - -ext { - javaMainClass = "com.baeldung.gradle.exec.MainClass" +plugins{ + id "nebula.lint" version "16.9.0" } -jar { - manifest { - attributes( - "Main-Class": javaMainClass - ) +description = "Gradle 5 root project" +allprojects { + apply plugin :"java" + apply plugin :"nebula.lint" + gradleLint { + rules=['unused-dependency'] + reportFormat = 'text' } -} + group = "com.baeldung" + version = "0.0.1" + sourceCompatibility = "1.8" + targetCompatibility = "1.8" -application { - mainClassName = javaMainClass -} - -task runWithJavaExec(type: JavaExec) { - group = "Execution" - description = "Run the main class with JavaExecTask" - classpath = sourceSets.main.runtimeClasspath - main = javaMainClass -} - -task runWithExec(type: Exec) { - dependsOn build - group = "Execution" - description = "Run the main class with ExecTask" - commandLine "java", "-classpath", sourceSets.main.runtimeClasspath.getAsPath(), javaMainClass -} - -task runWithExecJarExecutable(type: Exec) { - dependsOn jar - group = "Execution" - description = "Run the output executable jar with ExecTask" - commandLine "java", "-jar", jar.archiveFile.get() -} - -task runWithExecJarOnClassPath(type: Exec) { - dependsOn jar - group = "Execution" - description = "Run the mainClass from the output jar in classpath with ExecTask" - commandLine "java", "-classpath", jar.archiveFile.get() , javaMainClass + repositories { + jcenter() + } } \ No newline at end of file diff --git a/gradle-5/gradle/wrapper/gradle-wrapper.properties b/gradle-5/gradle/wrapper/gradle-wrapper.properties index b33419deee..4c46317507 100644 --- a/gradle-5/gradle/wrapper/gradle-wrapper.properties +++ b/gradle-5/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip diff --git a/gradle-5/java-exec/.gitignore b/gradle-5/java-exec/.gitignore new file mode 100644 index 0000000000..84c048a73c --- /dev/null +++ b/gradle-5/java-exec/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/gradle-5/java-exec/build.gradle b/gradle-5/java-exec/build.gradle new file mode 100644 index 0000000000..08aa738902 --- /dev/null +++ b/gradle-5/java-exec/build.gradle @@ -0,0 +1,47 @@ +apply plugin: "application" + +description = "Java MainClass execution examples" + +ext { + javaMainClass = "com.baeldung.gradle.exec.MainClass" +} + +jar { + manifest { + attributes( + "Main-Class": javaMainClass + ) + } +} + +application { + mainClassName = javaMainClass +} + +task runWithJavaExec(type: JavaExec) { + group = "Execution" + description = "Run the main class with JavaExecTask" + classpath = sourceSets.main.runtimeClasspath + main = javaMainClass +} + +task runWithExec(type: Exec) { + dependsOn build + group = "Execution" + description = "Run the main class with ExecTask" + commandLine "java", "-classpath", sourceSets.main.runtimeClasspath.getAsPath(), javaMainClass +} + +task runWithExecJarExecutable(type: Exec) { + dependsOn jar + group = "Execution" + description = "Run the output executable jar with ExecTask" + commandLine "java", "-jar", jar.archiveFile.get() +} + +task runWithExecJarOnClassPath(type: Exec) { + dependsOn jar + group = "Execution" + description = "Run the mainClass from the output jar in classpath with ExecTask" + commandLine "java", "-classpath", jar.archiveFile.get() , javaMainClass +} \ No newline at end of file diff --git a/gradle-5/src/main/java/com/baeldung/gradle/exec/MainClass.java b/gradle-5/java-exec/src/main/java/com/baeldung/gradle/exec/MainClass.java similarity index 100% rename from gradle-5/src/main/java/com/baeldung/gradle/exec/MainClass.java rename to gradle-5/java-exec/src/main/java/com/baeldung/gradle/exec/MainClass.java diff --git a/gradle-5/settings.gradle b/gradle-5/settings.gradle new file mode 100644 index 0000000000..1997e12ca5 --- /dev/null +++ b/gradle-5/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name='gradle-5-articles' +include 'java-exec' +include 'unused-dependencies' \ No newline at end of file diff --git a/gradle-5/unused-dependencies/.gitignore b/gradle-5/unused-dependencies/.gitignore new file mode 100644 index 0000000000..84c048a73c --- /dev/null +++ b/gradle-5/unused-dependencies/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/gradle-5/unused-dependencies/build.gradle b/gradle-5/unused-dependencies/build.gradle new file mode 100644 index 0000000000..d848cd0e0d --- /dev/null +++ b/gradle-5/unused-dependencies/build.gradle @@ -0,0 +1,8 @@ + +description = "Gradle Unused Dependencies example" + +dependencies { + implementation('com.google.guava:guava:29.0-jre') + implementation('org.apache.httpcomponents:httpclient:4.5.12') + testImplementation('junit:junit:4.12') +} diff --git a/gradle-5/unused-dependencies/src/main/java/com/baeldung/unused/UnusedDependencies.java b/gradle-5/unused-dependencies/src/main/java/com/baeldung/unused/UnusedDependencies.java new file mode 100644 index 0000000000..c2e221356c --- /dev/null +++ b/gradle-5/unused-dependencies/src/main/java/com/baeldung/unused/UnusedDependencies.java @@ -0,0 +1,39 @@ +package com.baeldung.unused; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.http.ssl.SSLContextBuilder; + +import com.google.common.collect.ImmutableList; + +public class UnusedDependencies { + + public static void main(String[] args) { + System.out.println("Hello world"); + useGuava(); + useHttpCore(); + useHttpClientWithReflection(); + } + + private static void useGuava() { + List list = ImmutableList.of("Baledung", "is", "cool"); + System.out.println(list.stream() + .collect(Collectors.joining(" "))); + } + + private static void useHttpCore() { + SSLContextBuilder.create(); + } + + private static void useHttpClientWithReflection() { + try { + Class httpBuilder = Class.forName("org.apache.http.impl.client.HttpClientBuilder"); + Method create = httpBuilder.getMethod("create", null); + create.invoke(httpBuilder, null); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/guava-2/README.md b/guava-2/README.md new file mode 100644 index 0000000000..32afc10916 --- /dev/null +++ b/guava-2/README.md @@ -0,0 +1,7 @@ +## Guava + +This module contains articles a Google Guava + +### Relevant Articles: + +- [Guava CharMatcher](https://www.baeldung.com/guava-string-charmatcher) diff --git a/guava-2/pom.xml b/guava-2/pom.xml new file mode 100644 index 0000000000..b19f59a9b4 --- /dev/null +++ b/guava-2/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + guava-2 + 0.1.0-SNAPSHOT + guava-2 + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + guava + + + src/main/resources + true + + + + + + + 3.6.1 + + + diff --git a/guava-2/src/test/java/com/baeldung/guava/charmatcher/GuavaCharMatcherUnitTest.java b/guava-2/src/test/java/com/baeldung/guava/charmatcher/GuavaCharMatcherUnitTest.java new file mode 100644 index 0000000000..e60777595e --- /dev/null +++ b/guava-2/src/test/java/com/baeldung/guava/charmatcher/GuavaCharMatcherUnitTest.java @@ -0,0 +1,113 @@ +package com.baeldung.guava.charmatcher; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; + +import org.junit.Test; + +import com.google.common.base.CharMatcher; +import com.google.common.base.Predicate; + +public class GuavaCharMatcherUnitTest { + + @Test + public void whenRemoveSpecialCharacters_thenRemoved() { + final String input = "H*el.lo,}12"; + final CharMatcher matcher = CharMatcher.javaLetterOrDigit(); + final String result = matcher.retainFrom(input); + + assertEquals("Hello12", result); + } + + @Test + public void whenRemoveNonASCIIChars_thenRemoved() { + final String input = "あhello₤"; + + String result = CharMatcher.ascii().retainFrom(input); + assertEquals("hello", result); + + result = CharMatcher.inRange('0', 'z').retainFrom(input); + assertEquals("hello", result); + } + + @Test + public void whenValidateString_thenValid() { + final String input = "hello"; + + boolean result = CharMatcher.javaLowerCase().matchesAllOf(input); + assertTrue(result); + + result = CharMatcher.is('e').matchesAnyOf(input); + assertTrue(result); + + result = CharMatcher.javaDigit().matchesNoneOf(input); + assertTrue(result); + } + + @Test + public void whenTrimString_thenTrimmed() { + final String input = "---hello,,,"; + + String result = CharMatcher.is('-').trimLeadingFrom(input); + assertEquals("hello,,,", result); + + result = CharMatcher.is(',').trimTrailingFrom(input); + assertEquals("---hello", result); + + result = CharMatcher.anyOf("-,").trimFrom(input); + assertEquals("hello", result); + } + + @Test + public void whenCollapseFromString_thenCollapsed() { + final String input = " hel lo "; + + String result = CharMatcher.is(' ').collapseFrom(input, '-'); + assertEquals("-hel-lo-", result); + + result = CharMatcher.is(' ').trimAndCollapseFrom(input, '-'); + assertEquals("hel-lo", result); + } + + @Test + public void whenReplaceFromString_thenReplaced() { + final String input = "apple-banana."; + + String result = CharMatcher.anyOf("-.").replaceFrom(input, '!'); + assertEquals("apple!banana!", result); + + result = CharMatcher.is('-').replaceFrom(input, " and "); + assertEquals("apple and banana.", result); + } + + @Test + public void whenCountCharInString_thenCorrect() { + final String input = "a, c, z, 1, 2"; + + int result = CharMatcher.is(',').countIn(input); + assertEquals(4, result); + + result = CharMatcher.inRange('a', 'h').countIn(input); + assertEquals(2, result); + } + + @Test + public void whenRemoveCharsNotInCharset_thenRemoved() { + final Charset charset = Charset.forName("cp437"); + final CharsetEncoder encoder = charset.newEncoder(); + + final Predicate inRange = new Predicate() { + @Override + public boolean apply(final Character c) { + return encoder.canEncode(c); + } + }; + + final String result = CharMatcher.forPredicate(inRange).retainFrom("helloは"); + assertEquals("hello", result); + } + +} diff --git a/guava/src/test/java/com/baeldung/guava/ThrowablesUnitTest.java b/guava-2/src/test/java/com/baeldung/guava/throwables/ThrowablesUnitTest.java similarity index 97% rename from guava/src/test/java/com/baeldung/guava/ThrowablesUnitTest.java rename to guava-2/src/test/java/com/baeldung/guava/throwables/ThrowablesUnitTest.java index 7d33b38a0e..c1707f8903 100644 --- a/guava/src/test/java/com/baeldung/guava/ThrowablesUnitTest.java +++ b/guava-2/src/test/java/com/baeldung/guava/throwables/ThrowablesUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.guava; +package com.baeldung.guava.throwables; import com.google.common.base.Throwables; import org.junit.Test; diff --git a/guava-2/src/test/resources/.gitignore b/guava-2/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/guava-2/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-2/src/test/resources/test.out b/guava-2/src/test/resources/test.out new file mode 100644 index 0000000000..7a79da3803 --- /dev/null +++ b/guava-2/src/test/resources/test.out @@ -0,0 +1 @@ +John Jane Adam Tom \ No newline at end of file diff --git a/guava-2/src/test/resources/test1.in b/guava-2/src/test/resources/test1.in new file mode 100644 index 0000000000..70c379b63f --- /dev/null +++ b/guava-2/src/test/resources/test1.in @@ -0,0 +1 @@ +Hello world \ No newline at end of file diff --git a/guava-2/src/test/resources/test1_1.in b/guava-2/src/test/resources/test1_1.in new file mode 100644 index 0000000000..8318c86b35 --- /dev/null +++ b/guava-2/src/test/resources/test1_1.in @@ -0,0 +1 @@ +Test \ No newline at end of file diff --git a/guava-2/src/test/resources/test2.in b/guava-2/src/test/resources/test2.in new file mode 100644 index 0000000000..622efea9e6 --- /dev/null +++ b/guava-2/src/test/resources/test2.in @@ -0,0 +1,4 @@ +John +Jane +Adam +Tom \ No newline at end of file diff --git a/guava-2/src/test/resources/test_copy.in b/guava-2/src/test/resources/test_copy.in new file mode 100644 index 0000000000..70c379b63f --- /dev/null +++ b/guava-2/src/test/resources/test_copy.in @@ -0,0 +1 @@ +Hello world \ No newline at end of file diff --git a/guava-2/src/test/resources/test_le.txt b/guava-2/src/test/resources/test_le.txt new file mode 100644 index 0000000000..f7cc484bf4 Binary files /dev/null and b/guava-2/src/test/resources/test_le.txt differ diff --git a/guava-collections-map/pom.xml b/guava-collections-map/pom.xml index 06537d26bd..4a95234d5c 100644 --- a/guava-collections-map/pom.xml +++ b/guava-collections-map/pom.xml @@ -14,6 +14,21 @@ ../parent-java + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + + guava-collections-map @@ -33,21 +48,6 @@ - - - org.junit.jupiter - junit-jupiter - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - - 5.6.2 diff --git a/guava-collections-set/pom.xml b/guava-collections-set/pom.xml index 49d96965a7..af46400555 100644 --- a/guava-collections-set/pom.xml +++ b/guava-collections-set/pom.xml @@ -13,18 +13,6 @@ ../parent-java - - guava-collections-set - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - - - @@ -47,6 +35,18 @@ + + guava-collections-set + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + 3.6.1 diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml index 744eba1a38..238ab60f84 100644 --- a/guava-collections/pom.xml +++ b/guava-collections/pom.xml @@ -15,25 +15,6 @@ ../parent-java - - guava-collections - - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - - - @@ -76,6 +57,25 @@ + + guava-collections + + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + 4.1 diff --git a/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java index 73c4c3291e..d1dd4af3bb 100644 --- a/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java @@ -4,20 +4,19 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import java.nio.charset.Charset; -import java.nio.charset.CharsetEncoder; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; -import com.google.common.collect.*; import org.junit.Test; -import com.google.common.base.CharMatcher; import com.google.common.base.Function; import com.google.common.base.Joiner; -import com.google.common.base.Predicate; import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; public class GuavaStringUnitTest { @@ -113,102 +112,4 @@ public class GuavaStringUnitTest { assertEquals(4, result.size()); assertThat(result, contains("a", "b", "c", "d,e")); } - - @Test - public void whenRemoveSpecialCharacters_thenRemoved() { - final String input = "H*el.lo,}12"; - final CharMatcher matcher = CharMatcher.JAVA_LETTER_OR_DIGIT; - final String result = matcher.retainFrom(input); - - assertEquals("Hello12", result); - } - - @Test - public void whenRemoveNonASCIIChars_thenRemoved() { - final String input = "あhello₤"; - - String result = CharMatcher.ASCII.retainFrom(input); - assertEquals("hello", result); - - result = CharMatcher.inRange('0', 'z').retainFrom(input); - assertEquals("hello", result); - } - - @Test - public void whenValidateString_thenValid() { - final String input = "hello"; - - boolean result = CharMatcher.JAVA_LOWER_CASE.matchesAllOf(input); - assertTrue(result); - - result = CharMatcher.is('e').matchesAnyOf(input); - assertTrue(result); - - result = CharMatcher.JAVA_DIGIT.matchesNoneOf(input); - assertTrue(result); - } - - @Test - public void whenTrimString_thenTrimmed() { - final String input = "---hello,,,"; - - String result = CharMatcher.is('-').trimLeadingFrom(input); - assertEquals("hello,,,", result); - - result = CharMatcher.is(',').trimTrailingFrom(input); - assertEquals("---hello", result); - - result = CharMatcher.anyOf("-,").trimFrom(input); - assertEquals("hello", result); - } - - @Test - public void whenCollapseFromString_thenCollapsed() { - final String input = " hel lo "; - - String result = CharMatcher.is(' ').collapseFrom(input, '-'); - assertEquals("-hel-lo-", result); - - result = CharMatcher.is(' ').trimAndCollapseFrom(input, '-'); - assertEquals("hel-lo", result); - } - - @Test - public void whenReplaceFromString_thenReplaced() { - final String input = "apple-banana."; - - String result = CharMatcher.anyOf("-.").replaceFrom(input, '!'); - assertEquals("apple!banana!", result); - - result = CharMatcher.is('-').replaceFrom(input, " and "); - assertEquals("apple and banana.", result); - } - - @Test - public void whenCountCharInString_thenCorrect() { - final String input = "a, c, z, 1, 2"; - - int result = CharMatcher.is(',').countIn(input); - assertEquals(4, result); - - result = CharMatcher.inRange('a', 'h').countIn(input); - assertEquals(2, result); - } - - @Test - public void whenRemoveCharsNotInCharset_thenRemoved() { - final Charset charset = Charset.forName("cp437"); - final CharsetEncoder encoder = charset.newEncoder(); - - final Predicate inRange = new Predicate() { - @Override - public boolean apply(final Character c) { - return encoder.canEncode(c); - } - }; - - final String result = CharMatcher.forPredicate(inRange).retainFrom("helloは"); - assertEquals("hello", result); - } - } diff --git a/guava-io/pom.xml b/guava-io/pom.xml index fd637f2474..e01f76e2e3 100644 --- a/guava-io/pom.xml +++ b/guava-io/pom.xml @@ -16,6 +16,21 @@ ../parent-java + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + + guava-io @@ -35,18 +50,4 @@ - - - org.junit.jupiter - junit-jupiter - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - \ No newline at end of file diff --git a/guava-modules/pom.xml b/guava-modules/pom.xml index 4e7282364d..d1a2bbc16e 100644 --- a/guava-modules/pom.xml +++ b/guava-modules/pom.xml @@ -22,16 +22,6 @@ guava-21 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - - - org.junit.jupiter @@ -46,4 +36,15 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + diff --git a/guava/README.md b/guava/README.md index 9c650dbc1d..24beca60c3 100644 --- a/guava/README.md +++ b/guava/README.md @@ -3,6 +3,7 @@ This module contains articles a Google Guava ### Relevant Articles: + - [Guava Functional Cookbook](https://www.baeldung.com/guava-functions-predicates) - [Guide to Guava’s PreConditions](https://www.baeldung.com/guava-preconditions) - [Introduction to Guava CacheLoader](https://www.baeldung.com/guava-cacheloader) @@ -12,5 +13,5 @@ This module contains articles a Google Guava - [Guide to Mathematical Utilities in Guava](https://www.baeldung.com/guava-math) - [Bloom Filter in Java using Guava](https://www.baeldung.com/guava-bloom-filter) - [Quick Guide to the Guava RateLimiter](https://www.baeldung.com/guava-rate-limiter) -- [Introduction to Guava Throwables](https://www.baeldung.com/guava-throwables) - [Guava Cache](https://www.baeldung.com/guava-cache) +- [Introduction to Guava Throwables](https://www.baeldung.com/guava-throwables) diff --git a/guava/pom.xml b/guava/pom.xml index 881390ae73..2c4ff07c84 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -15,25 +15,6 @@ ../parent-java - - guava - - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - - - org.apache.commons @@ -62,6 +43,25 @@ + + guava + + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + 5.6.2 diff --git a/image-processing/README.md b/image-processing/README.md index 50129bb994..eba23f83eb 100644 --- a/image-processing/README.md +++ b/image-processing/README.md @@ -6,3 +6,5 @@ This module contains articles about image processing. - [Working with Images in Java](https://www.baeldung.com/java-images) - [Intro to OpenCV with Java](https://www.baeldung.com/java-opencv) - [Optical Character Recognition with Tesseract](https://www.baeldung.com/java-ocr-tesseract) +- [How Can I Resize an Image Using Java?](https://www.baeldung.com/java-resize-image) +- [Adding Text to an Image in Java](https://www.baeldung.com/java-add-text-to-image) diff --git a/image-processing/pom.xml b/image-processing/pom.xml index 806cccf351..f2551598d5 100644 --- a/image-processing/pom.xml +++ b/image-processing/pom.xml @@ -38,7 +38,7 @@ org.openpnp opencv - 3.4.2-0 + ${opencv.version} com.twelvemonkeys.imageio @@ -60,6 +60,27 @@ tesseract-platform ${tesseract-platform.version} + + org.imgscalr + imgscalr-lib + ${imgscalr-version} + + + net.coobird + thumbnailator + ${thumbnailator-version} + + + com.github.downgoon + marvin + ${marvin-version} + pom + + + com.github.downgoon + MarvinPlugins + ${marvin-version} + @@ -68,6 +89,10 @@ 3.3.2 4.5.1 4.1.0-1.5.2 + 3.4.2-0 + 4.2 + 0.4.11 + 1.5.5 \ No newline at end of file diff --git a/image-processing/src/main/java/com/baeldung/image/resize/core/Graphics2DExample.java b/image-processing/src/main/java/com/baeldung/image/resize/core/Graphics2DExample.java new file mode 100644 index 0000000000..d52a2dac1b --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/image/resize/core/Graphics2DExample.java @@ -0,0 +1,25 @@ +package com.baeldung.image.resize.core; + +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +public class Graphics2DExample { + + static BufferedImage resizeImage(BufferedImage originalImage, int targetWidth, int targetHeight) { + BufferedImage resizedImage = new BufferedImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_RGB); + Graphics2D graphics2D = resizedImage.createGraphics(); + graphics2D.drawImage(originalImage, 0, 0, targetWidth, targetHeight, null); + graphics2D.dispose(); + return resizedImage; + } + + public static void main(String[] args) throws IOException { + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = resizeImage(originalImage, 200, 200); + ImageIO.write(outputImage, "jpg", new File("src/main/resources/images/sampleImage-resized-graphics2d.jpg")); + } +} diff --git a/image-processing/src/main/java/com/baeldung/image/resize/core/ImageScaledInstanceExample.java b/image-processing/src/main/java/com/baeldung/image/resize/core/ImageScaledInstanceExample.java new file mode 100644 index 0000000000..a6e252f3eb --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/image/resize/core/ImageScaledInstanceExample.java @@ -0,0 +1,24 @@ +package com.baeldung.image.resize.core; + +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +public class ImageScaledInstanceExample { + static BufferedImage resizeImage(BufferedImage originalImage, int targetWidth, int targetHeight) { + Image resultingImage = originalImage.getScaledInstance(targetWidth, targetHeight, Image.SCALE_DEFAULT); + BufferedImage bufferedImage = new BufferedImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_RGB); + bufferedImage.getGraphics() + .drawImage(resultingImage, 0, 0, null); + return bufferedImage; + } + + public static void main(String[] args) throws IOException { + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = resizeImage(originalImage, 200, 200); + ImageIO.write(outputImage, "jpg", new File("src/main/resources/images/sampleImage-resized-scaledinstance.jpg")); + } +} diff --git a/image-processing/src/main/java/com/baeldung/image/resize/imgscalr/ImgscalrExample.java b/image-processing/src/main/java/com/baeldung/image/resize/imgscalr/ImgscalrExample.java new file mode 100644 index 0000000000..10d4217de6 --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/image/resize/imgscalr/ImgscalrExample.java @@ -0,0 +1,24 @@ +package com.baeldung.image.resize.imgscalr; + +import java.awt.image.BufferedImage; +import java.io.File; + +import javax.imageio.ImageIO; + +import org.imgscalr.Scalr; + +public class ImgscalrExample { + public static BufferedImage simpleResizeImage(BufferedImage originalImage, int targetWidth) { + return Scalr.resize(originalImage, targetWidth); + } + + public static BufferedImage resizeImage(BufferedImage originalImage, int targetWidth, int targetHeight) { + return Scalr.resize(originalImage, Scalr.Method.AUTOMATIC, Scalr.Mode.AUTOMATIC, targetWidth, targetHeight, Scalr.OP_ANTIALIAS); + } + + public static void main(String[] args) throws Exception { + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = resizeImage(originalImage, 200, 200); + ImageIO.write(outputImage, "jpg", new File("src/main/resources/images/sampleImage-resized-imgscalr.jpg")); + } +} diff --git a/image-processing/src/main/java/com/baeldung/image/resize/marvin/MarvinExample.java b/image-processing/src/main/java/com/baeldung/image/resize/marvin/MarvinExample.java new file mode 100644 index 0000000000..9a7233c4f4 --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/image/resize/marvin/MarvinExample.java @@ -0,0 +1,29 @@ +package com.baeldung.image.resize.marvin; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.marvinproject.image.transform.scale.Scale; + +import marvin.image.MarvinImage; + +public class MarvinExample { + static BufferedImage resizeImage(BufferedImage originalImage, int targetWidth, int targetHeight) { + MarvinImage image = new MarvinImage(originalImage); + Scale scale = new Scale(); + scale.load(); + scale.setAttribute("newWidth", targetWidth); + scale.setAttribute("newHeight", targetHeight); + scale.process(image.clone(), image, null, null, false); + return image.getBufferedImageNoAlpha(); + } + + public static void main(String args[]) throws IOException { + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = resizeImage(originalImage, 200, 200); + ImageIO.write(outputImage, "jpg", new File("src/main/resources/images/sampleImage-resized-marvin.jpg")); + } +} diff --git a/image-processing/src/main/java/com/baeldung/image/resize/thumbnailator/ThumbnailatorExample.java b/image-processing/src/main/java/com/baeldung/image/resize/thumbnailator/ThumbnailatorExample.java new file mode 100644 index 0000000000..2296c1649d --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/image/resize/thumbnailator/ThumbnailatorExample.java @@ -0,0 +1,31 @@ +package com.baeldung.image.resize.thumbnailator; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import net.coobird.thumbnailator.Thumbnails; + +public class ThumbnailatorExample { + static BufferedImage resizeImage(BufferedImage originalImage, int targetWidth, int targetHeight) throws IOException { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + Thumbnails.of(originalImage) + .size(targetWidth, targetHeight) + .outputFormat("JPEG") + .outputQuality(0.90) + .toOutputStream(outputStream); + byte[] data = outputStream.toByteArray(); + ByteArrayInputStream inputStream = new ByteArrayInputStream(data); + return ImageIO.read(inputStream); + } + + public static void main(String[] args) throws Exception { + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = resizeImage(originalImage, 200, 200); + ImageIO.write(outputImage, "jpg", new File("src/main/resources/images/sampleImage-resized-thumbnailator.jpg")); + } +} diff --git a/image-processing/src/main/java/com/baeldung/imageprocessing/addingtext/AddText.java b/image-processing/src/main/java/com/baeldung/imageprocessing/addingtext/AddText.java new file mode 100644 index 0000000000..a19dd95af1 --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/imageprocessing/addingtext/AddText.java @@ -0,0 +1,220 @@ +package com.baeldung.imageprocessing.addingtext; + +import ij.IJ; +import ij.ImagePlus; +import ij.process.ImageProcessor; + +import java.awt.*; +import java.awt.font.GlyphVector; +import java.awt.font.TextAttribute; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.text.AttributedString; + +import javax.imageio.ImageIO; + +public class AddText { + public static void main(String[] args) throws IOException { + String imagePath = AddText.class.getClassLoader().getResource("lena.jpg").getPath(); + + ImagePlus resultPlus= signImageImageProcessor("www.baeldung.com", imagePath); + resultPlus.show(); + + ImagePlus resultGraphics = new ImagePlus("", signImageGraphics("www.baeldung.com", imagePath)); + resultGraphics.show(); + + ImagePlus resultGraphicsWithIterator = new ImagePlus("", signImageGraphicsWithIterator("www.baeldung.com", imagePath)); + resultGraphicsWithIterator.show(); + + ImagePlus resultGraphicsCentered = new ImagePlus("", signImageCenter("www.baeldung.com", imagePath)); + resultGraphicsCentered.show(); + + ImagePlus resultGraphicsBottomRight = new ImagePlus("", signImageBottomRight("www.baeldung.com", imagePath)); + resultGraphicsBottomRight.show(); + + ImagePlus resultGraphicsTopLeft= new ImagePlus("", signImageTopLeft("www.baeldung.com", imagePath)); + resultGraphicsTopLeft.show(); + + ImagePlus resultGraphicsAdaptBasedOnImage= new ImagePlus("", signImageAdaptBasedOnImage("www.baeldung.com", imagePath)); + resultGraphicsAdaptBasedOnImage.show(); + } + + private static ImagePlus signImageImageProcessor(String text, String path) { + ImagePlus image = IJ.openImage(path); + Font font = new Font("Arial", Font.BOLD, 18); + + ImageProcessor ip = image.getProcessor(); + ip.setColor(Color.GREEN); + ip.setFont(font); + ip.drawString(text, 0, 20); + + return image; + } + + private static BufferedImage signImageGraphics(String text, String path) throws IOException { + BufferedImage image = ImageIO.read(new File(path)); + Font font = new Font("Arial", Font.BOLD, 18); + + Graphics g = image.getGraphics(); + g.setFont(font); + g.setColor(Color.GREEN); + g.drawString(text, 0, 20); + + return image; + } + + + private static BufferedImage signImageGraphicsWithIterator(String text, String path) throws IOException { + BufferedImage image = ImageIO.read(new File(path)); + Font font = new Font("Arial", Font.BOLD, 18); + + AttributedString attributedText = new AttributedString(text); + attributedText.addAttribute(TextAttribute.FONT, font); + attributedText.addAttribute(TextAttribute.FOREGROUND, Color.GREEN); + + Graphics g = image.getGraphics(); + g.drawString(attributedText.getIterator(), 0, 20); + + return image; + } + + /** + * Draw a String centered in the middle of a Rectangle. + * + * @param g The Graphics instance. + * @param text The String to draw. + * @param rect The Rectangle to center the text in. + * @throws IOException + */ + public static BufferedImage signImageCenter(String text, String path) throws IOException { + + BufferedImage image = ImageIO.read(new File(path)); + Font font = new Font("Arial", Font.BOLD, 18); + + AttributedString attributedText = new AttributedString(text); + attributedText.addAttribute(TextAttribute.FONT, font); + attributedText.addAttribute(TextAttribute.FOREGROUND, Color.GREEN); + + Graphics g = image.getGraphics(); + + FontMetrics metrics = g.getFontMetrics(font); + int positionX = (image.getWidth() - metrics.stringWidth(text)) / 2; + int positionY = (image.getHeight() - metrics.getHeight()) / 2 + metrics.getAscent(); + + g.drawString(attributedText.getIterator(), positionX, positionY); + + return image; + } + + /** + * Draw a String centered in the middle of a Rectangle. + * + * @param g The Graphics instance. + * @param text The String to draw. + * @param rect The Rectangle to center the text in. + * @throws IOException + */ + public static BufferedImage signImageBottomRight(String text, String path) throws IOException { + + BufferedImage image = ImageIO.read(new File(path)); + + Font font = new Font("Arial", Font.BOLD, 18); + + AttributedString attributedText = new AttributedString(text); + attributedText.addAttribute(TextAttribute.FONT, font); + attributedText.addAttribute(TextAttribute.FOREGROUND, Color.GREEN); + + Graphics g = image.getGraphics(); + + FontMetrics metrics = g.getFontMetrics(font); + int positionX = (image.getWidth() - metrics.stringWidth(text)); + int positionY = (image.getHeight() - metrics.getHeight()) + metrics.getAscent(); + + g.drawString(attributedText.getIterator(), positionX, positionY); + + return image; + } + + /** + * Draw a String centered in the middle of a Rectangle. + * + * @param g The Graphics instance. + * @param text The String to draw. + * @param rect The Rectangle to center the text in. + * @throws IOException + */ + public static BufferedImage signImageTopLeft(String text, String path) throws IOException { + + BufferedImage image = ImageIO.read(new File(path)); + + Font font = new Font("Arial", Font.BOLD, 18); + + AttributedString attributedText = new AttributedString(text); + attributedText.addAttribute(TextAttribute.FONT, font); + attributedText.addAttribute(TextAttribute.FOREGROUND, Color.GREEN); + + Graphics g = image.getGraphics(); + + FontMetrics metrics = g.getFontMetrics(font); + int positionX = 0; + int positionY = metrics.getAscent(); + + g.drawString(attributedText.getIterator(), positionX, positionY); + + return image; + } + + /** + * Draw a String centered in the middle of a Rectangle. + * + * @param g The Graphics instance. + * @param text The String to draw. + * @param rect The Rectangle to center the text in. + * @throws IOException + */ + public static BufferedImage signImageAdaptBasedOnImage(String text, String path) throws IOException { + + BufferedImage image = ImageIO.read(new File(path)); + + Font font = createFontToFit(new Font("Arial", Font.BOLD, 80), text, image); + + AttributedString attributedText = new AttributedString(text); + attributedText.addAttribute(TextAttribute.FONT, font); + attributedText.addAttribute(TextAttribute.FOREGROUND, Color.GREEN); + + Graphics g = image.getGraphics(); + + FontMetrics metrics = g.getFontMetrics(font); + int positionX = (image.getWidth() - metrics.stringWidth(text)); + int positionY = (image.getHeight() - metrics.getHeight()) + metrics.getAscent(); + + g.drawString(attributedText.getIterator(), positionX, positionY); + + return image; + } + + public static Font createFontToFit(Font baseFont, String text, BufferedImage image) throws IOException + { + Font newFont = baseFont; + + FontMetrics ruler = image.getGraphics().getFontMetrics(baseFont); + GlyphVector vector = baseFont.createGlyphVector(ruler.getFontRenderContext(), text); + + Shape outline = vector.getOutline(0, 0); + + double expectedWidth = outline.getBounds().getWidth(); + double expectedHeight = outline.getBounds().getHeight(); + + boolean textFits = image.getWidth() >= expectedWidth && image.getHeight() >= expectedHeight; + + if(!textFits) { + double widthBasedFontSize = (baseFont.getSize2D()*image.getWidth())/expectedWidth; + double heightBasedFontSize = (baseFont.getSize2D()*image.getHeight())/expectedHeight; + + double newFontSize = widthBasedFontSize < heightBasedFontSize ? widthBasedFontSize : heightBasedFontSize; + newFont = baseFont.deriveFont(baseFont.getStyle(), (float)newFontSize); + } + return newFont; + } +} diff --git a/image-processing/src/test/java/com/baeldung/image/resize/core/Graphics2DExampleUnitTest.java b/image-processing/src/test/java/com/baeldung/image/resize/core/Graphics2DExampleUnitTest.java new file mode 100644 index 0000000000..675a17366d --- /dev/null +++ b/image-processing/src/test/java/com/baeldung/image/resize/core/Graphics2DExampleUnitTest.java @@ -0,0 +1,71 @@ +package com.baeldung.image.resize.core; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.junit.Test; + +public class Graphics2DExampleUnitTest { + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenImageGeneratedWithoutError() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = Graphics2DExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenOutputImageSizeIsValid() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + assertNotEquals(originalImage.getWidth(), targetWidth); + assertNotEquals(originalImage.getHeight(), targetHeight); + BufferedImage outputImage = Graphics2DExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertEquals(outputImage.getWidth(), targetWidth); + assertEquals(outputImage.getHeight(), targetHeight); + } + + @Test(expected = Exception.class) + public void whenTargetWidthIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 0; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = Graphics2DExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenTargetHeightIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 200; + int targetHeight = 0; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = Graphics2DExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenOriginalImageDoesNotExist_thenErrorIsNotThrownAndImageIsGenerated() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage outputImage = Graphics2DExample.resizeImage(null, targetWidth, targetHeight); + + assertNotNull(outputImage); + assertEquals(outputImage.getWidth(), targetWidth); + assertEquals(outputImage.getHeight(), targetHeight); + } +} diff --git a/image-processing/src/test/java/com/baeldung/image/resize/core/ImageScaledInstanceExampleUnitTest.java b/image-processing/src/test/java/com/baeldung/image/resize/core/ImageScaledInstanceExampleUnitTest.java new file mode 100644 index 0000000000..b0ac5a7787 --- /dev/null +++ b/image-processing/src/test/java/com/baeldung/image/resize/core/ImageScaledInstanceExampleUnitTest.java @@ -0,0 +1,69 @@ +package com.baeldung.image.resize.core; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.junit.Test; + +public class ImageScaledInstanceExampleUnitTest { + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenImageGeneratedWithoutError() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ImageScaledInstanceExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenOutputImageSizeIsValid() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + assertNotEquals(originalImage.getWidth(), targetWidth); + assertNotEquals(originalImage.getHeight(), targetHeight); + BufferedImage outputImage = ImageScaledInstanceExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertEquals(outputImage.getWidth(), targetWidth); + assertEquals(outputImage.getHeight(), targetHeight); + } + + @Test(expected = Exception.class) + public void whenTargetWidthIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 0; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ImageScaledInstanceExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenTargetHeightIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 200; + int targetHeight = 0; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ImageScaledInstanceExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenOriginalImageDoesNotExist_thenErrorIsThrown() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage outputImage = ImageScaledInstanceExample.resizeImage(null, targetWidth, targetHeight); + + assertNull(outputImage); + } +} diff --git a/image-processing/src/test/java/com/baeldung/image/resize/imgscalr/ImgscalrExampleUnitTest.java b/image-processing/src/test/java/com/baeldung/image/resize/imgscalr/ImgscalrExampleUnitTest.java new file mode 100644 index 0000000000..e38850da21 --- /dev/null +++ b/image-processing/src/test/java/com/baeldung/image/resize/imgscalr/ImgscalrExampleUnitTest.java @@ -0,0 +1,69 @@ +package com.baeldung.image.resize.imgscalr; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.junit.Test; + +public class ImgscalrExampleUnitTest { + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenImageGeneratedWithoutError() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ImgscalrExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenOutputImageSizeIsValid() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + assertNotEquals(originalImage.getWidth(), targetWidth); + assertNotEquals(originalImage.getHeight(), targetHeight); + BufferedImage outputImage = ImgscalrExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertEquals(outputImage.getWidth(), targetWidth); + assertEquals(outputImage.getHeight(), targetHeight); + } + + @Test(expected = Test.None.class) + public void whenTargetWidthIsZero_thenImageIsCreated() throws IOException { + int targetWidth = 0; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ImgscalrExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenTargetHeightIsZero_thenImageIsCreated() throws IOException { + int targetWidth = 200; + int targetHeight = 0; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ImgscalrExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenOriginalImageDoesNotExist_thenErrorIsThrown() { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage outputImage = ImgscalrExample.resizeImage(null, targetWidth, targetHeight); + + assertNull(outputImage); + } +} diff --git a/image-processing/src/test/java/com/baeldung/image/resize/marvin/MarvinExampleUnitTest.java b/image-processing/src/test/java/com/baeldung/image/resize/marvin/MarvinExampleUnitTest.java new file mode 100644 index 0000000000..3133a71035 --- /dev/null +++ b/image-processing/src/test/java/com/baeldung/image/resize/marvin/MarvinExampleUnitTest.java @@ -0,0 +1,68 @@ +package com.baeldung.image.resize.marvin; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.junit.Test; + +public class MarvinExampleUnitTest { + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenImageGeneratedWithoutError() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = MarvinExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenOutputImageSizeIsValid() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + assertNotEquals(originalImage.getWidth(), targetWidth); + assertNotEquals(originalImage.getHeight(), targetHeight); + BufferedImage outputImage = MarvinExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertEquals(outputImage.getWidth(), targetWidth); + assertEquals(outputImage.getHeight(), targetHeight); + } + + @Test(expected = Exception.class) + public void whenTargetWidthIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 0; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = MarvinExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenTargetHeightIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 200; + int targetHeight = 0; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = MarvinExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenOriginalImageDoesNotExist_thenErrorIsThrown() { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage outputImage = MarvinExample.resizeImage(null, targetWidth, targetHeight); + + assertNull(outputImage); + } +} diff --git a/image-processing/src/test/java/com/baeldung/image/resize/thumbnailator/ThumbnailatorExampleUnitTest.java b/image-processing/src/test/java/com/baeldung/image/resize/thumbnailator/ThumbnailatorExampleUnitTest.java new file mode 100644 index 0000000000..383ac1c7af --- /dev/null +++ b/image-processing/src/test/java/com/baeldung/image/resize/thumbnailator/ThumbnailatorExampleUnitTest.java @@ -0,0 +1,68 @@ +package com.baeldung.image.resize.thumbnailator; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.junit.Test; + +public class ThumbnailatorExampleUnitTest { + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenImageGeneratedWithoutError() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ThumbnailatorExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNotNull(outputImage); + } + + @Test(expected = Test.None.class) + public void whenOriginalImageExistsAndTargetSizesAreNotZero_thenOutputImageSizeIsValid() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + assertNotEquals(originalImage.getWidth(), targetWidth); + assertNotEquals(originalImage.getHeight(), targetHeight); + BufferedImage outputImage = ThumbnailatorExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertEquals(outputImage.getWidth(), targetWidth); + assertEquals(outputImage.getHeight(), targetHeight); + } + + @Test(expected = Exception.class) + public void whenTargetWidthIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 0; + int targetHeight = 200; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ThumbnailatorExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenTargetHeightIsZero_thenErrorIsThrown() throws IOException { + int targetWidth = 200; + int targetHeight = 0; + BufferedImage originalImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg")); + BufferedImage outputImage = ThumbnailatorExample.resizeImage(originalImage, targetWidth, targetHeight); + + assertNull(outputImage); + } + + @Test(expected = Exception.class) + public void whenOriginalImageDoesNotExist_thenErrorIsThrown() throws IOException { + int targetWidth = 200; + int targetHeight = 200; + BufferedImage outputImage = ThumbnailatorExample.resizeImage(null, targetWidth, targetHeight); + + assertNull(outputImage); + } +} diff --git a/intelliJ/intelliJ-formatter.xml b/intelliJ/intelliJ-formatter.xml index 9b1d12a3be..6e4c927da8 100644 --- a/intelliJ/intelliJ-formatter.xml +++ b/intelliJ/intelliJ-formatter.xml @@ -30,12 +30,9 @@

This class extends {@link Number}, but does not define + * methods such as {@code equals}, {@code hashCode} and {@code + * compareTo} because instances are expected to be mutated, and so are + * not useful as collection keys. + * + * @since 1.8 + * @author Doug Lea + */ +public class LongAdder extends Striped64 implements Serializable { + private static final long serialVersionUID = 7249069246863182397L; + + /** + * Creates a new adder with initial sum of zero. + */ + public LongAdder() { + } + + /** + * Adds the given value. + * + * @param x the value to add + */ + public void add(long x) { + Cell[] as; long b, v; int m; Cell a; + if ((as = cells) != null || !casBase(b = base, b + x)) { + boolean uncontended = true; + if (as == null || (m = as.length - 1) < 0 || + (a = as[getProbe() & m]) == null || + !(uncontended = a.cas(v = a.value, v + x))) + longAccumulate(x, null, uncontended); + } + } + + /** + * Equivalent to {@code add(1)}. + */ + public void increment() { + add(1L); + } + + /** + * Equivalent to {@code add(-1)}. + */ + public void decrement() { + add(-1L); + } + + /** + * Returns the current sum. The returned value is NOT an + * atomic snapshot; invocation in the absence of concurrent + * updates returns an accurate result, but concurrent updates that + * occur while the sum is being calculated might not be + * incorporated. + * + * @return the sum + */ + public long sum() { + Cell[] as = cells; Cell a; + long sum = base; + if (as != null) { + for (int i = 0; i < as.length; ++i) { + if ((a = as[i]) != null) + sum += a.value; + } + } + return sum; + } + + /** + * Resets variables maintaining the sum to zero. This method may + * be a useful alternative to creating a new adder, but is only + * effective if there are no concurrent updates. Because this + * method is intrinsically racy, it should only be used when it is + * known that no threads are concurrently updating. + */ + public void reset() { + Cell[] as = cells; Cell a; + base = 0L; + if (as != null) { + for (int i = 0; i < as.length; ++i) { + if ((a = as[i]) != null) + a.value = 0L; + } + } + } + + /** + * Equivalent in effect to {@link #sum} followed by {@link + * #reset}. This method may apply for example during quiescent + * points between multithreaded computations. If there are + * updates concurrent with this method, the returned value is + * not guaranteed to be the final value occurring before + * the reset. + * + * @return the sum + */ + public long sumThenReset() { + Cell[] as = cells; Cell a; + long sum = base; + base = 0L; + if (as != null) { + for (int i = 0; i < as.length; ++i) { + if ((a = as[i]) != null) { + sum += a.value; + a.value = 0L; + } + } + } + return sum; + } + + /** + * Returns the String representation of the {@link #sum}. + * @return the String representation of the {@link #sum} + */ + public String toString() { + return Long.toString(sum()); + } + + /** + * Equivalent to {@link #sum}. + * + * @return the sum + */ + public long longValue() { + return sum(); + } + + /** + * Returns the {@link #sum} as an {@code int} after a narrowing + * primitive conversion. + */ + public int intValue() { + return (int)sum(); + } + + /** + * Returns the {@link #sum} as a {@code float} + * after a widening primitive conversion. + */ + public float floatValue() { + return (float)sum(); + } + + /** + * Returns the {@link #sum} as a {@code double} after a widening + * primitive conversion. + */ + public double doubleValue() { + return (double)sum(); + } + + /** + * Serialization proxy, used to avoid reference to the non-public + * Striped64 superclass in serialized forms. + * @serial include + */ + private static class SerializationProxy implements Serializable { + private static final long serialVersionUID = 7249069246863182397L; + + /** + * The current value returned by sum(). + * @serial + */ + private final long value; + + SerializationProxy(LongAdder a) { + value = a.sum(); + } + + /** + * Return a {@code LongAdder} object with initial state + * held by this proxy. + * + * @return a {@code LongAdder} object with initial state + * held by this proxy. + */ + private Object readResolve() { + LongAdder a = new LongAdder(); + a.base = value; + return a; + } + } + + /** + * Returns a + * + * SerializationProxy + * representing the state of this instance. + * + * @return a {@link SerializationProxy} + * representing the state of this instance + */ + private Object writeReplace() { + return new SerializationProxy(this); + } + + /** + * @param s the stream + * @throws java.io.InvalidObjectException always + */ + private void readObject(java.io.ObjectInputStream s) + throws java.io.InvalidObjectException { + throw new java.io.InvalidObjectException("Proxy required"); + } + +} diff --git a/jmh/src/main/java/com/baeldung/falsesharing/Striped64.java b/jmh/src/main/java/com/baeldung/falsesharing/Striped64.java new file mode 100644 index 0000000000..71c34a9de3 --- /dev/null +++ b/jmh/src/main/java/com/baeldung/falsesharing/Striped64.java @@ -0,0 +1,395 @@ +package com.baeldung.falsesharing; + +import sun.misc.Unsafe; + +import java.lang.reflect.Field; +import java.util.function.LongBinaryOperator; +import java.util.function.DoubleBinaryOperator; +import java.util.concurrent.ThreadLocalRandom; + +/** + * Copy-pasted from {@code java.util.concurrent.atomic.Striped64} class. + * + * A package-local class holding common representation and mechanics + * for classes supporting dynamic striping on 64bit values. The class + * extends Number so that concrete subclasses must publicly do so. + */ +@SuppressWarnings("serial") +abstract class Striped64 extends Number { + /* + * This class maintains a lazily-initialized table of atomically + * updated variables, plus an extra "base" field. The table size + * is a power of two. Indexing uses masked per-thread hash codes. + * Nearly all declarations in this class are package-private, + * accessed directly by subclasses. + * + * Table entries are of class Cell; a variant of AtomicLong padded + * (via @sun.misc.Contended) to reduce cache contention. Padding + * is overkill for most Atomics because they are usually + * irregularly scattered in memory and thus don't interfere much + * with each other. But Atomic objects residing in arrays will + * tend to be placed adjacent to each other, and so will most + * often share cache lines (with a huge negative performance + * impact) without this precaution. + * + * In part because Cells are relatively large, we avoid creating + * them until they are needed. When there is no contention, all + * updates are made to the base field. Upon first contention (a + * failed CAS on base update), the table is initialized to size 2. + * The table size is doubled upon further contention until + * reaching the nearest power of two greater than or equal to the + * number of CPUS. Table slots remain empty (null) until they are + * needed. + * + * A single spinlock ("cellsBusy") is used for initializing and + * resizing the table, as well as populating slots with new Cells. + * There is no need for a blocking lock; when the lock is not + * available, threads try other slots (or the base). During these + * retries, there is increased contention and reduced locality, + * which is still better than alternatives. + * + * The Thread probe fields maintained via ThreadLocalRandom serve + * as per-thread hash codes. We let them remain uninitialized as + * zero (if they come in this way) until they contend at slot + * 0. They are then initialized to values that typically do not + * often conflict with others. Contention and/or table collisions + * are indicated by failed CASes when performing an update + * operation. Upon a collision, if the table size is less than + * the capacity, it is doubled in size unless some other thread + * holds the lock. If a hashed slot is empty, and lock is + * available, a new Cell is created. Otherwise, if the slot + * exists, a CAS is tried. Retries proceed by "double hashing", + * using a secondary hash (Marsaglia XorShift) to try to find a + * free slot. + * + * The table size is capped because, when there are more threads + * than CPUs, supposing that each thread were bound to a CPU, + * there would exist a perfect hash function mapping threads to + * slots that eliminates collisions. When we reach capacity, we + * search for this mapping by randomly varying the hash codes of + * colliding threads. Because search is random, and collisions + * only become known via CAS failures, convergence can be slow, + * and because threads are typically not bound to CPUS forever, + * may not occur at all. However, despite these limitations, + * observed contention rates are typically low in these cases. + * + * It is possible for a Cell to become unused when threads that + * once hashed to it terminate, as well as in the case where + * doubling the table causes no thread to hash to it under + * expanded mask. We do not try to detect or remove such cells, + * under the assumption that for long-running instances, observed + * contention levels will recur, so the cells will eventually be + * needed again; and for short-lived ones, it does not matter. + */ + + /** + * Padded variant of AtomicLong supporting only raw accesses plus CAS. + * + * JVM intrinsics note: It would be possible to use a release-only + * form of CAS here, if it were provided. + */ + @sun.misc.Contended static final class Cell { + volatile long value; + Cell(long x) { value = x; } + final boolean cas(long cmp, long val) { + return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); + } + + // Unsafe mechanics + private static final sun.misc.Unsafe UNSAFE; + private static final long valueOffset; + static { + try { + UNSAFE = getUnsafe(); + Class ak = Striped64.Cell.class; + valueOffset = UNSAFE.objectFieldOffset + (ak.getDeclaredField("value")); + } catch (Exception e) { + throw new Error(e); + } + } + } + + /** Number of CPUS, to place bound on table size */ + static final int NCPU = Runtime.getRuntime().availableProcessors(); + + /** + * Table of cells. When non-null, size is a power of 2. + */ + transient volatile Striped64.Cell[] cells; + + /** + * Base value, used mainly when there is no contention, but also as + * a fallback during table initialization races. Updated via CAS. + */ + transient volatile long base; + + /** + * Spinlock (locked via CAS) used when resizing and/or creating Cells. + */ + transient volatile int cellsBusy; + + /** + * Package-private default constructor + */ + Striped64() { + } + + /** + * CASes the base field. + */ + final boolean casBase(long cmp, long val) { + return UNSAFE.compareAndSwapLong(this, BASE, cmp, val); + } + + /** + * CASes the cellsBusy field from 0 to 1 to acquire lock. + */ + final boolean casCellsBusy() { + return UNSAFE.compareAndSwapInt(this, CELLSBUSY, 0, 1); + } + + /** + * Returns the probe value for the current thread. + * Duplicated from ThreadLocalRandom because of packaging restrictions. + */ + static final int getProbe() { + return UNSAFE.getInt(Thread.currentThread(), PROBE); + } + + /** + * Pseudo-randomly advances and records the given probe value for the + * given thread. + * Duplicated from ThreadLocalRandom because of packaging restrictions. + */ + static final int advanceProbe(int probe) { + probe ^= probe << 13; // xorshift + probe ^= probe >>> 17; + probe ^= probe << 5; + UNSAFE.putInt(Thread.currentThread(), PROBE, probe); + return probe; + } + + /** + * Handles cases of updates involving initialization, resizing, + * creating new Cells, and/or contention. See above for + * explanation. This method suffers the usual non-modularity + * problems of optimistic retry code, relying on rechecked sets of + * reads. + * + * @param x the value + * @param fn the update function, or null for add (this convention + * avoids the need for an extra field or function in LongAdder). + * @param wasUncontended false if CAS failed before call + */ + final void longAccumulate(long x, LongBinaryOperator fn, + boolean wasUncontended) { + int h; + if ((h = getProbe()) == 0) { + ThreadLocalRandom.current(); // force initialization + h = getProbe(); + wasUncontended = true; + } + boolean collide = false; // True if last slot nonempty + for (;;) { + Striped64.Cell[] as; Striped64.Cell a; int n; long v; + if ((as = cells) != null && (n = as.length) > 0) { + if ((a = as[(n - 1) & h]) == null) { + if (cellsBusy == 0) { // Try to attach new Cell + Striped64.Cell r = new Striped64.Cell(x); // Optimistically create + if (cellsBusy == 0 && casCellsBusy()) { + boolean created = false; + try { // Recheck under lock + Striped64.Cell[] rs; int m, j; + if ((rs = cells) != null && + (m = rs.length) > 0 && + rs[j = (m - 1) & h] == null) { + rs[j] = r; + created = true; + } + } finally { + cellsBusy = 0; + } + if (created) + break; + continue; // Slot is now non-empty + } + } + collide = false; + } + else if (!wasUncontended) // CAS already known to fail + wasUncontended = true; // Continue after rehash + else if (a.cas(v = a.value, ((fn == null) ? v + x : + fn.applyAsLong(v, x)))) + break; + else if (n >= NCPU || cells != as) + collide = false; // At max size or stale + else if (!collide) + collide = true; + else if (cellsBusy == 0 && casCellsBusy()) { + try { + if (cells == as) { // Expand table unless stale + Striped64.Cell[] rs = new Striped64.Cell[n << 1]; + for (int i = 0; i < n; ++i) + rs[i] = as[i]; + cells = rs; + } + } finally { + cellsBusy = 0; + } + collide = false; + continue; // Retry with expanded table + } + h = advanceProbe(h); + } + else if (cellsBusy == 0 && cells == as && casCellsBusy()) { + boolean init = false; + try { // Initialize table + if (cells == as) { + Striped64.Cell[] rs = new Striped64.Cell[2]; + rs[h & 1] = new Striped64.Cell(x); + cells = rs; + init = true; + } + } finally { + cellsBusy = 0; + } + if (init) + break; + } + else if (casBase(v = base, ((fn == null) ? v + x : + fn.applyAsLong(v, x)))) + break; // Fall back on using base + } + } + + /** + * Same as longAccumulate, but injecting long/double conversions + * in too many places to sensibly merge with long version, given + * the low-overhead requirements of this class. So must instead be + * maintained by copy/paste/adapt. + */ + final void doubleAccumulate(double x, DoubleBinaryOperator fn, + boolean wasUncontended) { + int h; + if ((h = getProbe()) == 0) { + ThreadLocalRandom.current(); // force initialization + h = getProbe(); + wasUncontended = true; + } + boolean collide = false; // True if last slot nonempty + for (;;) { + Striped64.Cell[] as; Striped64.Cell a; int n; long v; + if ((as = cells) != null && (n = as.length) > 0) { + if ((a = as[(n - 1) & h]) == null) { + if (cellsBusy == 0) { // Try to attach new Cell + Striped64.Cell r = new Striped64.Cell(Double.doubleToRawLongBits(x)); + if (cellsBusy == 0 && casCellsBusy()) { + boolean created = false; + try { // Recheck under lock + Striped64.Cell[] rs; int m, j; + if ((rs = cells) != null && + (m = rs.length) > 0 && + rs[j = (m - 1) & h] == null) { + rs[j] = r; + created = true; + } + } finally { + cellsBusy = 0; + } + if (created) + break; + continue; // Slot is now non-empty + } + } + collide = false; + } + else if (!wasUncontended) // CAS already known to fail + wasUncontended = true; // Continue after rehash + else if (a.cas(v = a.value, + ((fn == null) ? + Double.doubleToRawLongBits + (Double.longBitsToDouble(v) + x) : + Double.doubleToRawLongBits + (fn.applyAsDouble + (Double.longBitsToDouble(v), x))))) + break; + else if (n >= NCPU || cells != as) + collide = false; // At max size or stale + else if (!collide) + collide = true; + else if (cellsBusy == 0 && casCellsBusy()) { + try { + if (cells == as) { // Expand table unless stale + Striped64.Cell[] rs = new Striped64.Cell[n << 1]; + for (int i = 0; i < n; ++i) + rs[i] = as[i]; + cells = rs; + } + } finally { + cellsBusy = 0; + } + collide = false; + continue; // Retry with expanded table + } + h = advanceProbe(h); + } + else if (cellsBusy == 0 && cells == as && casCellsBusy()) { + boolean init = false; + try { // Initialize table + if (cells == as) { + Striped64.Cell[] rs = new Striped64.Cell[2]; + rs[h & 1] = new Striped64.Cell(Double.doubleToRawLongBits(x)); + cells = rs; + init = true; + } + } finally { + cellsBusy = 0; + } + if (init) + break; + } + else if (casBase(v = base, + ((fn == null) ? + Double.doubleToRawLongBits + (Double.longBitsToDouble(v) + x) : + Double.doubleToRawLongBits + (fn.applyAsDouble + (Double.longBitsToDouble(v), x))))) + break; // Fall back on using base + } + } + + // Unsafe mechanics + private static final sun.misc.Unsafe UNSAFE; + private static final long BASE; + private static final long CELLSBUSY; + private static final long PROBE; + static { + try { + UNSAFE = getUnsafe(); + Class sk = Striped64.class; + BASE = UNSAFE.objectFieldOffset + (sk.getDeclaredField("base")); + CELLSBUSY = UNSAFE.objectFieldOffset + (sk.getDeclaredField("cellsBusy")); + Class tk = Thread.class; + PROBE = UNSAFE.objectFieldOffset + (tk.getDeclaredField("threadLocalRandomProbe")); + } catch (Exception e) { + throw new Error(e); + } + } + + private static Unsafe getUnsafe() { + try { + Field field = Unsafe.class.getDeclaredField("theUnsafe"); + field.setAccessible(true); + + return (Unsafe) field.get(null); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + +} \ No newline at end of file diff --git a/json-2/pom.xml b/json-2/pom.xml index e0295af59b..d674d6f86d 100644 --- a/json-2/pom.xml +++ b/json-2/pom.xml @@ -47,12 +47,13 @@ org.apache.commons commons-lang3 - 3.9 + ${commons-lang3.version} 0.9.23 3.11.1 1.9.2 + 3.9 diff --git a/kotlin-libraries/pom.xml b/kotlin-libraries/pom.xml index 0d6e589377..908a545ae3 100644 --- a/kotlin-libraries/pom.xml +++ b/kotlin-libraries/pom.xml @@ -151,7 +151,6 @@ - 4.12 1.5.0 4.1.0 3.0.4 diff --git a/kotlin-quasar/pom.xml b/kotlin-quasar/pom.xml index ec37fa8059..59553f422e 100644 --- a/kotlin-quasar/pom.xml +++ b/kotlin-quasar/pom.xml @@ -148,7 +148,6 @@ 3.1.1 2.22.1 1.3.2 - 4.12 diff --git a/libraries-3/pom.xml b/libraries-3/pom.xml index 5334bfba70..2f6e9fa747 100644 --- a/libraries-3/pom.xml +++ b/libraries-3/pom.xml @@ -73,19 +73,19 @@ com.uber.nullaway nullaway - 0.3.0 + ${nullaway.version} org.codehaus.plexus plexus-compiler-javac-errorprone - 2.8 + ${plexus-compiler.version} com.google.errorprone error_prone_core - 2.1.3 + ${errorprone.version} @@ -230,5 +230,8 @@ 4.5.12 2.2 1.6.0 + 0.3.0 + 2.8 + 2.1.3 diff --git a/libraries-4/pom.xml b/libraries-4/pom.xml index f26e7fc055..d7f6a44985 100644 --- a/libraries-4/pom.xml +++ b/libraries-4/pom.xml @@ -91,7 +91,7 @@ org.glassfish.web javax.el - 2.2.4 + ${glassfish.web.version} @@ -111,6 +111,7 @@ 3.0.0 0.6.5 3.0.0 + 2.2.4 \ No newline at end of file diff --git a/libraries-6/README.md b/libraries-6/README.md index 79bb83113e..3748522b9d 100644 --- a/libraries-6/README.md +++ b/libraries-6/README.md @@ -14,4 +14,6 @@ Remember, for advanced libraries like [Jackson](/jackson) and [JUnit](/testing-m - [Introduction to Functional Java](https://www.baeldung.com/java-functional-library) - [A Guide to the Reflections Library](https://www.baeldung.com/reflections-library) - [Exactly Once Processing in Kafka](https://www.baeldung.com/kafka-exactly-once) +- [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) +- [Java-R Integration](https://www.baeldung.com/java-r-integration) - More articles [[<-- prev]](/libraries-5) diff --git a/libraries-6/pom.xml b/libraries-6/pom.xml index 030e5aa77b..2f8cc385cb 100644 --- a/libraries-6/pom.xml +++ b/libraries-6/pom.xml @@ -92,8 +92,50 @@ ${commonsio.version} test + + org.rosuda.REngine + Rserve + ${rserve.version} + + + com.github.jbytecode + RCaller + ${rcaller.version} + + + org.renjin + renjin-script-engine + ${renjin.version} + + + + + bedatadriven + bedatadriven public repo + https://nexus.bedatadriven.com/content/groups/public/ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + com/baeldung/r/FastRMean.java + + + com/baeldung/r/FastRMeanUnitTest.java + + + + + + 2.0.0 1.10.0 @@ -105,6 +147,9 @@ 3.6 3.6.2 2.6 + RELEASE + 3.0 + 1.8.1 diff --git a/libraries-data-2/src/main/java/com/baeldung/r/FastRMean.java b/libraries-6/src/main/java/com/baeldung/r/FastRMean.java similarity index 92% rename from libraries-data-2/src/main/java/com/baeldung/r/FastRMean.java rename to libraries-6/src/main/java/com/baeldung/r/FastRMean.java index 8348bfa403..1202cfaa2a 100644 --- a/libraries-data-2/src/main/java/com/baeldung/r/FastRMean.java +++ b/libraries-6/src/main/java/com/baeldung/r/FastRMean.java @@ -1,8 +1,5 @@ package com.baeldung.r; -import java.io.IOException; -import java.net.URISyntaxException; - /** * FastR showcase. * diff --git a/libraries-data-2/src/main/java/com/baeldung/r/RCallerMean.java b/libraries-6/src/main/java/com/baeldung/r/RCallerMean.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/r/RCallerMean.java rename to libraries-6/src/main/java/com/baeldung/r/RCallerMean.java index 99edb8c043..d07a989444 100644 --- a/libraries-data-2/src/main/java/com/baeldung/r/RCallerMean.java +++ b/libraries-6/src/main/java/com/baeldung/r/RCallerMean.java @@ -1,12 +1,12 @@ package com.baeldung.r; -import java.io.IOException; -import java.net.URISyntaxException; - import com.github.rcaller.rstuff.RCaller; import com.github.rcaller.rstuff.RCallerOptions; import com.github.rcaller.rstuff.RCode; +import java.io.IOException; +import java.net.URISyntaxException; + /** * RCaller showcase. * diff --git a/libraries-data-2/src/main/java/com/baeldung/r/RUtils.java b/libraries-6/src/main/java/com/baeldung/r/RUtils.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/r/RUtils.java rename to libraries-6/src/main/java/com/baeldung/r/RUtils.java diff --git a/libraries-data-2/src/main/java/com/baeldung/r/RenjinMean.java b/libraries-6/src/main/java/com/baeldung/r/RenjinMean.java similarity index 99% rename from libraries-data-2/src/main/java/com/baeldung/r/RenjinMean.java rename to libraries-6/src/main/java/com/baeldung/r/RenjinMean.java index 4576ec5fb4..22cfad3a6f 100644 --- a/libraries-data-2/src/main/java/com/baeldung/r/RenjinMean.java +++ b/libraries-6/src/main/java/com/baeldung/r/RenjinMean.java @@ -1,13 +1,12 @@ package com.baeldung.r; -import java.io.IOException; -import java.net.URISyntaxException; - -import javax.script.ScriptException; - import org.renjin.script.RenjinScriptEngine; import org.renjin.sexp.DoubleArrayVector; +import javax.script.ScriptException; +import java.io.IOException; +import java.net.URISyntaxException; + /** * Renjin showcase. * diff --git a/libraries-data-2/src/main/java/com/baeldung/r/RserveMean.java b/libraries-6/src/main/java/com/baeldung/r/RserveMean.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/r/RserveMean.java rename to libraries-6/src/main/java/com/baeldung/r/RserveMean.java diff --git a/core-java-modules/core-java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java b/libraries-6/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java similarity index 99% rename from core-java-modules/core-java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java rename to libraries-6/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java index 371ac3a9bb..c28248e52c 100644 --- a/core-java-modules/core-java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java +++ b/libraries-6/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java @@ -10,8 +10,6 @@ import org.junit.Test; import java.util.List; import java.util.Optional; import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/libraries-data-2/src/test/java/com/baeldung/r/FastRMeanUnitTest.java b/libraries-6/src/test/java/com/baeldung/r/FastRMeanUnitTest.java similarity index 100% rename from libraries-data-2/src/test/java/com/baeldung/r/FastRMeanUnitTest.java rename to libraries-6/src/test/java/com/baeldung/r/FastRMeanUnitTest.java diff --git a/libraries-data-2/src/test/java/com/baeldung/r/RCallerMeanIntegrationTest.java b/libraries-6/src/test/java/com/baeldung/r/RCallerMeanIntegrationTest.java similarity index 99% rename from libraries-data-2/src/test/java/com/baeldung/r/RCallerMeanIntegrationTest.java rename to libraries-6/src/test/java/com/baeldung/r/RCallerMeanIntegrationTest.java index ce6b3a4332..94dd9b89e5 100644 --- a/libraries-data-2/src/test/java/com/baeldung/r/RCallerMeanIntegrationTest.java +++ b/libraries-6/src/test/java/com/baeldung/r/RCallerMeanIntegrationTest.java @@ -1,14 +1,13 @@ package com.baeldung.r; -import java.io.IOException; -import java.net.URISyntaxException; - -import javax.script.ScriptException; - import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; +import javax.script.ScriptException; +import java.io.IOException; +import java.net.URISyntaxException; + /** * Test for {@link RCallerMean}. * diff --git a/libraries-data-2/src/test/java/com/baeldung/r/RenjinMeanUnitTest.java b/libraries-6/src/test/java/com/baeldung/r/RenjinMeanUnitTest.java similarity index 99% rename from libraries-data-2/src/test/java/com/baeldung/r/RenjinMeanUnitTest.java rename to libraries-6/src/test/java/com/baeldung/r/RenjinMeanUnitTest.java index f52d37d614..49472aaee6 100644 --- a/libraries-data-2/src/test/java/com/baeldung/r/RenjinMeanUnitTest.java +++ b/libraries-6/src/test/java/com/baeldung/r/RenjinMeanUnitTest.java @@ -1,13 +1,11 @@ package com.baeldung.r; -import java.io.IOException; -import java.net.URISyntaxException; - -import javax.script.ScriptException; - +import org.junit.Assert; import org.junit.Test; -import org.junit.Assert; +import javax.script.ScriptException; +import java.io.IOException; +import java.net.URISyntaxException; /** * Test for {@link RenjinMean}. diff --git a/libraries-data-2/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java b/libraries-6/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java similarity index 100% rename from libraries-data-2/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java rename to libraries-6/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java diff --git a/libraries-data-2/src/test/resources/script.R b/libraries-6/src/test/resources/script.R similarity index 100% rename from libraries-data-2/src/test/resources/script.R rename to libraries-6/src/test/resources/script.R diff --git a/libraries-apache-commons/README.md b/libraries-apache-commons/README.md index 439587266b..aceea3282a 100644 --- a/libraries-apache-commons/README.md +++ b/libraries-apache-commons/README.md @@ -13,3 +13,4 @@ This module contains articles about Apache Commons libraries. - [Apache Commons BeanUtils](https://www.baeldung.com/apache-commons-beanutils) - [Histograms with Apache Commons Frequency](https://www.baeldung.com/apache-commons-frequency) - [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3) +- [Differences Between the Java WatchService API and the Apache Commons IO Monitor Library](https://www.baeldung.com/java-watchservice-vs-apache-commons-io-monitor-library) \ No newline at end of file diff --git a/libraries-apache-commons/pom.xml b/libraries-apache-commons/pom.xml index 688a500c4a..74adddabcf 100644 --- a/libraries-apache-commons/pom.xml +++ b/libraries-apache-commons/pom.xml @@ -57,6 +57,11 @@ xchart ${xchart-version} + + commons-io + commons-io + ${common-io.version} + @@ -68,6 +73,7 @@ 1.6 3.5.2 3.6.1 + 2.5 diff --git a/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java b/libraries-apache-commons/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java similarity index 100% rename from core-java-modules/core-java-io-apis/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java rename to libraries-apache-commons/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java diff --git a/libraries-concurrency/pom.xml b/libraries-concurrency/pom.xml index e1307408b0..b7dc5187b1 100644 --- a/libraries-concurrency/pom.xml +++ b/libraries-concurrency/pom.xml @@ -16,17 +16,17 @@ co.paralleluniverse quasar-core - 0.8.0 + ${quasar.version} co.paralleluniverse quasar-actors - 0.8.0 + ${quasar.version} co.paralleluniverse quasar-reactive-streams - 0.8.0 + ${quasar.version} @@ -78,4 +78,8 @@ + + + 0.8.0 + \ No newline at end of file diff --git a/libraries-data-2/README.md b/libraries-data-2/README.md index 01f891ba2f..a8f2a0cb37 100644 --- a/libraries-data-2/README.md +++ b/libraries-data-2/README.md @@ -8,11 +8,11 @@ This module contains articles about libraries for data processing in Java. - [Introduction to Conflict-Free Replicated Data Types](https://www.baeldung.com/java-conflict-free-replicated-data-types) - [Introduction to javax.measure](https://www.baeldung.com/javax-measure) - [A Guide to Infinispan in Java](https://www.baeldung.com/infinispan) -- [Guide to JMapper](https://www.baeldung.com/jmapper) - [An Introduction to SuanShu](https://www.baeldung.com/suanshu) - [Intro to Derive4J](https://www.baeldung.com/derive4j) -- [Java-R Integration](https://www.baeldung.com/java-r-integration) - [Univocity Parsers](https://www.baeldung.com/java-univocity-parsers) +- [Using Kafka MockConsumer](https://www.baeldung.com/kafka-mockconsumer) +- [Using Kafka MockProducer](https://www.baeldung.com/kafka-mockproducer) - More articles: [[<-- prev]](/../libraries-data) ##### Building the project diff --git a/libraries-data-2/pom.xml b/libraries-data-2/pom.xml index ac23747caa..26d8651cdd 100644 --- a/libraries-data-2/pom.xml +++ b/libraries-data-2/pom.xml @@ -86,11 +86,6 @@ spring-web ${spring.version} - - com.googlecode.jmapper-framework - jmapper-core - ${jmapper.version} - com.numericalmethod suanshu @@ -126,6 +121,11 @@ kafka-clients ${kafka.version} + + com.google.guava + guava + ${guava.version} + org.awaitility awaitility @@ -138,21 +138,6 @@ ${awaitility.version} test - - org.rosuda.REngine - Rserve - ${rserve.version} - - - com.github.jbytecode - RCaller - ${rcaller.version} - - - org.renjin - renjin-script-engine - ${renjin.version} - net.bytebuddy byte-buddy @@ -175,13 +160,6 @@ http://repo.numericalmethod.com/maven/ default - - - - bedatadriven - bedatadriven public repo - https://nexus.bedatadriven.com/content/groups/public/ - @@ -192,35 +170,14 @@ 9.1.5.Final 2.9.8 4.3.8.RELEASE - 1.6.0.1 4.0.0 1.1.0 3.6.2 1.7.25 3.0.0 2.8.4 - RELEASE - 3.0 - 1.8.1 2.5.0 + 29.0-jre - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - com/baeldung/r/FastRMean.java - - - com/baeldung/r/FastRMeanUnitTest.java - - - - - - \ No newline at end of file diff --git a/libraries-data-2/src/test/java/com/baeldung/univocity/ParsingServiceUnitTest.java b/libraries-data-2/src/test/java/com/baeldung/univocity/ParsingServiceUnitTest.java index 8cac0bc4b8..c1321ef675 100644 --- a/libraries-data-2/src/test/java/com/baeldung/univocity/ParsingServiceUnitTest.java +++ b/libraries-data-2/src/test/java/com/baeldung/univocity/ParsingServiceUnitTest.java @@ -2,15 +2,26 @@ package com.baeldung.univocity; import static org.junit.Assert.assertEquals; +import java.io.File; import java.util.ArrayList; import java.util.List; +import org.junit.After; import org.junit.Test; import com.baeldung.univocity.model.Product; public class ParsingServiceUnitTest { + @After + public void cleanup() { + File csvFile = new File("src/test/resources/outputProductList.csv"); + csvFile.deleteOnExit(); + + File textFile = new File("src/test/resources/outputProductList.txt"); + textFile.deleteOnExit(); + } + @Test public void givenCsvFile_thenParsedResultsShouldBeReturned() { ParsingService parsingService = new ParsingService(); diff --git a/libraries-data/README.md b/libraries-data/README.md index 7614d11b16..44fddfd90e 100644 --- a/libraries-data/README.md +++ b/libraries-data/README.md @@ -12,4 +12,5 @@ This module contains articles about libraries for data processing in Java. - [Introduction to Kafka Connectors](https://www.baeldung.com/kafka-connectors-guide) - [Kafka Connect Example with MQTT and MongoDB](https://www.baeldung.com/kafka-connect-mqtt-mongodb) - [Building a Data Pipeline with Flink and Kafka](https://www.baeldung.com/kafka-flink-data-pipeline) +- [Guide to JMapper](https://www.baeldung.com/jmapper) More articles: [[next -->]](/../libraries-data-2) \ No newline at end of file diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 1267982c49..95d771ce4e 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -126,6 +126,11 @@ + + com.googlecode.jmapper-framework + jmapper-core + ${jmapper.version} + @@ -172,6 +177,7 @@ 0.15.0 2.2.0 1.7.25 + 1.6.0.1 diff --git a/libraries-data-2/src/main/java/com/baeldung/jmapper/User.java b/libraries-data/src/main/java/com/baeldung/jmapper/User.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/jmapper/User.java rename to libraries-data/src/main/java/com/baeldung/jmapper/User.java diff --git a/libraries-data-2/src/main/java/com/baeldung/jmapper/UserDto.java b/libraries-data/src/main/java/com/baeldung/jmapper/UserDto.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/jmapper/UserDto.java rename to libraries-data/src/main/java/com/baeldung/jmapper/UserDto.java diff --git a/libraries-data-2/src/main/java/com/baeldung/jmapper/UserDto1.java b/libraries-data/src/main/java/com/baeldung/jmapper/UserDto1.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/jmapper/UserDto1.java rename to libraries-data/src/main/java/com/baeldung/jmapper/UserDto1.java diff --git a/libraries-data-2/src/main/java/com/baeldung/jmapper/relational/User.java b/libraries-data/src/main/java/com/baeldung/jmapper/relational/User.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/jmapper/relational/User.java rename to libraries-data/src/main/java/com/baeldung/jmapper/relational/User.java diff --git a/libraries-data-2/src/main/java/com/baeldung/jmapper/relational/UserDto1.java b/libraries-data/src/main/java/com/baeldung/jmapper/relational/UserDto1.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/jmapper/relational/UserDto1.java rename to libraries-data/src/main/java/com/baeldung/jmapper/relational/UserDto1.java diff --git a/libraries-data-2/src/main/java/com/baeldung/jmapper/relational/UserDto2.java b/libraries-data/src/main/java/com/baeldung/jmapper/relational/UserDto2.java similarity index 100% rename from libraries-data-2/src/main/java/com/baeldung/jmapper/relational/UserDto2.java rename to libraries-data/src/main/java/com/baeldung/jmapper/relational/UserDto2.java diff --git a/libraries-data-2/src/test/java/com/baeldung/jmapper/JMapperIntegrationTest.java b/libraries-data/src/test/java/com/baeldung/jmapper/JMapperIntegrationTest.java similarity index 95% rename from libraries-data-2/src/test/java/com/baeldung/jmapper/JMapperIntegrationTest.java rename to libraries-data/src/test/java/com/baeldung/jmapper/JMapperIntegrationTest.java index 177ef08d41..0b7a7c95f4 100644 --- a/libraries-data-2/src/test/java/com/baeldung/jmapper/JMapperIntegrationTest.java +++ b/libraries-data/src/test/java/com/baeldung/jmapper/JMapperIntegrationTest.java @@ -7,6 +7,9 @@ import org.junit.Test; import java.time.LocalDate; import static com.googlecode.jmapper.api.JMapperAPI.*; +import static com.googlecode.jmapper.api.JMapperAPI.attribute; +import static com.googlecode.jmapper.api.JMapperAPI.global; +import static com.googlecode.jmapper.api.JMapperAPI.mappedClass; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/libraries-data-2/src/test/java/com/baeldung/jmapper/JMapperRelationalIntegrationTest.java b/libraries-data/src/test/java/com/baeldung/jmapper/JMapperRelationalIntegrationTest.java similarity index 97% rename from libraries-data-2/src/test/java/com/baeldung/jmapper/JMapperRelationalIntegrationTest.java rename to libraries-data/src/test/java/com/baeldung/jmapper/JMapperRelationalIntegrationTest.java index a44d608a0a..7a497c4a83 100644 --- a/libraries-data-2/src/test/java/com/baeldung/jmapper/JMapperRelationalIntegrationTest.java +++ b/libraries-data/src/test/java/com/baeldung/jmapper/JMapperRelationalIntegrationTest.java @@ -55,8 +55,8 @@ public class JMapperRelationalIntegrationTest { public void givenUser_whenUseApi_thenConverted(){ JMapperAPI jmapperApi = new JMapperAPI() .add(mappedClass(User.class) - .add(attribute("id").value("id").targetClasses(UserDto1.class,UserDto2.class)) - .add(attribute("email").targetAttributes("username","email").targetClasses(UserDto1.class,UserDto2.class)) ) + .add(attribute("id").value("id").targetClasses(UserDto1.class, UserDto2.class)) + .add(attribute("email").targetAttributes("username","email").targetClasses(UserDto1.class, UserDto2.class)) ) ; RelationalJMapper relationalMapper = new RelationalJMapper<>(User.class,jmapperApi); diff --git a/libraries-data-2/src/test/resources/user_jmapper.xml b/libraries-data/src/test/resources/user_jmapper.xml similarity index 100% rename from libraries-data-2/src/test/resources/user_jmapper.xml rename to libraries-data/src/test/resources/user_jmapper.xml diff --git a/libraries-data-2/src/test/resources/user_jmapper1.xml b/libraries-data/src/test/resources/user_jmapper1.xml similarity index 100% rename from libraries-data-2/src/test/resources/user_jmapper1.xml rename to libraries-data/src/test/resources/user_jmapper1.xml diff --git a/libraries-data-2/src/test/resources/user_jmapper2.xml b/libraries-data/src/test/resources/user_jmapper2.xml similarity index 100% rename from libraries-data-2/src/test/resources/user_jmapper2.xml rename to libraries-data/src/test/resources/user_jmapper2.xml diff --git a/libraries-security/README.md b/libraries-security/README.md index 580ebdeab0..5ec85a15e9 100644 --- a/libraries-security/README.md +++ b/libraries-security/README.md @@ -10,3 +10,4 @@ This module contains articles about security libraries. - [Introduction to BouncyCastle with Java](https://www.baeldung.com/java-bouncy-castle) - [Intro to Jasypt](https://www.baeldung.com/jasypt) - [Digital Signatures in Java](https://www.baeldung.com/java-digital-signature) +- [How to Read PEM File to Get Public and Private Keys](https://www.baeldung.com/java-read-pem-file-keys) diff --git a/libraries-security/src/main/java/com/baeldung/pem/BouncyCastlePemUtils.java b/libraries-security/src/main/java/com/baeldung/pem/BouncyCastlePemUtils.java new file mode 100644 index 0000000000..03140666f7 --- /dev/null +++ b/libraries-security/src/main/java/com/baeldung/pem/BouncyCastlePemUtils.java @@ -0,0 +1,71 @@ +package com.baeldung.pem; + +import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; +import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; +import org.bouncycastle.openssl.PEMParser; +import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter; +import org.bouncycastle.util.io.pem.PemObject; +import org.bouncycastle.util.io.pem.PemReader; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; + +public class BouncyCastlePemUtils { + + public static RSAPublicKey readX509PublicKey(File file) throws InvalidKeySpecException, IOException, NoSuchAlgorithmException { + KeyFactory factory = KeyFactory.getInstance("RSA"); + + try (FileReader keyReader = new FileReader(file); + PemReader pemReader = new PemReader(keyReader)) { + + PemObject pemObject = pemReader.readPemObject(); + byte[] content = pemObject.getContent(); + X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(content); + return (RSAPublicKey) factory.generatePublic(pubKeySpec); + } + } + + public static RSAPublicKey readX509PublicKeySecondApproach(File file) throws IOException { + try (FileReader keyReader = new FileReader(file)) { + + PEMParser pemParser = new PEMParser(keyReader); + JcaPEMKeyConverter converter = new JcaPEMKeyConverter(); + SubjectPublicKeyInfo publicKeyInfo = SubjectPublicKeyInfo.getInstance(pemParser.readObject()); + + return (RSAPublicKey) converter.getPublicKey(publicKeyInfo); + } + } + + public static RSAPrivateKey readPKCS8PrivateKey(File file) throws InvalidKeySpecException, IOException, NoSuchAlgorithmException { + KeyFactory factory = KeyFactory.getInstance("RSA"); + + try (FileReader keyReader = new FileReader(file); + PemReader pemReader = new PemReader(keyReader)) { + + PemObject pemObject = pemReader.readPemObject(); + byte[] content = pemObject.getContent(); + PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(content); + return (RSAPrivateKey) factory.generatePrivate(privKeySpec); + } + } + + public static RSAPrivateKey readPKCS8PrivateKeySecondApproach(File file) throws IOException { + try (FileReader keyReader = new FileReader(file)) { + + PEMParser pemParser = new PEMParser(keyReader); + JcaPEMKeyConverter converter = new JcaPEMKeyConverter(); + PrivateKeyInfo privateKeyInfo = PrivateKeyInfo.getInstance(pemParser.readObject()); + + return (RSAPrivateKey) converter.getPrivateKey(privateKeyInfo); + } + } + +} diff --git a/libraries-security/src/main/resources/pem/private-key-pkcs8.pem b/libraries-security/src/main/resources/pem/private-key-pkcs8.pem new file mode 100644 index 0000000000..903f903d7a --- /dev/null +++ b/libraries-security/src/main/resources/pem/private-key-pkcs8.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCyO0YiTxLEP44S +IGk/b9MlQAXS6nC4oYyTrAfxHCi/zxW/MmtWbY0K2JxOTkVSD5QbmvwkCutXi0k9 +EdDK+orAXg2KSy686O/cfIh/iho6FmNPyEOd7UF+/5wWpknrUaTQyMA2H9Pmr2/E +RH/tN1Q0cqmhFX41WUo3lsRT81DkVCNVeJx+zDGHpjp+XY8gWpPYJ+MP4WQE9TWJ +P2rIlgcDfwhG/A21yK0WAJ5nB0Y+jGI8+HVYdjxXGlRUG//YmxS2sH+sAhsapmjE +Aha+KMk972jVNjdWU7OT0BJnUB5q286Kv6INUnk6kqYufNzjpCAY9SyMjKjpKN71 +3Gka2gZBAgMBAAECggEAFlPam12wiik0EQ1CYhIOL3JvyFZaPKbwR2ebrxbJ/A1j +OgqE69TZgGxWWHDxui/9a9/kildb2CG40Q+0SllMnICrzZFRj5TWx5ZKOz//vRsk +4c/CuLwKInC/Cw9V30bhEM61VZJzJ0j/BWVXaU4vHEro+ScKIoDHDWOzwJiQn6m9 +C+Ti5lFpax3hx8ZrgPqmBCFYNvErrWkOr7mCYl0jS+E22c68yn8+LjdlF1LWUa6N +zutk3MPj5UwEyR0h7EZReCeGkPTMQNyOBhDcmAtlEno4fjtZzUDHRjh8/QpG1Mz/ +alavvrkjswc1DmRUOdgiYu+Waxan5noBhxEAvd/hyQKBgQDjYJD0n+m0tUrpNtX0 ++mdzHstClHrpx5oNxs4sIBjCoCwEXaSpeY8+JxCdnZ6n29mLZLq/wPXxZ3EJcOSZ +PYUvZJfV/IUvoLPFbtT3ILzDTcAAeHj2GAOpzYP8J1JSFsc78ZjKMF1XeNjXcq8T +XNXoWfY7N/fShoycVeG42JJCFwKBgQDIqvHL0QfJ8r6yM8Efj7Zq6Wa4C9okORes +8UVWfBoO6UOWvpK+D9IjnaEisJcnEalwNi8/eKudR9hfvmzATV+t3YJIgktto3TT +BWLsEyniNU4vSTl7GPBrV2xabWogbChlt7TXUfw6YogaBKm43snYXBbJFc+NcpQH +ONB5igppZwKBgGDyYHvc3wGsttb/CXTde1RLUfD+a/XXpCixlmCcAtKhBoOKBdY4 +vUmL0HrTpLz/cR8NAM8XkAWwzDJxTxbDc1EEu/SCKatoAp5wph8Ed1dyhCXvN+v9 +yzoQJXFStrfHfIVjenji7DmKjjI2dM11rMLX8LPJJkI+Gh/iQk7VEG9bAoGAH/aS +sztleTZwR6RUw7k5fkgVM4W3xoNNkR+RQthbsjpXqMBMUXflqgSmsQbd3LxEd/o5 +hmurMk9KWN3VJsBsWB5rbS9L4nfh2OcHvcDDsCN7g66vODtduEthl/nLqMRxnton +NRD7EzW0pihN/IOINS1d98PAnrA8gfX7xxBE3ksCgYBvoljHGjvy3bPJ++vDGKJK +y6JuEeRVzgdPXEb60uU+BR7kdh+MMsZLmgfFTgza3R+/xeZcC/cuOPsbzeooRQi/ +9NpKwSCXjVNk9nglUWBoPRh4uYqrArWn+HoR7MI/BxeRJm5e1+ii8P19Y9joX5s0 +Q3OLn8GeH56ClJmNiWDhsA== +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/libraries-security/src/main/resources/pem/public-key.pem b/libraries-security/src/main/resources/pem/public-key.pem new file mode 100644 index 0000000000..54262dca03 --- /dev/null +++ b/libraries-security/src/main/resources/pem/public-key.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjtGIk8SxD+OEiBpP2/T +JUAF0upwuKGMk6wH8Rwov88VvzJrVm2NCticTk5FUg+UG5r8JArrV4tJPRHQyvqK +wF4NiksuvOjv3HyIf4oaOhZjT8hDne1Bfv+cFqZJ61Gk0MjANh/T5q9vxER/7TdU +NHKpoRV+NVlKN5bEU/NQ5FQjVXicfswxh6Y6fl2PIFqT2CfjD+FkBPU1iT9qyJYH +A38IRvwNtcitFgCeZwdGPoxiPPh1WHY8VxpUVBv/2JsUtrB/rAIbGqZoxAIWvijJ +Pe9o1TY3VlOzk9ASZ1AeatvOir+iDVJ5OpKmLnzc46QgGPUsjIyo6Sje9dxpGtoG +QQIDAQAB +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/libraries-security/src/test/java/com/baeldung/pem/BouncyCastlePemUtilsUnitTest.java b/libraries-security/src/test/java/com/baeldung/pem/BouncyCastlePemUtilsUnitTest.java new file mode 100644 index 0000000000..1297568d0e --- /dev/null +++ b/libraries-security/src/test/java/com/baeldung/pem/BouncyCastlePemUtilsUnitTest.java @@ -0,0 +1,41 @@ +package com.baeldung.pem; + + +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class BouncyCastlePemUtilsUnitTest { + + @Test + public void whenReadPublicKeyFromPEMFile_thenSuccess() throws Exception { + File pemFile = new File(BouncyCastlePemUtilsUnitTest.class.getResource("/pem/public-key.pem").getFile()); + + RSAPublicKey publicKey1 = BouncyCastlePemUtils.readX509PublicKey(pemFile); + RSAPublicKey publicKey2 = BouncyCastlePemUtils.readX509PublicKeySecondApproach(pemFile); + + assertEquals("X.509", publicKey1.getFormat()); + assertEquals("RSA", publicKey1.getAlgorithm()); + + assertEquals("X.509", publicKey2.getFormat()); + assertEquals("RSA", publicKey2.getAlgorithm()); + } + + @Test + public void whenReadPrivateKeyFromPEMFile_thenSuccess() throws Exception { + File pemFile = new File(BouncyCastlePemUtilsUnitTest.class.getResource("/pem/private-key-pkcs8.pem").getFile()); + + RSAPrivateKey privateKey1 = BouncyCastlePemUtils.readPKCS8PrivateKey(pemFile); + RSAPrivateKey privateKey2 = BouncyCastlePemUtils.readPKCS8PrivateKeySecondApproach(pemFile); + + assertEquals("PKCS#8", privateKey1.getFormat()); + assertEquals("RSA", privateKey1.getAlgorithm()); + + assertEquals("PKCS#8", privateKey2.getFormat()); + assertEquals("RSA", privateKey2.getAlgorithm()); + } +} diff --git a/libraries-testing/README.md b/libraries-testing/README.md index ffdefe4b19..43d7673e2d 100644 --- a/libraries-testing/README.md +++ b/libraries-testing/README.md @@ -8,7 +8,7 @@ This module contains articles about test libraries. - [Introduction to JSONassert](https://www.baeldung.com/jsonassert) - [Serenity BDD and Screenplay](https://www.baeldung.com/serenity-screenplay) - [Serenity BDD with Spring and JBehave](https://www.baeldung.com/serenity-spring-jbehave) -- [Introduction to Awaitlity](https://www.baeldung.com/awaitlity-testing) +- [Introduction to Awaitility](https://www.baeldung.com/awaitlity-testing) - [Introduction to Hoverfly in Java](https://www.baeldung.com/hoverfly) - [Testing with Hamcrest](https://www.baeldung.com/java-junit-hamcrest-guide) - [Introduction To DBUnit](https://www.baeldung.com/java-dbunit) diff --git a/libraries-testing/src/main/java/com/baeldung/serenity/spring/AdderService.java b/libraries-testing/src/main/java/com/baeldung/serenity/spring/AdderService.java index 756c05bc2c..8e645ccff5 100644 --- a/libraries-testing/src/main/java/com/baeldung/serenity/spring/AdderService.java +++ b/libraries-testing/src/main/java/com/baeldung/serenity/spring/AdderService.java @@ -1,8 +1,10 @@ package com.baeldung.serenity.spring; +import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; @Service +@Scope("prototype") public class AdderService { private int num; diff --git a/linux-bash/text/README.md b/linux-bash/text/README.md index 20df2a33ec..1c27abc8c6 100644 --- a/linux-bash/text/README.md +++ b/linux-bash/text/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Linux Commands – Remove All Text After X](https://www.baeldung.com/linux/tr-manipulate-strings) +- [Linux Commands – Remove All Text After X](https://www.baeldung.com/linux/remove-text-after-x-in-file) - [Linux Commands for Appending Multiple Lines to a File](https://www.baeldung.com/linux/appending-multiple-lines-to-file2) diff --git a/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/TransferDemo.java b/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/TransferDemo.java index 259e9a8c5c..0cc9dee2b9 100644 --- a/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/TransferDemo.java +++ b/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/TransferDemo.java @@ -1,19 +1,21 @@ package com.baeldung.mdc; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import org.apache.log4j.Logger; - -import com.baeldung.mdc.log4j.Log4JRunnable; -import com.baeldung.mdc.log4j2.Log4J2Runnable; +import com.baeldung.mdc.pool.MdcAwareThreadPoolExecutor; import com.baeldung.mdc.slf4j.Slf4jRunnable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor.AbortPolicy; + +import static java.util.concurrent.TimeUnit.MINUTES; + public class TransferDemo { public static void main(String[] args) { - ExecutorService executor = Executors.newFixedThreadPool(3); + ExecutorService executor = new MdcAwareThreadPoolExecutor(3, 3, 0, MINUTES, + new LinkedBlockingQueue<>(), Thread::new, new AbortPolicy()); + TransactionFactory transactionFactory = new TransactionFactory(); for (int i = 0; i < 10; i++) { diff --git a/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/pool/MdcAwareThreadPoolExecutor.java b/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/pool/MdcAwareThreadPoolExecutor.java new file mode 100644 index 0000000000..71463fe116 --- /dev/null +++ b/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/pool/MdcAwareThreadPoolExecutor.java @@ -0,0 +1,31 @@ +package com.baeldung.mdc.pool; + +import org.apache.logging.log4j.ThreadContext; +import org.slf4j.MDC; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +public class MdcAwareThreadPoolExecutor extends ThreadPoolExecutor { + + public MdcAwareThreadPoolExecutor(int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + BlockingQueue workQueue, + ThreadFactory threadFactory, + RejectedExecutionHandler handler) { + super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler); + } + + @Override + protected void afterExecute(Runnable r, Throwable t) { + System.out.println("Cleaning the MDC context"); + MDC.clear(); + org.apache.log4j.MDC.clear(); + ThreadContext.clearAll(); + } +} diff --git a/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/slf4j/Slf4jRunnable.java b/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/slf4j/Slf4jRunnable.java index e30a28a3c7..f49640c527 100644 --- a/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/slf4j/Slf4jRunnable.java +++ b/logging-modules/log-mdc/src/main/java/com/baeldung/mdc/slf4j/Slf4jRunnable.java @@ -18,7 +18,7 @@ public class Slf4jRunnable implements Runnable { new Slf4TransferService().transfer(tx.getAmount()); - MDC.clear(); + // MDC.clear(); We don't need this with MdcAwareThreadPoolExecutor } } \ No newline at end of file diff --git a/machine-learning/pom.xml b/machine-learning/pom.xml index 99b7e33579..842e488985 100644 --- a/machine-learning/pom.xml +++ b/machine-learning/pom.xml @@ -6,7 +6,7 @@ 4.0.0 machine-learning 1.0-SNAPSHOT - Supervised Learning + machine-learning jar diff --git a/mapstruct/README.md b/mapstruct/README.md index 9887a7f43d..384bcbaa14 100644 --- a/mapstruct/README.md +++ b/mapstruct/README.md @@ -8,3 +8,4 @@ This module contains articles about MapStruct. - [Custom Mapper with MapStruct](https://www.baeldung.com/mapstruct-custom-mapper) - [Using Multiple Source Objects with MapStruct](https://www.baeldung.com/mapstruct-multiple-source-objects) - [Ignoring Unmapped Properties with MapStruct](https://www.baeldung.com/mapstruct-ignore-unmapped-properties) +- [Mapping Collections with MapStruct](https://www.baeldung.com/java-mapstruct-mapping-collections) diff --git a/mapstruct/pom.xml b/mapstruct/pom.xml index 11c8d9b41e..9fe6ab6485 100644 --- a/mapstruct/pom.xml +++ b/mapstruct/pom.xml @@ -16,7 +16,7 @@ org.mapstruct - mapstruct-jdk8 + mapstruct ${org.mapstruct.version} @@ -71,12 +71,12 @@ - 1.3.0.Final + 1.4.0.Beta1 4.3.4.RELEASE 1.8 1.8 1.18.4 - 3.11.1 + 3.16.1 diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/CompanyDTO.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/CompanyDTO.java new file mode 100644 index 0000000000..de3571e676 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/CompanyDTO.java @@ -0,0 +1,25 @@ +package com.baeldung.mapstruct.mappingCollections.dto; + +import java.util.ArrayList; +import java.util.List; + +public class CompanyDTO { + + private List employees; + + public List getEmployees() { + return employees; + } + + public void setEmployees(List employees) { + this.employees = employees; + } + + public void addEmployee(EmployeeDTO employeeDTO) { + if (employees == null) { + employees = new ArrayList<>(); + } + + employees.add(employeeDTO); + } +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/EmployeeDTO.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/EmployeeDTO.java new file mode 100644 index 0000000000..04e5a1f180 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/EmployeeDTO.java @@ -0,0 +1,23 @@ +package com.baeldung.mapstruct.mappingCollections.dto; + +public class EmployeeDTO { + + private String firstName; + private String lastName; + + 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; + } +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/EmployeeFullNameDTO.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/EmployeeFullNameDTO.java new file mode 100644 index 0000000000..10b97bfce4 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/dto/EmployeeFullNameDTO.java @@ -0,0 +1,14 @@ +package com.baeldung.mapstruct.mappingCollections.dto; + +public class EmployeeFullNameDTO { + + private String fullName; + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapper.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapper.java new file mode 100644 index 0000000000..5310c0454e --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapper.java @@ -0,0 +1,11 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.CompanyDTO; +import com.baeldung.mapstruct.mappingCollections.model.Company; +import org.mapstruct.Mapper; + +@Mapper(uses = EmployeeMapper.class) +public interface CompanyMapper { + + CompanyDTO map(Company company); +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperAdderPreferred.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperAdderPreferred.java new file mode 100644 index 0000000000..e5cc43074e --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperAdderPreferred.java @@ -0,0 +1,12 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.CompanyDTO; +import com.baeldung.mapstruct.mappingCollections.model.Company; +import org.mapstruct.CollectionMappingStrategy; +import org.mapstruct.Mapper; + +@Mapper(collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED) +public interface CompanyMapperAdderPreferred { + + CompanyDTO map(Company company); +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeFullNameMapper.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeFullNameMapper.java new file mode 100644 index 0000000000..44d3961f2b --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeFullNameMapper.java @@ -0,0 +1,20 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.EmployeeFullNameDTO; +import com.baeldung.mapstruct.mappingCollections.model.Employee; +import org.mapstruct.Mapper; + +import java.util.List; + +@Mapper +public interface EmployeeFullNameMapper { + + List map(List employees); + + default EmployeeFullNameDTO map(Employee employee) { + EmployeeFullNameDTO employeeInfoDTO = new EmployeeFullNameDTO(); + employeeInfoDTO.setFullName(employee.getFirstName() + " " + employee.getLastName()); + + return employeeInfoDTO; + } +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeMapper.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeMapper.java new file mode 100644 index 0000000000..45bf76c5a4 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeMapper.java @@ -0,0 +1,19 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.EmployeeDTO; +import com.baeldung.mapstruct.mappingCollections.model.Employee; +import org.mapstruct.Mapper; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +@Mapper +public interface EmployeeMapper { + + List map(List employees); + + Set map(Set employees); + + Map map(Map idEmployeeMap); +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/model/Company.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/model/Company.java new file mode 100644 index 0000000000..f96e0b7aea --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/model/Company.java @@ -0,0 +1,16 @@ +package com.baeldung.mapstruct.mappingCollections.model; + +import java.util.List; + +public class Company { + + private List employees; + + public List getEmployees() { + return employees; + } + + public void setEmployees(List employees) { + this.employees = employees; + } +} diff --git a/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/model/Employee.java b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/model/Employee.java new file mode 100644 index 0000000000..db6809d53f --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapstruct/mappingCollections/model/Employee.java @@ -0,0 +1,28 @@ +package com.baeldung.mapstruct.mappingCollections.model; + +public class Employee { + + private String firstName; + private String lastName; + + public Employee(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } + + 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; + } +} diff --git a/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperAdderPreferredUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperAdderPreferredUnitTest.java new file mode 100644 index 0000000000..ad0096f189 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperAdderPreferredUnitTest.java @@ -0,0 +1,32 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.CompanyDTO; +import com.baeldung.mapstruct.mappingCollections.dto.EmployeeDTO; +import com.baeldung.mapstruct.mappingCollections.model.Company; +import com.baeldung.mapstruct.mappingCollections.model.Employee; +import org.junit.jupiter.api.Test; +import org.mapstruct.factory.Mappers; + +import java.util.Collections; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +class CompanyMapperAdderPreferredUnitTest { + + private CompanyMapperAdderPreferred companyMapper = Mappers.getMapper(CompanyMapperAdderPreferred.class); + + @Test + void whenMappingToCompanyDTO_thenExpectCorrectMappingResult() { + Employee employee = new Employee("John", "Doe"); + Company company = new Company(); + company.setEmployees(Collections.singletonList(employee)); + + CompanyDTO result = companyMapper.map(company); + + List employees = result.getEmployees(); + assertThat(employees).hasSize(1); + assertThat(employees.get(0).getFirstName()).isEqualTo("John"); + assertThat(employees.get(0).getLastName()).isEqualTo("Doe"); + } +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperUnitTest.java new file mode 100644 index 0000000000..a556c88ce5 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/CompanyMapperUnitTest.java @@ -0,0 +1,32 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.CompanyDTO; +import com.baeldung.mapstruct.mappingCollections.dto.EmployeeDTO; +import com.baeldung.mapstruct.mappingCollections.model.Company; +import com.baeldung.mapstruct.mappingCollections.model.Employee; +import org.junit.jupiter.api.Test; +import org.mapstruct.factory.Mappers; + +import java.util.Collections; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +class CompanyMapperUnitTest { + + private CompanyMapper companyMapper = Mappers.getMapper(CompanyMapper.class); + + @Test + void whenMappingToCompanyDTO_thenExpectCorrectMappingResult() { + Employee employee = new Employee("John", "Doe"); + Company company = new Company(); + company.setEmployees(Collections.singletonList(employee)); + + CompanyDTO result = companyMapper.map(company); + + List employees = result.getEmployees(); + assertThat(employees).hasSize(1); + assertThat(employees.get(0).getFirstName()).isEqualTo("John"); + assertThat(employees.get(0).getLastName()).isEqualTo("Doe"); + } +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeFullNameMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeFullNameMapperUnitTest.java new file mode 100644 index 0000000000..ba010a2bca --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeFullNameMapperUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.EmployeeFullNameDTO; +import com.baeldung.mapstruct.mappingCollections.model.Employee; +import org.junit.jupiter.api.Test; +import org.mapstruct.factory.Mappers; + +import java.util.Collections; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +class EmployeeFullNameMapperUnitTest { + + private EmployeeFullNameMapper employeeMapper = Mappers.getMapper(EmployeeFullNameMapper.class); + + @Test + void whenMappingToEmployeeFullNameDTOList_thenExpectCorrectMappingResult() { + Employee employee = new Employee("John", "Doe"); + + List result = employeeMapper.map(Collections.singletonList(employee)); + + assertThat(result).hasSize(1); + assertThat(result.get(0).getFullName()).isEqualTo("John Doe"); + } +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeMapperUnitTest.java new file mode 100644 index 0000000000..dfb58252dc --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapstruct/mappingCollections/mapper/EmployeeMapperUnitTest.java @@ -0,0 +1,51 @@ +package com.baeldung.mapstruct.mappingCollections.mapper; + +import com.baeldung.mapstruct.mappingCollections.dto.EmployeeDTO; +import com.baeldung.mapstruct.mappingCollections.model.Employee; +import org.junit.jupiter.api.Test; +import org.mapstruct.factory.Mappers; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; + +class EmployeeMapperUnitTest { + + private EmployeeMapper employeeMapper = Mappers.getMapper(EmployeeMapper.class); + + @Test + void whenMappingToEmployeeDTOList_thenExpectCorrectMappingResult() { + Employee employee = new Employee("John", "Doe"); + + List result = employeeMapper.map(Collections.singletonList(employee)); + + assertThat(result).hasSize(1); + assertThat(result.get(0).getFirstName()).isEqualTo("John"); + assertThat(result.get(0).getLastName()).isEqualTo("Doe"); + } + + @Test + void whenMappingToEmployeeDTOSet_thenExpectCorrectMappingResult() { + Employee employee = new Employee("John", "Doe"); + + Set result = employeeMapper.map(Collections.singleton(employee)); + + assertThat(result).hasSize(1); + assertThat(result.iterator().next().getFirstName()).isEqualTo("John"); + assertThat(result.iterator().next().getLastName()).isEqualTo("Doe"); + } + + @Test + void whenMappingToEmployeeDTOMap_thenExpectCorrectMappingResult() { + Employee employee = new Employee("John", "Doe"); + + Map result = employeeMapper.map(Collections.singletonMap("1", employee)); + + assertThat(result).hasSize(1); + assertThat(result.get("1").getFirstName()).isEqualTo("John"); + assertThat(result.get("1").getLastName()).isEqualTo("Doe"); + } +} \ No newline at end of file diff --git a/maven-all/maven-custom-plugin/README.md b/maven-all/maven-custom-plugin/README.md deleted file mode 100644 index 55d147c337..0000000000 --- a/maven-all/maven-custom-plugin/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [How to Create a Maven Plugin](https://www.baeldung.com/maven-plugin) diff --git a/maven-all/maven/README.md b/maven-all/maven/README.md deleted file mode 100644 index c5f46ca184..0000000000 --- a/maven-all/maven/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Apache Maven - -This module contains articles about core Apache Maven. Articles about other Maven plugins (such as the Maven WAR Plugin) -have their own dedicated modules. - -### Relevant Articles - -- [Guide to the Core Maven Plugins](https://www.baeldung.com/core-maven-plugins) -- [Maven Resources Plugin](https://www.baeldung.com/maven-resources-plugin) -- [Quick Guide to the Maven Surefire Plugin](https://www.baeldung.com/maven-surefire-plugin) -- [The Maven Failsafe Plugin](https://www.baeldung.com/maven-failsafe-plugin) -- [The Maven Verifier Plugin](https://www.baeldung.com/maven-verifier-plugin) -- [The Maven Clean Plugin](https://www.baeldung.com/maven-clean-plugin) -- [Build a Jar with Maven and Ignore the Test Results](https://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) -- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module) diff --git a/maven-all/README.md b/maven-modules/README.md similarity index 50% rename from maven-all/README.md rename to maven-modules/README.md index b448be2cd0..1ef664f879 100644 --- a/maven-all/README.md +++ b/maven-modules/README.md @@ -5,4 +5,5 @@ This module contains articles about Apache Maven. Please refer to its submodules ### Relevant Articles - [Apache Maven Tutorial](https://www.baeldung.com/maven) -- [Find Unused Maven Dependencies](https://www.baeldung.com/maven-unused-dependencies) +- [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) +- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module) diff --git a/maven-all/compiler-plugin-java-9/README.md b/maven-modules/compiler-plugin-java-9/README.md similarity index 100% rename from maven-all/compiler-plugin-java-9/README.md rename to maven-modules/compiler-plugin-java-9/README.md diff --git a/maven-all/compiler-plugin-java-9/pom.xml b/maven-modules/compiler-plugin-java-9/pom.xml similarity index 100% rename from maven-all/compiler-plugin-java-9/pom.xml rename to maven-modules/compiler-plugin-java-9/pom.xml diff --git a/maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java b/maven-modules/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java similarity index 100% rename from maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java rename to maven-modules/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java diff --git a/maven-all/compiler-plugin-java-9/src/main/java/module-info.java b/maven-modules/compiler-plugin-java-9/src/main/java/module-info.java similarity index 100% rename from maven-all/compiler-plugin-java-9/src/main/java/module-info.java rename to maven-modules/compiler-plugin-java-9/src/main/java/module-info.java diff --git a/maven-modules/maven-custom-plugin/README.md b/maven-modules/maven-custom-plugin/README.md new file mode 100644 index 0000000000..1889036ce3 --- /dev/null +++ b/maven-modules/maven-custom-plugin/README.md @@ -0,0 +1,7 @@ +## Apache Maven + +This module contains articles about creating a custom plugin in Maven. + +### Relevant Articles + +- [How to Create a Maven Plugin](https://www.baeldung.com/maven-plugin) diff --git a/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml b/maven-modules/maven-custom-plugin/counter-maven-plugin/pom.xml similarity index 100% rename from maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml rename to maven-modules/maven-custom-plugin/counter-maven-plugin/pom.xml diff --git a/maven-all/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java b/maven-modules/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java similarity index 100% rename from maven-all/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java rename to maven-modules/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java diff --git a/maven-modules/maven-custom-plugin/pom.xml b/maven-modules/maven-custom-plugin/pom.xml new file mode 100644 index 0000000000..ad22c735ff --- /dev/null +++ b/maven-modules/maven-custom-plugin/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + maven-custom-plugin + 0.0.1-SNAPSHOT + maven-custom-plugin + pom + + + com.baeldung + maven-modules + 0.0.1-SNAPSHOT + + + + counter-maven-plugin + usage-example + + + \ No newline at end of file diff --git a/maven-all/maven-custom-plugin/usage-example/pom.xml b/maven-modules/maven-custom-plugin/usage-example/pom.xml similarity index 97% rename from maven-all/maven-custom-plugin/usage-example/pom.xml rename to maven-modules/maven-custom-plugin/usage-example/pom.xml index ef6f08a3fb..f512fc104d 100644 --- a/maven-all/maven-custom-plugin/usage-example/pom.xml +++ b/maven-modules/maven-custom-plugin/usage-example/pom.xml @@ -5,7 +5,7 @@ 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 - example + usage-example 0.0.1-SNAPSHOT pom diff --git a/maven-modules/maven-exec-plugin/README.md b/maven-modules/maven-exec-plugin/README.md new file mode 100644 index 0000000000..60035b27c4 --- /dev/null +++ b/maven-modules/maven-exec-plugin/README.md @@ -0,0 +1,7 @@ +## Maven WAR Plugin + +This module contains articles about the Maven Exec Plugin. + +### Relevant Articles + +- [Run a Java Main Method in Maven](https://www.baeldung.com/maven-java-main-method) diff --git a/maven-modules/maven-exec-plugin/pom.xml b/maven-modules/maven-exec-plugin/pom.xml new file mode 100644 index 0000000000..6c12971e29 --- /dev/null +++ b/maven-modules/maven-exec-plugin/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.baeldung + maven-exec-plugin + 0.0.1-SNAPSHOT + maven-exec-plugin + + + 3.8.1 + 1.8 + 1.2.3 + + + + + ch.qos.logback + logback-classic + ${logback-classic.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + com.baeldung.main.Exec + + First + Second + Third + + + + + + + diff --git a/maven-modules/maven-exec-plugin/src/main/java/com/baeldung/main/Exec.java b/maven-modules/maven-exec-plugin/src/main/java/com/baeldung/main/Exec.java new file mode 100644 index 0000000000..5a1494cf4a --- /dev/null +++ b/maven-modules/maven-exec-plugin/src/main/java/com/baeldung/main/Exec.java @@ -0,0 +1,18 @@ +package com.baeldung.main; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; + +public class Exec { + + private static final Logger LOGGER = LoggerFactory.getLogger(Exec.class); + + public static void main(String[] args) { + LOGGER.info("Running the main method"); + if (args.length > 0) { + LOGGER.info("List of arguments: {}", Arrays.toString(args)); + } + } +} diff --git a/maven-all/maven/.gitignore b/maven-modules/maven-integration-test/.gitignore similarity index 100% rename from maven-all/maven/.gitignore rename to maven-modules/maven-integration-test/.gitignore diff --git a/maven-modules/maven-integration-test/README.md b/maven-modules/maven-integration-test/README.md new file mode 100644 index 0000000000..e73a73e61e --- /dev/null +++ b/maven-modules/maven-integration-test/README.md @@ -0,0 +1,10 @@ +## Apache Maven + +This module contains articles about Integration Testing with Maven and related plugins. + +### Relevant Articles + +- [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test) +- [Build a Jar with Maven and Ignore the Test Results](https://www.baeldung.com/maven-ignore-test-results) +- [Quick Guide to the Maven Surefire Plugin](https://www.baeldung.com/maven-surefire-plugin) +- [The Maven Failsafe Plugin](https://www.baeldung.com/maven-failsafe-plugin) \ No newline at end of file diff --git a/maven-all/maven/pom.xml b/maven-modules/maven-integration-test/pom.xml similarity index 90% rename from maven-all/maven/pom.xml rename to maven-modules/maven-integration-test/pom.xml index 0220cf8dfc..0031230bb1 100644 --- a/maven-all/maven/pom.xml +++ b/maven-modules/maven-integration-test/pom.xml @@ -2,10 +2,9 @@ 4.0.0 - maven + maven-integration-test 0.0.1-SNAPSHOT - maven - pom + maven-integration-test com.baeldung @@ -14,11 +13,6 @@ ../.. - - custom-rule - maven-enforcer - - org.glassfish.jersey.containers @@ -126,20 +120,6 @@ - - maven-verifier-plugin - ${maven.verifier.version} - - input-resources/verifications.xml - - - - - verify - - - - maven-clean-plugin ${maven.clean.version} @@ -156,17 +136,6 @@ build-helper-maven-plugin ${maven.build.helper.version} - - generate-sources - - add-source - - - - src/main/another-src - - - add-integration-test-source generate-test-sources diff --git a/maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java b/maven-modules/maven-integration-test/src/integration-test/java/com/baeldung/maven/it/RestITCase.java similarity index 100% rename from maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java rename to maven-modules/maven-integration-test/src/integration-test/java/com/baeldung/maven/it/RestITCase.java diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/EndpointConfig.java similarity index 100% rename from maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java rename to maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/EndpointConfig.java diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/RestEndpoint.java similarity index 100% rename from maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java rename to maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/RestEndpoint.java diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/plugins/Data.java similarity index 100% rename from maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java rename to maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/plugins/Data.java diff --git a/apache-bval/src/main/resources/logback.xml b/maven-modules/maven-integration-test/src/main/resources/logback.xml similarity index 100% rename from apache-bval/src/main/resources/logback.xml rename to maven-modules/maven-integration-test/src/main/resources/logback.xml diff --git a/maven-all/maven/src/main/webapp/WEB-INF/web.xml b/maven-modules/maven-integration-test/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from maven-all/maven/src/main/webapp/WEB-INF/web.xml rename to maven-modules/maven-integration-test/src/main/webapp/WEB-INF/web.xml diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/Integration.java similarity index 100% rename from maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java rename to maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/Integration.java diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIT.java similarity index 100% rename from maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java rename to maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIT.java diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java similarity index 100% rename from maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java rename to maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestJUnitTest.java similarity index 100% rename from maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java rename to maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestJUnitTest.java diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataCheck.java similarity index 100% rename from maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java rename to maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataCheck.java diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java similarity index 100% rename from maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java rename to maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java diff --git a/maven-all/maven/src/test/java/testfail/TestFail.java b/maven-modules/maven-integration-test/src/test/java/testfail/TestFail.java similarity index 100% rename from maven-all/maven/src/test/java/testfail/TestFail.java rename to maven-modules/maven-integration-test/src/test/java/testfail/TestFail.java diff --git a/maven-modules/maven-multi-source/.gitignore b/maven-modules/maven-multi-source/.gitignore new file mode 100644 index 0000000000..bae0b0d7ce --- /dev/null +++ b/maven-modules/maven-multi-source/.gitignore @@ -0,0 +1,2 @@ +/output-resources +/.idea/ diff --git a/maven-modules/maven-multi-source/README.md b/maven-modules/maven-multi-source/README.md new file mode 100644 index 0000000000..8298332c04 --- /dev/null +++ b/maven-modules/maven-multi-source/README.md @@ -0,0 +1,7 @@ +## Apache Maven - Multiple Source Directories + +This module contains articles about how to use multiple source directories with Maven. + +### Relevant Articles + +- [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories) \ No newline at end of file diff --git a/maven-modules/maven-multi-source/pom.xml b/maven-modules/maven-multi-source/pom.xml new file mode 100644 index 0000000000..0c85049df7 --- /dev/null +++ b/maven-modules/maven-multi-source/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + maven-multi-source + 0.0.1-SNAPSHOT + maven-multi-source + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + + maven-compiler-plugin + ${maven.compiler.version} + + ${java.version} + ${java.version} + + -Xlint:unchecked + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${maven.build.helper.version} + + + generate-sources + + add-source + + + + src/main/another-src + + + + + + + + + + + surefire + + + + maven-surefire-plugin + ${maven.surefire.version} + + + integration-test + + test + + + + none + + + **/*IntegrationTest + + + + + + + + + + + + 3.0.2 + 3.8.0 + 2.22.0 + 2.22.0 + 1.1 + 3.0.0 + 3.0.0 + 9.4.11.v20180605 + 2.27 + + + \ No newline at end of file diff --git a/maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java b/maven-modules/maven-multi-source/src/main/another-src/com/baeldung/maven/plugins/Foo.java similarity index 100% rename from maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java rename to maven-modules/maven-multi-source/src/main/another-src/com/baeldung/maven/plugins/Foo.java diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java b/maven-modules/maven-multi-source/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java similarity index 100% rename from maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java rename to maven-modules/maven-multi-source/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java diff --git a/apache-curator/src/main/resources/logback.xml b/maven-modules/maven-multi-source/src/main/resources/logback.xml similarity index 100% rename from apache-curator/src/main/resources/logback.xml rename to maven-modules/maven-multi-source/src/main/resources/logback.xml diff --git a/maven-modules/maven-plugins/.gitignore b/maven-modules/maven-plugins/.gitignore new file mode 100644 index 0000000000..bae0b0d7ce --- /dev/null +++ b/maven-modules/maven-plugins/.gitignore @@ -0,0 +1,2 @@ +/output-resources +/.idea/ diff --git a/maven-modules/maven-plugins/README.md b/maven-modules/maven-plugins/README.md new file mode 100644 index 0000000000..4210a3bb20 --- /dev/null +++ b/maven-modules/maven-plugins/README.md @@ -0,0 +1,11 @@ +## Apache Maven + +This module contains articles about the core Maven plugins. Other Maven plugins (such as the Maven WAR Plugin) have their own dedicated modules. + +### Relevant Articles + +- [Guide to the Core Maven Plugins](https://www.baeldung.com/core-maven-plugins) +- [Maven Resources Plugin](https://www.baeldung.com/maven-resources-plugin) +- [The Maven Verifier Plugin](https://www.baeldung.com/maven-verifier-plugin) +- [The Maven Clean Plugin](https://www.baeldung.com/maven-clean-plugin) +- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) diff --git a/maven-all/maven/custom-rule/pom.xml b/maven-modules/maven-plugins/custom-rule/pom.xml similarity index 69% rename from maven-all/maven/custom-rule/pom.xml rename to maven-modules/maven-plugins/custom-rule/pom.xml index 6ff984cb85..0fb551e71b 100644 --- a/maven-all/maven/custom-rule/pom.xml +++ b/maven-modules/maven-plugins/custom-rule/pom.xml @@ -1,19 +1,18 @@ - + 4.0.0 custom-rule custom-rule com.baeldung - maven + maven-plugins 0.0.1-SNAPSHOT - + org.apache.maven.enforcer enforcer-api @@ -46,19 +45,6 @@ - - - - maven-verifier-plugin - ${maven.verifier.version} - - ../input-resources/verifications.xml - false - - - - - 3.0.0-M2 2.0.9 diff --git a/maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java b/maven-modules/maven-plugins/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java similarity index 100% rename from maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java rename to maven-modules/maven-plugins/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java diff --git a/maven-all/maven/input-resources/baeldung.png b/maven-modules/maven-plugins/input-resources/baeldung.png similarity index 100% rename from maven-all/maven/input-resources/baeldung.png rename to maven-modules/maven-plugins/input-resources/baeldung.png diff --git a/maven-all/maven/input-resources/baeldung.txt b/maven-modules/maven-plugins/input-resources/baeldung.txt similarity index 100% rename from maven-all/maven/input-resources/baeldung.txt rename to maven-modules/maven-plugins/input-resources/baeldung.txt diff --git a/maven-all/maven/input-resources/verifications.xml b/maven-modules/maven-plugins/input-resources/verifications.xml similarity index 100% rename from maven-all/maven/input-resources/verifications.xml rename to maven-modules/maven-plugins/input-resources/verifications.xml diff --git a/maven-all/maven/maven-enforcer/README.md b/maven-modules/maven-plugins/maven-enforcer/README.md similarity index 66% rename from maven-all/maven/maven-enforcer/README.md rename to maven-modules/maven-plugins/maven-enforcer/README.md index 7515647a3d..44d43050e7 100644 --- a/maven-all/maven/maven-enforcer/README.md +++ b/maven-modules/maven-plugins/maven-enforcer/README.md @@ -1,3 +1,3 @@ -### Relevant Articles +### Relevant Articles: -- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) \ No newline at end of file +- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) diff --git a/maven-all/maven/maven-enforcer/pom.xml b/maven-modules/maven-plugins/maven-enforcer/pom.xml similarity index 98% rename from maven-all/maven/maven-enforcer/pom.xml rename to maven-modules/maven-plugins/maven-enforcer/pom.xml index cde37eabd1..01f97a061e 100644 --- a/maven-all/maven/maven-enforcer/pom.xml +++ b/maven-modules/maven-plugins/maven-enforcer/pom.xml @@ -8,7 +8,7 @@ com.baeldung - maven + maven-plugins 0.0.1-SNAPSHOT diff --git a/maven-modules/maven-plugins/pom.xml b/maven-modules/maven-plugins/pom.xml new file mode 100644 index 0000000000..43bcf1f422 --- /dev/null +++ b/maven-modules/maven-plugins/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + maven-plugins + 0.0.1-SNAPSHOT + maven-plugins + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + + maven-resources-plugin + ${maven.resources.version} + + output-resources + + + input-resources + + *.png + + true + + + + + + maven-compiler-plugin + ${maven.compiler.version} + + ${java.version} + ${java.version} + + -Xlint:unchecked + + + + + maven-verifier-plugin + ${maven.verifier.version} + + input-resources/verifications.xml + + + + + verify + + + + + + maven-clean-plugin + ${maven.clean.version} + + + + output-resources + + + + + + + + + + default + + + + maven-surefire-plugin + ${maven.surefire.version} + + + DataTest.java + + + TestFail.java + DataCheck.java + + true + + + + + + + surefire + + + + maven-surefire-plugin + ${maven.surefire.version} + + + integration-test + + test + + + + none + + + **/*IntegrationTest + + + + + + + + + + + + 3.0.2 + 3.8.0 + 2.22.0 + 2.22.0 + 1.1 + 3.0.0 + 3.0.0 + + + \ No newline at end of file diff --git a/maven-all/profiles/README.md b/maven-modules/maven-profiles/README.md similarity index 100% rename from maven-all/profiles/README.md rename to maven-modules/maven-profiles/README.md diff --git a/maven-all/profiles/pom.xml b/maven-modules/maven-profiles/pom.xml similarity index 97% rename from maven-all/profiles/pom.xml rename to maven-modules/maven-profiles/pom.xml index 4ae6d1ee40..4937bc7c5d 100644 --- a/maven-all/profiles/pom.xml +++ b/maven-modules/maven-profiles/pom.xml @@ -4,9 +4,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 - profiles + maven-profiles 0.0.1-SNAPSHOT - profiles + maven-profiles diff --git a/maven-modules/maven-properties/.gitignore b/maven-modules/maven-properties/.gitignore new file mode 100644 index 0000000000..bae0b0d7ce --- /dev/null +++ b/maven-modules/maven-properties/.gitignore @@ -0,0 +1,2 @@ +/output-resources +/.idea/ diff --git a/maven-modules/maven-properties/README.md b/maven-modules/maven-properties/README.md new file mode 100644 index 0000000000..52ac8506b3 --- /dev/null +++ b/maven-modules/maven-properties/README.md @@ -0,0 +1,8 @@ +## Apache Maven + +This module contains articles about core Apache Maven. Articles about other Maven plugins (such as the Maven WAR Plugin) +have their own dedicated modules. + +### Relevant Articles + +- [Accessing Maven Properties in Java](https://www.baeldung.com/java-accessing-maven-properties) diff --git a/maven-modules/maven-properties/pom.xml b/maven-modules/maven-properties/pom.xml new file mode 100644 index 0000000000..2cd92da42f --- /dev/null +++ b/maven-modules/maven-properties/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + maven-properties + 0.0.1-SNAPSHOT + maven-properties + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + junit + junit + 4.13 + + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0.0 + + + generate-resources + + write-project-properties + + + ${project.build.outputDirectory}/properties-from-pom.properties + + + + + + + + + ${project.name} + property-from-pom + + + \ No newline at end of file diff --git a/maven-modules/maven-properties/src/main/java/com/baeldung/maven/properties/PropertiesReader.java b/maven-modules/maven-properties/src/main/java/com/baeldung/maven/properties/PropertiesReader.java new file mode 100644 index 0000000000..e7000ec2ce --- /dev/null +++ b/maven-modules/maven-properties/src/main/java/com/baeldung/maven/properties/PropertiesReader.java @@ -0,0 +1,41 @@ +package com.baeldung.maven.properties; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +/** + * Reads properties from one file. + * + * @author Donato Rimenti + */ +public class PropertiesReader { + + /** + * Properties managed by this reader. + */ + private Properties properties; + + /** + * Reads the property file with the given name. + * + * @param propertyFileName the name of the property file to read + * @throws IOException if the file is not found or there's a problem reading it + */ + public PropertiesReader(String propertyFileName) throws IOException { + InputStream is = getClass().getClassLoader() + .getResourceAsStream(propertyFileName); + this.properties = new Properties(); + this.properties.load(is); + } + + /** + * Gets the property with the given name from the property file. + * @param propertyName the name of the property to read + * @return the property with the given name + */ + public String getProperty(String propertyName) { + return this.properties.getProperty(propertyName); + } + +} \ No newline at end of file diff --git a/maven-modules/maven-properties/src/test/java/com/baeldung/maven/properties/PropertiesReaderUnitTest.java b/maven-modules/maven-properties/src/test/java/com/baeldung/maven/properties/PropertiesReaderUnitTest.java new file mode 100644 index 0000000000..a1d6e66047 --- /dev/null +++ b/maven-modules/maven-properties/src/test/java/com/baeldung/maven/properties/PropertiesReaderUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.maven.properties; + +import java.io.IOException; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Test for {@link PropertiesReader}. + * + * @author Donato Rimenti + */ +public class PropertiesReaderUnitTest { + + /** + * Reads a property and checks that's the one expected. + * + * @throws IOException if anything goes wrong + */ + @Test + public void givenPomProperties_whenPropertyRead_thenPropertyReturned() throws IOException { + PropertiesReader reader = new PropertiesReader("properties-from-pom.properties"); + String property = reader.getProperty("my.awesome.property"); + Assert.assertEquals("property-from-pom", property); + } + +} \ No newline at end of file diff --git a/maven-all/maven/proxy/README.md b/maven-modules/maven-proxy/README.md similarity index 100% rename from maven-all/maven/proxy/README.md rename to maven-modules/maven-proxy/README.md diff --git a/maven-all/maven/proxy/settings.xml b/maven-modules/maven-proxy/proxy/settings.xml similarity index 100% rename from maven-all/maven/proxy/settings.xml rename to maven-modules/maven-proxy/proxy/settings.xml diff --git a/maven-all/maven/security/redirect/settings-security.xml b/maven-modules/maven-proxy/security/redirect/settings-security.xml similarity index 100% rename from maven-all/maven/security/redirect/settings-security.xml rename to maven-modules/maven-proxy/security/redirect/settings-security.xml diff --git a/maven-all/maven/security/settings-security.xml b/maven-modules/maven-proxy/security/settings-security.xml similarity index 100% rename from maven-all/maven/security/settings-security.xml rename to maven-modules/maven-proxy/security/settings-security.xml diff --git a/maven-modules/maven-unused-dependencies/README.md b/maven-modules/maven-unused-dependencies/README.md new file mode 100644 index 0000000000..53897e8227 --- /dev/null +++ b/maven-modules/maven-unused-dependencies/README.md @@ -0,0 +1,7 @@ +## Apache Maven + +This module contains articles about Unused Maven Dependencies. + +### Relevant Articles + +- [Find Unused Maven Dependencies](https://www.baeldung.com/maven-unused-dependencies) diff --git a/maven-all/maven-unused-dependencies/pom.xml b/maven-modules/maven-unused-dependencies/pom.xml similarity index 100% rename from maven-all/maven-unused-dependencies/pom.xml rename to maven-modules/maven-unused-dependencies/pom.xml index 825858e481..d98fe83a0e 100644 --- a/maven-all/maven-unused-dependencies/pom.xml +++ b/maven-modules/maven-unused-dependencies/pom.xml @@ -6,13 +6,6 @@ maven-unused-dependencies 0.0.1-SNAPSHOT - - 3.2.2 - 1.7.25 - 3.1.2 - 3.1 - - commons-collections @@ -44,4 +37,11 @@ + + 3.2.2 + 1.7.25 + 3.1.2 + 3.1 + + \ No newline at end of file diff --git a/maven-all/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java b/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java similarity index 100% rename from maven-all/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java rename to maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java diff --git a/maven-all/maven-war-plugin/README.md b/maven-modules/maven-war-plugin/README.md similarity index 100% rename from maven-all/maven-war-plugin/README.md rename to maven-modules/maven-war-plugin/README.md diff --git a/maven-all/maven-war-plugin/pom.xml b/maven-modules/maven-war-plugin/pom.xml similarity index 100% rename from maven-all/maven-war-plugin/pom.xml rename to maven-modules/maven-war-plugin/pom.xml diff --git a/maven-modules/pom.xml b/maven-modules/pom.xml new file mode 100644 index 0000000000..528f44bddc --- /dev/null +++ b/maven-modules/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + maven-modules + 0.0.1-SNAPSHOT + maven-modules + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + maven-custom-plugin + maven-exec-plugin + maven-integration-test + maven-multi-source + maven-plugins + maven-unused-dependencies + maven-war-plugin + maven-profiles + maven-properties + versions-maven-plugin + version-collision + + + diff --git a/maven-modules/version-collision/README.md b/maven-modules/version-collision/README.md new file mode 100644 index 0000000000..a71cfdb0b4 --- /dev/null +++ b/maven-modules/version-collision/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [How to Resolve a Version Collision of Artifacts in Maven](https://www.baeldung.com/maven-version-collision) diff --git a/maven-modules/version-collision/pom.xml b/maven-modules/version-collision/pom.xml new file mode 100644 index 0000000000..6d8441aa7b --- /dev/null +++ b/maven-modules/version-collision/pom.xml @@ -0,0 +1,54 @@ + + + + maven-modules + com.baeldung + 0.0.1-SNAPSHOT + + 4.0.0 + + version-collision + pom + + project-a + project-b + project-collision + + + + + + + com.google.guava + guava + 29.0-jre + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maven-modules/version-collision/project-a/pom.xml b/maven-modules/version-collision/project-a/pom.xml new file mode 100644 index 0000000000..1b7af7e963 --- /dev/null +++ b/maven-modules/version-collision/project-a/pom.xml @@ -0,0 +1,21 @@ + + + + version-collision + com.baeldung + 0.0.1-SNAPSHOT + + 4.0.0 + + project-a + + + + com.google.guava + guava + 22.0 + + + \ No newline at end of file diff --git a/maven-modules/version-collision/project-b/pom.xml b/maven-modules/version-collision/project-b/pom.xml new file mode 100644 index 0000000000..0b0f50aeb8 --- /dev/null +++ b/maven-modules/version-collision/project-b/pom.xml @@ -0,0 +1,21 @@ + + + + version-collision + com.baeldung + 0.0.1-SNAPSHOT + + 4.0.0 + + project-b + + + + com.google.guava + guava + 29.0-jre + + + \ No newline at end of file diff --git a/maven-modules/version-collision/project-collision/pom.xml b/maven-modules/version-collision/project-collision/pom.xml new file mode 100644 index 0000000000..3bec0ed54a --- /dev/null +++ b/maven-modules/version-collision/project-collision/pom.xml @@ -0,0 +1,34 @@ + + + + version-collision + com.baeldung + 0.0.1-SNAPSHOT + + 4.0.0 + + project-collision + + + + + com.baeldung + project-a + 0.0.1-SNAPSHOT + + + + + + + + + + com.baeldung + project-b + 0.0.1-SNAPSHOT + + + \ No newline at end of file diff --git a/maven-modules/version-collision/project-collision/src/test/java/com/baeldung/version/collision/VersionCollisionUnitTest.java b/maven-modules/version-collision/project-collision/src/test/java/com/baeldung/version/collision/VersionCollisionUnitTest.java new file mode 100644 index 0000000000..de0b3a7776 --- /dev/null +++ b/maven-modules/version-collision/project-collision/src/test/java/com/baeldung/version/collision/VersionCollisionUnitTest.java @@ -0,0 +1,14 @@ +package com.baeldung.version.collision; + +import com.google.common.util.concurrent.Futures; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.junit.Assert.assertThat; + +public class VersionCollisionUnitTest { + @Test + public void whenVersionCollisionDoesNotExist_thenShouldCompile() { + assertThat(Futures.immediateVoidFuture(), notNullValue()); + } +} \ No newline at end of file diff --git a/maven-all/versions-maven-plugin/README.md b/maven-modules/versions-maven-plugin/README.md similarity index 100% rename from maven-all/versions-maven-plugin/README.md rename to maven-modules/versions-maven-plugin/README.md diff --git a/maven-all/versions-maven-plugin/original/pom.xml b/maven-modules/versions-maven-plugin/original/pom.xml similarity index 100% rename from maven-all/versions-maven-plugin/original/pom.xml rename to maven-modules/versions-maven-plugin/original/pom.xml diff --git a/maven-all/versions-maven-plugin/pom.xml b/maven-modules/versions-maven-plugin/pom.xml similarity index 100% rename from maven-all/versions-maven-plugin/pom.xml rename to maven-modules/versions-maven-plugin/pom.xml diff --git a/maven-all/versions-maven-plugin/run-the-demo.sh b/maven-modules/versions-maven-plugin/run-the-demo.sh similarity index 100% rename from maven-all/versions-maven-plugin/run-the-demo.sh rename to maven-modules/versions-maven-plugin/run-the-demo.sh diff --git a/micronaut/pom.xml b/micronaut/pom.xml index 2cb05cc1b9..d6df6a0347 100644 --- a/micronaut/pom.xml +++ b/micronaut/pom.xml @@ -144,7 +144,6 @@ 1.8 1.3.2 1.2.3 - 4.12 3.1.6.RELEASE 3.7.0 1.6.0 diff --git a/muleesb/pom.xml b/muleesb/pom.xml index e7c7e50cbe..f6cfa7d5d1 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -187,13 +187,13 @@ Central Central - http://repo1.maven.org/maven2/ + https://repo1.maven.org/maven2/ default mulesoft-releases MuleSoft Releases Repository - http://repository.mulesoft.org/releases/ + https://repository.mulesoft.org/releases/ default @@ -203,7 +203,7 @@ mulesoft-release mulesoft release repository default - http://repository.mulesoft.org/releases/ + https://repository.mulesoft.org/releases/ false diff --git a/netflix-modules/README.md b/netflix-modules/README.md index 7f7a9656fb..c126bbdf5b 100644 --- a/netflix-modules/README.md +++ b/netflix-modules/README.md @@ -2,6 +2,3 @@ This module contains articles about Netflix. -### Relevant articles - -- [Introduction to Netflix Genie](https://www.baeldung.com/netflix-genie-intro) diff --git a/netflix-modules/genie/README.md b/netflix-modules/genie/README.md new file mode 100644 index 0000000000..f6e15ba403 --- /dev/null +++ b/netflix-modules/genie/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Introduction to Netflix Genie](https://www.baeldung.com/netflix-genie-intro) diff --git a/netty/README.md b/netty/README.md index 30c63cd5a8..3e864ff795 100644 --- a/netty/README.md +++ b/netty/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [HTTP/2 in Netty](https://www.baeldung.com/netty-http2) +- [HTTP Server with Netty](https://www.baeldung.com/java-netty-http-server) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index c7bb11b1d5..ed0f327b8c 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -31,6 +31,7 @@ io.rest-assured rest-assured + ${rest-assured.version} org.springframework.boot @@ -82,6 +83,7 @@ 1.0.22.RELEASE 2.2.6.RELEASE + 1.9.1 diff --git a/parent-java/pom.xml b/parent-java/pom.xml index baad9fecf4..d251adcdd3 100644 --- a/parent-java/pom.xml +++ b/parent-java/pom.xml @@ -42,11 +42,10 @@ - 23.0 + 29.0-jre 2.6 1.19 2.3.7 - 4.12 2.2 diff --git a/parent-kotlin/pom.xml b/parent-kotlin/pom.xml index 52a753439c..947dd20483 100644 --- a/parent-kotlin/pom.xml +++ b/parent-kotlin/pom.xml @@ -26,7 +26,7 @@ kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap + https://dl.bintray.com/kotlin/kotlin-eap spring-milestone @@ -38,7 +38,7 @@ kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap + https://dl.bintray.com/kotlin/kotlin-eap diff --git a/parent-spring-5/pom.xml b/parent-spring-5/pom.xml index c75655ebc8..949e40b021 100644 --- a/parent-spring-5/pom.xml +++ b/parent-spring-5/pom.xml @@ -33,6 +33,7 @@ 5.2.5.RELEASE 5.2.3.RELEASE + 1.5.10.RELEASE \ No newline at end of file diff --git a/patterns/cqrs-es/pom.xml b/patterns/cqrs-es/pom.xml index 3c54038837..0829e35f34 100644 --- a/patterns/cqrs-es/pom.xml +++ b/patterns/cqrs-es/pom.xml @@ -1,30 +1,36 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 cqrs-es 1.0-SNAPSHOT cqrs-es + com.baeldung patterns 1.0.0-SNAPSHOT - - 1.8 - 1.8 - + org.projectlombok lombok - 1.18.12 + ${lombok.version} junit junit - 4.13 + ${junit.version} test + + + 1.8 + 1.8 + 4.13 + 1.18.12 + + \ No newline at end of file diff --git a/patterns/hexagonal-architecture/pom.xml b/patterns/hexagonal-architecture/pom.xml new file mode 100644 index 0000000000..9317a25e56 --- /dev/null +++ b/patterns/hexagonal-architecture/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + + + com.baeldung + hexagonal-architecture + 1.0 + hexagonal-architecture + Project for hexagonal architecture in java + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.mockito + mockito-core + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java new file mode 100644 index 0000000000..52aaefaaf7 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java @@ -0,0 +1,13 @@ +package com.baeldung.pattern.hexagonal; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HexArchApplicationDemo { + + public static void main(String[] args) { + SpringApplication.run(HexArchApplicationDemo.class, args); + } + +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java new file mode 100644 index 0000000000..ee8a01d0e2 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java @@ -0,0 +1,15 @@ +package com.baeldung.pattern.hexagonal.config; + +import com.baeldung.pattern.hexagonal.domain.services.EmployeeService; +import com.baeldung.pattern.hexagonal.domain.services.EmployeeServiceImpl; +import com.baeldung.pattern.hexagonal.persistence.EmployeeRepository; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class AppConfig { + @Bean + public EmployeeService getEmployeeService(EmployeeRepository employeeRepository) { + return new EmployeeServiceImpl(employeeRepository); + } +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java new file mode 100644 index 0000000000..fa6980824a --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java @@ -0,0 +1,10 @@ +package com.baeldung.pattern.hexagonal.config; + +import com.baeldung.pattern.hexagonal.persistence.MongoRepoEx; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; + +@Configuration +@EnableMongoRepositories(basePackageClasses = MongoRepoEx.class) +public class MongoConfig { +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java new file mode 100644 index 0000000000..077fc6fdea --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java @@ -0,0 +1,25 @@ +package com.baeldung.pattern.hexagonal.controller; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; +import com.baeldung.pattern.hexagonal.domain.services.EmployeeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/employees") +public class EmployeeController { + @Autowired + EmployeeService employeeService; + + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public Employee addEmployee(@RequestBody Employee employee) { + return employeeService.addEmployee(employee); + } + + @GetMapping(path = "/{employeeId}") + public Employee getEmployee(@PathVariable("employeeId") String employeeId) { + return employeeService.getEmployee(employeeId); + } +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java new file mode 100644 index 0000000000..de1f15cf53 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java @@ -0,0 +1,51 @@ +package com.baeldung.pattern.hexagonal.domain.model; + +import org.springframework.data.annotation.Id; + +import java.util.Objects; + +public class Employee { + @Id + private String empId; + private String empName; + private String empJobTitle; + + public String getEmpId() { + return empId; + } + + public void setEmpId(String empId) { + this.empId = empId; + } + + public String getEmpName() { + return empName; + } + + public void setEmpName(String empName) { + this.empName = empName; + } + + public String getEmpJobTitle() { + return empJobTitle; + } + + public void setEmpJobTitle(String empJobTitle) { + this.empJobTitle = empJobTitle; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Employee employee = (Employee) o; + return empId.equals(employee.empId); + } + + @Override + public int hashCode() { + return Objects.hash(empId); + } +} \ No newline at end of file diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java new file mode 100644 index 0000000000..902abefabb --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java @@ -0,0 +1,10 @@ +package com.baeldung.pattern.hexagonal.domain.services; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; + +public interface EmployeeService { + + Employee addEmployee(Employee employee); + + Employee getEmployee(String employeeId); +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java new file mode 100644 index 0000000000..cd7c30ff30 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java @@ -0,0 +1,34 @@ +package com.baeldung.pattern.hexagonal.domain.services; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; +import com.baeldung.pattern.hexagonal.persistence.EmployeeRepository; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Optional; + +public class EmployeeServiceImpl implements EmployeeService { + + private EmployeeRepository employeeRepository; + + @Autowired + public EmployeeServiceImpl(EmployeeRepository employeeRepository) { + this.employeeRepository = employeeRepository; + } + + @Override + public Employee addEmployee(Employee employee) { + return employeeRepository.add(employee); + } + + @Override + public Employee getEmployee(String employeeId) { + Optional employee = employeeRepository.findById(employeeId); + + if (employee.isPresent()) { + return employee.get(); + } else { + // throw + } + return null; + } +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java new file mode 100644 index 0000000000..53b4b6d276 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java @@ -0,0 +1,15 @@ +package com.baeldung.pattern.hexagonal.persistence; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +@Repository +public interface EmployeeRepository { + + Employee add(Employee employee); + + Optional findById(String id); + +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java new file mode 100644 index 0000000000..08f0c96ab0 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java @@ -0,0 +1,24 @@ +package com.baeldung.pattern.hexagonal.persistence; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +@Repository +public class MongoDBRepository implements EmployeeRepository { + + @Autowired + MongoRepoEx mongoRepository; + + @Override + public Employee add(Employee employee) { + return mongoRepository.insert(employee); + } + + @Override + public Optional findById(String id) { + return mongoRepository.findById(id); + } +} diff --git a/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java new file mode 100644 index 0000000000..766444c22f --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java @@ -0,0 +1,9 @@ +package com.baeldung.pattern.hexagonal.persistence; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface MongoRepoEx extends MongoRepository { +} diff --git a/patterns/hexagonal-architecture/src/main/resources/application.properties b/patterns/hexagonal-architecture/src/main/resources/application.properties new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/patterns/hexagonal-architecture/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/patterns/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplTest.java b/patterns/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplTest.java new file mode 100644 index 0000000000..cadb3b094b --- /dev/null +++ b/patterns/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplTest.java @@ -0,0 +1,46 @@ +package com.baeldung.pattern.hexagonal.domain.services; + +import com.baeldung.pattern.hexagonal.domain.model.Employee; +import com.baeldung.pattern.hexagonal.persistence.EmployeeRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +class EmployeeServiceImplTest { + + private EmployeeRepository employeeRepository; + private EmployeeService testService; + private Employee testModel; + + @BeforeEach + void setUp() { + employeeRepository = mock(EmployeeRepository.class); + + testService = new EmployeeServiceImpl(employeeRepository); + testModel = new Employee(); + testModel.setEmpId("2000"); + testModel.setEmpName("Test user 1"); + testModel.setEmpJobTitle("Software engineer"); + } + + @Test + void addEmployee() { + when(employeeRepository.add(any(Employee.class))).thenReturn(testModel); + + Employee testResponse = testService.addEmployee(testModel); + assertEquals(testModel, testResponse); + } + + @Test + void getEmployee() { + when(employeeRepository.findById("2000")).thenReturn(Optional.of(testModel)); + + Employee testResponse = testService.getEmployee("2000"); + assertEquals(testModel, testResponse); + } +} \ No newline at end of file diff --git a/patterns/solid/README.md b/patterns/solid/README.md index f5146732a0..41e986f544 100644 --- a/patterns/solid/README.md +++ b/patterns/solid/README.md @@ -3,3 +3,4 @@ - [A Solid Guide to Solid Principles](https://www.baeldung.com/solid-principles) - [Single Responsibility Principle in Java](https://www.baeldung.com/java-single-responsibility-principle) - [Open/Closed Principle in Java](https://www.baeldung.com/java-open-closed-principle) +- [Interface Segregation Principle in Java](https://www.baeldung.com/java-interface-segregation) diff --git a/patterns/solid/src/main/java/com/baeldung/i/fixed/Bank.java b/patterns/solid/src/main/java/com/baeldung/i/fixed/Bank.java new file mode 100644 index 0000000000..7d1c93e83f --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/fixed/Bank.java @@ -0,0 +1,5 @@ +package com.baeldung.i.fixed; + +public interface Bank extends Payment { + void initiatePayments(); +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/fixed/BankPayment.java b/patterns/solid/src/main/java/com/baeldung/i/fixed/BankPayment.java new file mode 100644 index 0000000000..f077a6772b --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/fixed/BankPayment.java @@ -0,0 +1,21 @@ +package com.baeldung.i.fixed; + +import java.util.List; + +public class BankPayment implements Bank { + + @Override + public void initiatePayments() { + + } + + @Override + public Object status() { + return null; + } + + @Override + public List getPayments() { + return null; + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/fixed/Loan.java b/patterns/solid/src/main/java/com/baeldung/i/fixed/Loan.java new file mode 100644 index 0000000000..74141113db --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/fixed/Loan.java @@ -0,0 +1,6 @@ +package com.baeldung.i.fixed; + +public interface Loan extends Payment { + void intiateLoanSettlement(); + void initiateRePayment(); +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/fixed/LoanPayment.java b/patterns/solid/src/main/java/com/baeldung/i/fixed/LoanPayment.java new file mode 100644 index 0000000000..b6c32d7730 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/fixed/LoanPayment.java @@ -0,0 +1,26 @@ +package com.baeldung.i.fixed; + +import java.util.List; + +public class LoanPayment implements Loan { + + @Override + public void intiateLoanSettlement() { + + } + + @Override + public void initiateRePayment() { + + } + + @Override + public Object status() { + return null; + } + + @Override + public List getPayments() { + return null; + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/fixed/Payment.java b/patterns/solid/src/main/java/com/baeldung/i/fixed/Payment.java new file mode 100644 index 0000000000..620c944944 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/fixed/Payment.java @@ -0,0 +1,8 @@ +package com.baeldung.i.fixed; + +import java.util.List; + +public interface Payment { + Object status(); + List getPayments(); +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/polluted/BankPayment.java b/patterns/solid/src/main/java/com/baeldung/i/polluted/BankPayment.java new file mode 100644 index 0000000000..c8f667c25f --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/polluted/BankPayment.java @@ -0,0 +1,32 @@ +package com.baeldung.i.polluted; + +import java.util.Collections; +import java.util.List; + +public class BankPayment implements Payment { + + @Override + public void initiatePayments() { + + } + + @Override + public Object status() { + return null; + } + + @Override + public List getPayments() { + return Collections.emptyList(); + } + + @Override + public void intiateLoanSettlement() { + throw new UnsupportedOperationException("This is not a loan payment"); + } + + @Override + public void initiateRePayment() { + throw new UnsupportedOperationException("This is not a loan payment"); + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/polluted/LoanPayment.java b/patterns/solid/src/main/java/com/baeldung/i/polluted/LoanPayment.java new file mode 100644 index 0000000000..8535d7ad0a --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/polluted/LoanPayment.java @@ -0,0 +1,31 @@ +package com.baeldung.i.polluted; + +import java.util.List; + +public class LoanPayment implements Payment { + + @Override + public void initiatePayments() { + + } + + @Override + public Object status() { + return null; + } + + @Override + public List getPayments() { + return null; + } + + @Override + public void intiateLoanSettlement() { + + } + + @Override + public void initiateRePayment() { + + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/i/polluted/Payment.java b/patterns/solid/src/main/java/com/baeldung/i/polluted/Payment.java new file mode 100644 index 0000000000..987b4cee33 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/i/polluted/Payment.java @@ -0,0 +1,13 @@ +package com.baeldung.i.polluted; + +import java.util.List; + +public interface Payment { + void initiatePayments(); + Object status(); + List getPayments(); + + //Loan related methods + void intiateLoanSettlement(); + void initiateRePayment(); +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/Account.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/Account.java new file mode 100644 index 0000000000..3a8260924b --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/Account.java @@ -0,0 +1,17 @@ +package com.baeldung.l.advanced; + +import java.math.BigDecimal; + +public abstract class Account { + protected abstract void deposit(BigDecimal amount); + + /** + * Reduces the account balance by the specified amount + * provided given amount > 0 and account meets minimum available + * balance criteria. + * + * @param amount + */ + protected abstract void withdraw(BigDecimal amount); + +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/BankingAppWithdrawalService.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/BankingAppWithdrawalService.java new file mode 100644 index 0000000000..6689b1dc8c --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/BankingAppWithdrawalService.java @@ -0,0 +1,15 @@ +package com.baeldung.l.advanced; + +import java.math.BigDecimal; + +public class BankingAppWithdrawalService { + private Account account; + + public BankingAppWithdrawalService(Account account) { + this.account = account; + } + + public void withdraw(BigDecimal amount) { + account.withdraw(amount); + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/Bar.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/Bar.java new file mode 100644 index 0000000000..8f421cebaa --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/Bar.java @@ -0,0 +1,27 @@ +package com.baeldung.l.advanced; + +public class Bar extends Foo { + + @Override + // precondition: 0 < num <= 10 + public void doStuff(int num) { + if (num <= 0 || num > 10) { + throw new IllegalArgumentException("Input out of range 1-10"); + } + // some logic here... + } + + @Override + // precondition: 0 < num <= 3 + public void doOtherStuff(int num) { + if (num <= 0 || num > 3) { + throw new IllegalArgumentException("Input out of range 1-3"); + } + // some logic here... + } + + @Override + public Integer generateNumber() { + return new Integer(10); + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/Car.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/Car.java new file mode 100644 index 0000000000..48688d9a45 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/Car.java @@ -0,0 +1,26 @@ +package com.baeldung.l.advanced; + +public abstract class Car { + protected int limit; + + // invariant: speed < limit; + protected int speed; + + // Allowed to be set once at the time of creation. + // Value can only increment thereafter. + // Value cannot be reset. + protected int mileage; + + public Car(int mileage) { + this.mileage = mileage; + } + + protected abstract void turnOnEngine(); + + // postcondition: speed < limit + protected abstract void accelerate(); + + // postcondition: speed must reduce + protected abstract void brake(); + +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/CurrentAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/CurrentAccount.java new file mode 100644 index 0000000000..7187582126 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/CurrentAccount.java @@ -0,0 +1,15 @@ +package com.baeldung.l.advanced; + +import java.math.BigDecimal; + +public class CurrentAccount extends Account { + @Override + protected void deposit(BigDecimal amount) { + // Deposit into CurrentAccount + } + + @Override + protected void withdraw(BigDecimal amount) { + // Withdraw from CurrentAccount + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/ElectricCar.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/ElectricCar.java new file mode 100644 index 0000000000..ca78af633f --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/ElectricCar.java @@ -0,0 +1,23 @@ +package com.baeldung.l.advanced; + +public class ElectricCar extends Car { + + public ElectricCar(int mileage) { + super(mileage); + } + + @Override + protected void turnOnEngine() { + throw new AssertionError("I am an Electric Car. I don't have an engine!"); + } + + @Override + protected void accelerate() { + // this acceleration is crazy! + } + + @Override + protected void brake() { + // Apply ElectricCar brake + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/FilePurgingJob.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/FilePurgingJob.java new file mode 100644 index 0000000000..57334696b0 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/FilePurgingJob.java @@ -0,0 +1,18 @@ +package com.baeldung.l.advanced; + +import java.io.IOException; + +public class FilePurgingJob { + private FileSystem fileSystem; + + public FilePurgingJob(FileSystem fileSystem) { + this.fileSystem = fileSystem; + } + + public void purgeOldestFile(String path) throws IOException { + if (!(fileSystem instanceof ReadOnlyFileSystem)) { + // code to detect oldest file + fileSystem.deleteFile(path); + } + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/FileSystem.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/FileSystem.java new file mode 100644 index 0000000000..00a8fb8ec7 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/FileSystem.java @@ -0,0 +1,10 @@ +package com.baeldung.l.advanced; + +import java.io.File; +import java.io.IOException; + +public interface FileSystem { + File[] listFiles(String path); + + void deleteFile(String path) throws IOException; +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/FixedTermDepositAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/FixedTermDepositAccount.java new file mode 100644 index 0000000000..50dd4f3d17 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/FixedTermDepositAccount.java @@ -0,0 +1,15 @@ +package com.baeldung.l.advanced; + +import java.math.BigDecimal; + +public class FixedTermDepositAccount extends Account { + @Override + protected void deposit(BigDecimal amount) { + // Deposit into this account + } + + @Override + protected void withdraw(BigDecimal amount) { + throw new UnsupportedOperationException("Withdrawals are not supported by FixedTermDepositAccount!!"); + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/Foo.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/Foo.java new file mode 100644 index 0000000000..f61577c18f --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/Foo.java @@ -0,0 +1,22 @@ +package com.baeldung.l.advanced; + +public abstract class Foo { + + // precondition: 0 < num <=5 + public void doStuff(int num) { + if (num <= 0 || num > 5) { + throw new IllegalArgumentException("Input out of range 1-5"); + } + // some logic here... + } + + // precondition: 0 < num <=5 + public void doOtherStuff(int num) { + if (num <= 0 || num > 5) { + throw new IllegalArgumentException("Input out of range 1-5"); + } + // some logic here... + } + + public abstract Number generateNumber(); +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/HybridCar.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/HybridCar.java new file mode 100644 index 0000000000..ea643a7419 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/HybridCar.java @@ -0,0 +1,28 @@ +package com.baeldung.l.advanced; + +public class HybridCar extends Car { + // invariant: charge >= 0; + private int charge; + + public HybridCar(int mileage) { + super(mileage); + } + + @Override + protected void turnOnEngine() { + // Start HybridCar + } + + @Override + // postcondition: speed < limit + protected void accelerate() { + // Accelerate HybridCar speed < limit + } + + @Override + // postcondition: speed must reduce + // postcondition: charge must increase + protected void brake() { + // Apply HybridCar brake + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/MotorCar.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/MotorCar.java new file mode 100644 index 0000000000..68a54966cc --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/MotorCar.java @@ -0,0 +1,25 @@ +package com.baeldung.l.advanced; + +public class MotorCar extends Car { + + public MotorCar(int mileage) { + super(mileage); + } + + @Override + protected void turnOnEngine() { + // Start MotorCar + } + + @Override + // postcondition: speed < limit + protected void accelerate() { + // Accelerate MotorCar + } + + @Override + // postcondition: speed must reduce + protected void brake() { + // Apply MotorCar brake + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/ReadOnlyFileSystem.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/ReadOnlyFileSystem.java new file mode 100644 index 0000000000..6ba3d9770d --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/ReadOnlyFileSystem.java @@ -0,0 +1,16 @@ +package com.baeldung.l.advanced; + +import java.io.File; +import java.io.IOException; + +public class ReadOnlyFileSystem implements FileSystem { + public File[] listFiles(String path) { + // code to list files + return new File[0]; + } + + public void deleteFile(String path) throws IOException { + // Do nothing. + // deleteFile operation is not supported on a read-only file system + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/SavingsAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/SavingsAccount.java new file mode 100644 index 0000000000..8dbb5eb4d4 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/SavingsAccount.java @@ -0,0 +1,15 @@ +package com.baeldung.l.advanced; + +import java.math.BigDecimal; + +public class SavingsAccount extends Account { + @Override + protected void deposit(BigDecimal amount) { + // Deposit into SavingsAccount + } + + @Override + protected void withdraw(BigDecimal amount) { + // Withdraw from SavingsAccount + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/ToyCar.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/ToyCar.java new file mode 100644 index 0000000000..a41694deef --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/ToyCar.java @@ -0,0 +1,24 @@ +package com.baeldung.l.advanced; + +public class ToyCar extends Car { + + public ToyCar(int mileage) { + super(mileage); + } + + protected void turnOnEngine() { + + } + + protected void accelerate() { + + } + + protected void brake() { + + } + + public void reset() { + mileage = 0; + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/Account.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/Account.java new file mode 100644 index 0000000000..cb950df164 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/Account.java @@ -0,0 +1,7 @@ +package com.baeldung.l.advanced.refactored; + +import java.math.BigDecimal; + +public abstract class Account { + protected abstract void deposit(BigDecimal amount); +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/BankingAppWithdrawalService.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/BankingAppWithdrawalService.java new file mode 100644 index 0000000000..cbb375dd52 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/BankingAppWithdrawalService.java @@ -0,0 +1,17 @@ +package com.baeldung.l.advanced.refactored; + +import com.baeldung.l.advanced.Account; + +import java.math.BigDecimal; + +public class BankingAppWithdrawalService { + private WithdrawableAccount withdrawableAccount; + + public BankingAppWithdrawalService(WithdrawableAccount withdrawableAccount) { + this.withdrawableAccount = withdrawableAccount; + } + + public void withdraw(BigDecimal amount) { + withdrawableAccount.withdraw(amount); + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/CurrentAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/CurrentAccount.java new file mode 100644 index 0000000000..5b5b9efe04 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/CurrentAccount.java @@ -0,0 +1,13 @@ +package com.baeldung.l.advanced.refactored; + +import java.math.BigDecimal; + +public class CurrentAccount extends WithdrawableAccount { + protected void deposit(BigDecimal amount) { + // Deposit into CurrentAccount + } + + protected void withdraw(BigDecimal amount) { + // Withdraw from CurrentAccount + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/FixedTermDepositAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/FixedTermDepositAccount.java new file mode 100644 index 0000000000..14461b85a3 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/FixedTermDepositAccount.java @@ -0,0 +1,9 @@ +package com.baeldung.l.advanced.refactored; + +import java.math.BigDecimal; + +public class FixedTermDepositAccount extends Account { + protected void deposit(BigDecimal amount) { + // Deposit into this account + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/SavingsAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/SavingsAccount.java new file mode 100644 index 0000000000..45c50079bf --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/SavingsAccount.java @@ -0,0 +1,13 @@ +package com.baeldung.l.advanced.refactored; + +import java.math.BigDecimal; + +public class SavingsAccount extends WithdrawableAccount { + protected void deposit(BigDecimal amount) { + // Deposit into SavingsAccount + } + + protected void withdraw(BigDecimal amount) { + // Withdraw from SavingsAccount + } +} diff --git a/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/WithdrawableAccount.java b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/WithdrawableAccount.java new file mode 100644 index 0000000000..b3c7606cb7 --- /dev/null +++ b/patterns/solid/src/main/java/com/baeldung/l/advanced/refactored/WithdrawableAccount.java @@ -0,0 +1,14 @@ +package com.baeldung.l.advanced.refactored; + +import java.math.BigDecimal; + +public abstract class WithdrawableAccount extends Account { + /** + * Reduces the account balance by the specified amount + * provided given amount > 0 and account meets minimum available + * balance criteria. + * + * @param amount + */ + protected abstract void withdraw(BigDecimal amount); +} diff --git a/pdf/README.md b/pdf/README.md index b904b101fb..bed468ad24 100644 --- a/pdf/README.md +++ b/pdf/README.md @@ -6,3 +6,4 @@ This module contains articles about PDF files. - [PDF Conversions in Java](https://www.baeldung.com/pdf-conversions-java) - [Creating PDF Files in Java](https://www.baeldung.com/java-pdf-creation) - [Generating PDF Files Using Thymeleaf](https://www.baeldung.com/thymeleaf-generate-pdf) +- [Java Convert PDF to Base64](https://www.baeldung.com/java-convert-pdf-to-base64) diff --git a/pdf/pom.xml b/pdf/pom.xml index 463c88948d..7d7754ee73 100644 --- a/pdf/pom.xml +++ b/pdf/pom.xml @@ -63,12 +63,12 @@ org.thymeleaf thymeleaf - 3.0.11.RELEASE + ${thymeleaf.version} org.xhtmlrenderer flying-saucer-pdf - 9.1.20 + ${flying-saucer-pdf.version} @@ -90,6 +90,8 @@ 3.15 1.8 3.15 + 3.0.11.RELEASE + 9.1.20 diff --git a/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java b/pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java similarity index 94% rename from core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java rename to pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java index 0df6f58136..db76f9a0c8 100644 --- a/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java +++ b/pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java @@ -1,8 +1,7 @@ package com.baeldung.pdf.base64; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import org.junit.BeforeClass; +import org.junit.Test; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -11,8 +10,7 @@ import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Paths; -import org.junit.BeforeClass; -import org.junit.Test; +import static org.junit.Assert.*; public class EncodeDecodeUnitTest { diff --git a/core-java-modules/core-java-string-operations-2/src/test/resources/input.pdf b/pdf/src/test/resources/input.pdf similarity index 100% rename from core-java-modules/core-java-string-operations-2/src/test/resources/input.pdf rename to pdf/src/test/resources/input.pdf diff --git a/core-java-modules/core-java-string-operations-2/src/test/resources/output.pdf b/pdf/src/test/resources/output.pdf similarity index 100% rename from core-java-modules/core-java-string-operations-2/src/test/resources/output.pdf rename to pdf/src/test/resources/output.pdf diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index c8cebd8a11..c790dbbb16 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -65,44 +65,6 @@ - - UTF-8 - - - 1.21 - 1.5.2 - 5.5.1 - 1.0.2 - 1.2.0.Final - 1.1.0 - 1.6.0.1 - 1.8 - 1.2.0.Final - 1.21 - 1.21 - 3.7.0 - - - 1.8 - - - benchmarks - 3.1 - 2.2 - 2.5.1 - 2.4 - 2.9.1 - 2.6 - 3.3 - 2.2.1 - 2.17 - @@ -158,6 +120,18 @@ + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + com.baeldung.performancetests.MappingFrameworksPerformance + + + + @@ -201,4 +175,41 @@ + + + 1.21 + 1.5.2 + 5.5.1 + 1.0.2 + 1.2.0.Final + 1.1.0 + 1.6.0.1 + 1.2.0.Final + 1.21 + 1.21 + 3.7.0 + 3.2.0 + + + 1.8 + + + benchmarks + 3.1 + 2.2 + 2.5.1 + 2.4 + 2.9.1 + 2.6 + 3.3 + 2.2.1 + 2.17 + + diff --git a/performance-tests/src/main/java/com/baeldung/performancetests/exception/ExceptionBenchmark.java b/performance-tests/src/main/java/com/baeldung/performancetests/exception/ExceptionBenchmark.java new file mode 100644 index 0000000000..09965e9130 --- /dev/null +++ b/performance-tests/src/main/java/com/baeldung/performancetests/exception/ExceptionBenchmark.java @@ -0,0 +1,69 @@ +package com.baeldung.performancetests.exception; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +import java.util.concurrent.TimeUnit; + +@Fork(1) +@Warmup(iterations = 2) +@Measurement(iterations = 10) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class ExceptionBenchmark { + private static final int LIMIT = 10_000; + + @Benchmark + public void doNotThrowException(Blackhole blackhole) { + for (int i = 0; i < LIMIT; i++) { + blackhole.consume(new Object()); + } + } + + @Benchmark + public void throwAndCatchException(Blackhole blackhole) { + for (int i = 0; i < LIMIT; i++) { + try { + throw new Exception(); + } catch (Exception e) { + blackhole.consume(e); + } + } + } + + @Benchmark + public void createExceptionWithoutThrowingIt(Blackhole blackhole) { + for (int i = 0; i < LIMIT; i++) { + blackhole.consume(new Exception()); + } + } + + @Benchmark + @Fork(value = 1, jvmArgs = "-XX:-StackTraceInThrowable") + public void throwExceptionWithoutAddingStackTrace(Blackhole blackhole) { + for (int i = 0; i < LIMIT; i++) { + try { + throw new Exception(); + } catch (Exception e) { + blackhole.consume(e); + } + } + } + + @Benchmark + public void throwExceptionAndUnwindStackTrace(Blackhole blackhole) { + for (int i = 0; i < LIMIT; i++) { + try { + throw new Exception(); + } catch (Exception e) { + blackhole.consume(e.getStackTrace()); + } + } + } +} diff --git a/persistence-modules/apache-bookkeeper/README.md b/persistence-modules/apache-bookkeeper/README.md new file mode 100644 index 0000000000..aaaade6450 --- /dev/null +++ b/persistence-modules/apache-bookkeeper/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Guide to Apache BookKeeper](https://www.baeldung.com/java-apache-bookkeeper) diff --git a/persistence-modules/apache-bookkeeper/data/.gitignore b/persistence-modules/apache-bookkeeper/data/.gitignore new file mode 100644 index 0000000000..43a3e42263 --- /dev/null +++ b/persistence-modules/apache-bookkeeper/data/.gitignore @@ -0,0 +1,5 @@ +bk/bookkeeper/* +bk1/bookkeeper/* +bk2/bookkeeper/* +zk/* + diff --git a/persistence-modules/apache-bookkeeper/data/bk1/.gitignore b/persistence-modules/apache-bookkeeper/data/bk1/.gitignore new file mode 100644 index 0000000000..32c9297ccd --- /dev/null +++ b/persistence-modules/apache-bookkeeper/data/bk1/.gitignore @@ -0,0 +1 @@ +/bookkeeper/ diff --git a/persistence-modules/apache-bookkeeper/data/bk2/.gitignore b/persistence-modules/apache-bookkeeper/data/bk2/.gitignore new file mode 100644 index 0000000000..32c9297ccd --- /dev/null +++ b/persistence-modules/apache-bookkeeper/data/bk2/.gitignore @@ -0,0 +1 @@ +/bookkeeper/ diff --git a/persistence-modules/apache-bookkeeper/docker-compose.yml b/persistence-modules/apache-bookkeeper/docker-compose.yml new file mode 100644 index 0000000000..0ef4c41a4a --- /dev/null +++ b/persistence-modules/apache-bookkeeper/docker-compose.yml @@ -0,0 +1,71 @@ +version: '3.0' +services: + zk: + image: zookeeper:3.6.1 + restart: always + ports: + - "2181:2181" + volumes: + - ./data/zk:/data + + bookie_init: + image: apache/bookkeeper:4.10.0 + environment: + BK_zkServers: "zk:2181" + BK_advertisedAddress: ${BK_PUBLIC_IP} + restart: on-failure + depends_on: + - zk + command: /opt/bookkeeper/bin/bookkeeper shell metaformat -nonInteractive + + bookie: + image: apache/bookkeeper:4.10.0 + restart: on-failure + environment: + BK_zkServers: "zk:2181" + BK_advertisedAddress: ${BK_PUBLIC_IP} + BK_httpServerPort: 3182 + ports: + - "3181:3181" + - "3182:3182" + volumes: + - ./data/bk:/data + depends_on: + - zk + - bookie_init + + bookie1: + image: apache/bookkeeper:4.10.0 + restart: on-failure + environment: + BOOKIE_PORT: 4181 + BK_zkServers: "zk:2181" + BK_advertisedAddress: ${BK_PUBLIC_IP} + BK_httpServerPort: 3182 + ports: + - "4181:4181" + volumes: + - ./data/bk1:/data + depends_on: + - zk + - bookie_init + + bookie2: + image: apache/bookkeeper:4.10.0 + restart: on-failure + environment: + BOOKIE_PORT: 4182 + BK_zkServers: "zk:2181" + BK_advertisedAddress: ${BK_PUBLIC_IP} + BK_httpServerPort: 3182 + ports: + - "4182:4182" + volumes: + - ./data/bk2:/data + depends_on: + - zk + - bookie_init + + + + diff --git a/persistence-modules/apache-bookkeeper/pom.xml b/persistence-modules/apache-bookkeeper/pom.xml new file mode 100644 index 0000000000..0beea7f1fc --- /dev/null +++ b/persistence-modules/apache-bookkeeper/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + apache-bookkeeper + 0.0.1-SNAPSHOT + apache-bookkeeper + jar + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + + org.apache.bookkeeper + bookkeeper-server + ${org.apache.bookkeeper.version} + + + org.slf4j + slf4j-log4j12 + + + + + + org.testcontainers + testcontainers + 1.14.3 + test + + + + + + 4.10.0 + + + + + diff --git a/persistence-modules/apache-bookkeeper/src/main/java/com/baeldung/tutorials/bookkeeper/BkHelper.java b/persistence-modules/apache-bookkeeper/src/main/java/com/baeldung/tutorials/bookkeeper/BkHelper.java new file mode 100644 index 0000000000..55f5d7b09f --- /dev/null +++ b/persistence-modules/apache-bookkeeper/src/main/java/com/baeldung/tutorials/bookkeeper/BkHelper.java @@ -0,0 +1,149 @@ +package com.baeldung.tutorials.bookkeeper; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.bookkeeper.client.BKException; +import org.apache.bookkeeper.client.BookKeeper; +import org.apache.bookkeeper.client.BookKeeper.DigestType; +import org.apache.bookkeeper.client.LedgerHandle; +import org.apache.bookkeeper.client.api.LedgerMetadata; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.zookeeper.AsyncCallback; + +public class BkHelper { + + private static final Log LOG = LogFactory.getLog(BkHelper.class); + + public static BookKeeper createBkClient(String zkConnectionString) { + try { + return new BookKeeper(zkConnectionString); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + /** + * Creates a Ledger with the given name added as custom metadata + * @param bk + * @param name + * @param password + * @return + */ + public static LedgerHandle createLedger(BookKeeper bk, String name, byte[] password) { + try { + return bk.createLedger(3, 2, 2, DigestType.MAC, password, Collections.singletonMap("name", name.getBytes())); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + /** + * Iterates over all available ledgers and returns the first one that has + * a metadata key 'name' equals to the given name + * @param bk + * @param name + * @return + * @throws Exception + */ + public static Optional findLedgerByName(BookKeeper bk, String name) throws Exception { + Map ledgers = new HashMap(); + final AtomicInteger returnCode = new AtomicInteger(BKException.Code.OK); + final CountDownLatch processDone = new CountDownLatch(1); + + // There's no standard "list" operation. Instead, BK offers a generalized way to + // iterate over all available ledgers using an async visitor callback. + // The second callback will be called when there are no more ledgers do process or if an + // error occurs. + bk.getLedgerManager() + .asyncProcessLedgers( + (ledgerId, cb) -> collectLedgers(bk, ledgerId, cb, ledgers), + (rc, s, obj) -> { + returnCode.set(rc); + processDone.countDown(); + }, + null, + BKException.Code.OK, BKException.Code.ReadException); + processDone.await(5, TimeUnit.MINUTES); + LOG.info("Ledgers collected: total found=" + ledgers.size()); + + byte[] nameBytes = name.getBytes(); + Optional> entry = ledgers.entrySet() + .stream() + .filter((e) -> { + Map meta = e.getValue() + .getCustomMetadata(); + if (meta != null) { + LOG.info("ledger: " + e.getKey() + ", customMeta=" + meta); + byte[] data = meta.get("name"); + if (data != null && Arrays.equals(data, nameBytes)) { + return true; + } else { + return false; + } + } else { + LOG.info("ledger: " + e.getKey() + ", no meta"); + return false; + } + }) + .findFirst(); + if (entry.isPresent()) { + return Optional.of(entry.get() + .getKey()); + } else { + return Optional.empty(); + } + } + + public static void collectLedgers(BookKeeper bk, long ledgerId, AsyncCallback.VoidCallback cb, Map ledgers) { + try { + bk.getLedgerManager() + .readLedgerMetadata(ledgerId) + .thenAccept((v) -> { + LOG.debug("Got ledger metadata"); + ledgers.put(ledgerId, v.getValue()); + }) + .thenAccept((v) -> { + cb.processResult(BKException.Code.OK, null, null); + }); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + /** + * Return a list with all available Ledgers + * @param bk + * @return + */ + public static List listAllLedgers(BookKeeper bk) { + final List ledgers = Collections.synchronizedList(new ArrayList<>()); + final CountDownLatch processDone = new CountDownLatch(1); + + bk.getLedgerManager() + .asyncProcessLedgers((ledgerId, cb) -> { + ledgers.add(ledgerId); + cb.processResult(BKException.Code.OK, null, null); + }, + (rc, s, obj) -> { + processDone.countDown(); + }, null, BKException.Code.OK, BKException.Code.ReadException); + + try { + processDone.await(1, TimeUnit.MINUTES); + return ledgers; + } catch (InterruptedException ie) { + throw new RuntimeException(ie); + } + } +} diff --git a/persistence-modules/apache-bookkeeper/src/test/java/com/baeldung/tutorials/bookkeeper/BkHelperLiveTest.java b/persistence-modules/apache-bookkeeper/src/test/java/com/baeldung/tutorials/bookkeeper/BkHelperLiveTest.java new file mode 100644 index 0000000000..84a8ce3db8 --- /dev/null +++ b/persistence-modules/apache-bookkeeper/src/test/java/com/baeldung/tutorials/bookkeeper/BkHelperLiveTest.java @@ -0,0 +1,185 @@ +package com.baeldung.tutorials.bookkeeper; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; + +import org.apache.bookkeeper.client.BookKeeper; +import org.apache.bookkeeper.client.LedgerEntry; +import org.apache.bookkeeper.client.LedgerHandle; +import org.apache.bookkeeper.client.api.DigestType; +import org.apache.bookkeeper.client.api.LedgerEntries; +import org.apache.bookkeeper.client.api.WriteHandle; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class BkHelperLiveTest extends BkHelper { + private static BookKeeper bk; + private byte[] ledgerPassword = "SuperS3cR37".getBytes(); + private static final Log LOG = LogFactory.getLog(BkHelperLiveTest.class); + + @BeforeAll + static void initBkClient() { + bk = createBkClient("192.168.99.101:2181"); + } + + @Test + void whenCreateLedger_thenSuccess() throws Exception { + LedgerHandle lh = bk.createLedger(BookKeeper.DigestType.MAC, ledgerPassword); + assertNotNull(lh); + assertNotNull(lh.getId()); + LOG.info("[I33] Ledge created: id=" + lh.getId()); + } + + @Test + void whenCreateLedgerAsync_thenSuccess() throws Exception { + + CompletableFuture cf = bk.newCreateLedgerOp() + .withDigestType(org.apache.bookkeeper.client.api.DigestType.MAC) + .withPassword("password".getBytes()) + .execute(); + + WriteHandle handle = cf.get(1, TimeUnit.MINUTES); + assertNotNull(handle); + handle.close(); + + } + + @Test + void whenAsyncCreateLedger_thenSuccess() throws Exception { + CountDownLatch latch = new CountDownLatch(1); + AtomicReference handleRef = new AtomicReference<>(); + + bk.asyncCreateLedger(3, 2, 2, BookKeeper.DigestType.MAC, ledgerPassword, + (rc, lh, ctx) -> { + handleRef.set(lh); + latch.countDown(); + }, null, Collections.emptyMap()); + latch.await(1, TimeUnit.MINUTES); + LedgerHandle lh = handleRef.get(); + assertNotNull(lh); + assertFalse(lh.isClosed(), "Ledger should be writeable"); + } + + @Test + void whenListLedgers_thenSuccess() throws Exception { + List ledgers = listAllLedgers(bk); + assertNotNull(ledgers); + } + + @Test + void whenWriteEntries_thenSuccess() throws Exception { + LedgerHandle lh = createLedger(bk, "myledger", ledgerPassword); + long start = System.currentTimeMillis(); + for (int i = 0; i < 1000; i++) { + byte[] data = new String("message-" + i).getBytes(); + lh.append(data); + } + lh.close(); + long elapsed = System.currentTimeMillis() - start; + LOG.info("Entries added to ledgerId " + lh.getId() + ". count=1000, elapsed=" + elapsed); + } + + @Test + void whenWriteEntriesAsync_thenSuccess() throws Exception { + CompletableFuture f = bk.newCreateLedgerOp() + .withDigestType(DigestType.MAC) + .withPassword(ledgerPassword) + .execute() + .thenApply((wh) -> { + List> ops = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + byte[] data = String.format("message-%04d", i) + .getBytes(); + ops.add(wh.appendAsync(data)); + } + return CompletableFuture.allOf(ops.stream() + .toArray(CompletableFuture[]::new)) + .thenCompose((v) -> wh.closeAsync()); + }); + f.get(5, TimeUnit.MINUTES); + } + + @Test + void whenWriteAndReadEntriesAsync_thenSuccess() throws Exception { + CompletableFuture f = bk.newCreateLedgerOp() + .withDigestType(DigestType.MAC) + .withPassword(ledgerPassword) + .execute() + .thenApply((wh) -> { + List> ops = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + byte[] data = String.format("message-%04d", i) + .getBytes(); + ops.add(wh.appendAsync(data)); + } + return CompletableFuture.allOf(ops.stream() + .toArray(CompletableFuture[]::new)) + .thenCompose((v) -> wh.closeAsync()) + .thenApply((v) -> wh.getId()); + }) + .thenCompose((lf) -> lf); // flatten the futures + Long ledgerId = f.get(5, TimeUnit.MINUTES); + LOG.info("Ledger created with 1000 entries: ledgerId=" + ledgerId); + + // Now let's read data back... + CompletableFuture ef = bk.newOpenLedgerOp() + .withLedgerId(ledgerId) + .withPassword(ledgerPassword) + .withDigestType(DigestType.MAC) + .execute() + .thenCompose((rh) -> { + return rh.readLastAddConfirmedAsync() + .thenCompose((lastId) -> rh.readAsync(0, lastId)); + }); + LedgerEntries entries = ef.get(5, TimeUnit.MINUTES); + + // Check all writes where OK + long count = 0; + Iterator it = entries.iterator(); + while (it.hasNext()) { + org.apache.bookkeeper.client.api.LedgerEntry e = it.next(); + String msg = new String(e.getEntryBytes()); + assertEquals(String.format("message-%04d", count), msg); + count++; + } + assertEquals(1000, count); + LOG.info("Got entries: count=" + count); + } + + @Test + void whenWriteAndReadEntries_thenSuccess() throws Exception { + LedgerHandle lh = createLedger(bk, "myledger", ledgerPassword); + long start = System.currentTimeMillis(); + for (int i = 0; i < 1000; i++) { + byte[] data = new String("message-" + i).getBytes(); + lh.append(data); + } + lh.close(); + long elapsed = System.currentTimeMillis() - start; + LOG.info("Entries added to ledgerId " + lh.getId() + ", elapsed=" + elapsed); + + Long ledgerId = findLedgerByName(bk, "myledger").orElse(null); + assertNotNull(ledgerId); + lh = bk.openLedger(ledgerId, BookKeeper.DigestType.MAC, ledgerPassword); + long lastId = lh.readLastConfirmed(); + Enumeration entries = lh.readEntries(0, lastId); + while (entries.hasMoreElements()) { + LedgerEntry entry = entries.nextElement(); + String msg = new String(entry.getEntry()); + LOG.info("Entry: id=" + entry.getEntryId() + ", data=" + msg); + } + } +} diff --git a/apache-opennlp/src/main/resources/logback.xml b/persistence-modules/apache-bookkeeper/src/test/resources/logback-test.xml similarity index 67% rename from apache-opennlp/src/main/resources/logback.xml rename to persistence-modules/apache-bookkeeper/src/test/resources/logback-test.xml index 7d900d8ea8..bfe6eee60c 100644 --- a/apache-opennlp/src/main/resources/logback.xml +++ b/persistence-modules/apache-bookkeeper/src/test/resources/logback-test.xml @@ -1,8 +1,10 @@ - + - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - + %msg%n @@ -10,4 +12,4 @@ - \ No newline at end of file + diff --git a/persistence-modules/core-java-persistence/README.md b/persistence-modules/core-java-persistence/README.md index 1187cc15c4..a760489480 100644 --- a/persistence-modules/core-java-persistence/README.md +++ b/persistence-modules/core-java-persistence/README.md @@ -3,9 +3,13 @@ ## Core Java Persistence Examples ### Relevant Articles: + - [Introduction to JDBC](http://www.baeldung.com/java-jdbc) - [Batch Processing in JDBC](http://www.baeldung.com/jdbc-batch-processing) - [Introduction to the JDBC RowSet Interface in Java](http://www.baeldung.com/java-jdbc-rowset) - [A Simple Guide to Connection Pooling in Java](https://www.baeldung.com/java-connection-pooling) - [Guide to the JDBC ResultSet Interface](https://www.baeldung.com/jdbc-resultset) - [Types of SQL Joins](https://www.baeldung.com/sql-joins) +- [Returning the Generated Keys in JDBC](https://www.baeldung.com/jdbc-returning-generated-keys) +- [Loading JDBC Drivers](https://www.baeldung.com/java-jdbc-loading-drivers) +- [Difference Between Statement and PreparedStatement](https://www.baeldung.com/java-statement-preparedstatement) diff --git a/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/DatasourceFactory.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/DatasourceFactory.java new file mode 100644 index 0000000000..adbdc66030 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/DatasourceFactory.java @@ -0,0 +1,23 @@ +package com.baeldung.statmentVsPreparedstatment; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class DatasourceFactory { + + private Connection connection; + + public Connection getConnection() throws ClassNotFoundException, SQLException { + Class.forName("org.h2.Driver"); + connection = DriverManager.getConnection("jdbc:h2:mem:db_basic", "SA", ""); + connection.setAutoCommit(false); + return connection; + } + + public boolean createTables() throws SQLException { + String query = "create table if not exists PERSONS (ID INT, NAME VARCHAR(45))"; + return connection.createStatement().executeUpdate(query) == 0; + } + +} diff --git a/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/PersonEntity.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/PersonEntity.java new file mode 100644 index 0000000000..72fc0c1e24 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/PersonEntity.java @@ -0,0 +1,42 @@ +package com.baeldung.statmentVsPreparedstatment; + +import java.util.Objects; + +public class PersonEntity { + private int id; + private String name; + + public PersonEntity(int id, String name) { + this.id = id; + this.name = name; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + 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; + PersonEntity that = (PersonEntity) o; + return id == that.id && Objects.equals(name, that.name); + } + + @Override public int hashCode() { + return Objects.hash(id, name); + } +} diff --git a/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/PreparedStatementPersonDao.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/PreparedStatementPersonDao.java new file mode 100644 index 0000000000..47124d9139 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/PreparedStatementPersonDao.java @@ -0,0 +1,88 @@ +package com.baeldung.statmentVsPreparedstatment; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class PreparedStatementPersonDao { + + private final Connection connection; + + public PreparedStatementPersonDao(Connection connection) { + this.connection = connection; + } + + public Optional getById(int id) throws SQLException { + String query = "SELECT id, name FROM persons WHERE id = ?"; + + PreparedStatement preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, id); + ResultSet resultSet = preparedStatement.executeQuery(); + + if (resultSet.first()) { + + PersonEntity result = new PersonEntity(resultSet.getInt("id"), + resultSet.getString("name")); + + return Optional.of(result); + } else { + return Optional.empty(); + } + + } + + public void insert(PersonEntity personEntity) throws SQLException { + + String query = "INSERT INTO persons(id, name) VALUES( ?, ?)"; + + PreparedStatement preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, personEntity.getId()); + preparedStatement.setString(2, personEntity.getName()); + preparedStatement.executeUpdate(); + + } + + public void insert(List personEntities) throws SQLException { + String query = "INSERT INTO persons(id, name) VALUES( ?, ?)"; + + PreparedStatement preparedStatement = connection.prepareStatement(query); + for (PersonEntity personEntity : personEntities) { + preparedStatement.setInt(1, personEntity.getId()); + preparedStatement.setString(2, personEntity.getName()); + preparedStatement.addBatch(); + } + preparedStatement.executeBatch(); + + } + + public void update(PersonEntity personEntity) throws SQLException { + String query = "UPDATE persons SET name = ? WHERE id = ?"; + PreparedStatement preparedStatement = connection.prepareStatement(query); + preparedStatement.setString(1, personEntity.getName()); + preparedStatement.setInt(2, personEntity.getId()); + preparedStatement.executeUpdate(); + } + + public void deleteById(int id) throws SQLException { + String query = "DELETE FROM persons WHERE id = ?"; + PreparedStatement preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, id); + preparedStatement.executeUpdate(); + } + + public List getAll() throws SQLException { + String query = "SELECT id, name FROM persons"; + + PreparedStatement preparedStatement = connection.prepareStatement(query); + ResultSet resultSet = preparedStatement.executeQuery(); + List result = new ArrayList<>(); + while (resultSet.next()) { + result.add(new PersonEntity(resultSet.getInt("id"), resultSet.getString("name"))); + } + return result; + } +} diff --git a/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/StatementPersonDao.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/StatementPersonDao.java new file mode 100644 index 0000000000..935ba8efa2 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/statmentVsPreparedstatment/StatementPersonDao.java @@ -0,0 +1,75 @@ +package com.baeldung.statmentVsPreparedstatment; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class StatementPersonDao { + + private final Connection connection; + + public StatementPersonDao(Connection connection) { + this.connection = connection; + } + + public Optional getById(int id) throws SQLException { + String query = "SELECT id, name, FROM persons WHERE id = '" + id + "'"; + + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(query); + + if (resultSet.first()) { + PersonEntity result = new PersonEntity(resultSet.getInt("id"), + resultSet.getString("name")); + return Optional.of(result); + } else { + return Optional.empty(); + } + } + + public void insert(PersonEntity personEntity) throws SQLException { + String query = "INSERT INTO persons(id, name) VALUES(" + personEntity.getId() + ", '" + + personEntity.getName() + "')"; + + Statement statement = connection.createStatement(); + statement.executeUpdate(query); + } + + public void insert(List personEntities) throws SQLException { + for (PersonEntity personEntity : personEntities) { + insert(personEntity); + } + } + + public void update(PersonEntity personEntity) throws SQLException { + + String query = "UPDATE persons SET name = '" + personEntity.getName() + "' WHERE id = " + + personEntity.getId(); + + Statement statement = connection.createStatement(); + statement.executeUpdate(query); + + } + + public void deleteById(int id) throws SQLException { + String query = "DELETE FROM persons WHERE id = " + id; + Statement statement = connection.createStatement(); + statement.executeUpdate(query); + } + + public List getAll() throws SQLException { + String query = "SELECT id, name, FROM persons"; + + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(query); + List result = new ArrayList<>(); + while (resultSet.next()) { + result.add(new PersonEntity(resultSet.getInt("id"), resultSet.getString("name"))); + } + return result; + } +} diff --git a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcDriverLoadingUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcDriverLoadingUnitTest.java new file mode 100644 index 0000000000..387c050285 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcDriverLoadingUnitTest.java @@ -0,0 +1,72 @@ +package com.baeldung.jdbc; + +import static org.junit.Assert.*; + +import org.junit.Before; +import org.junit.Test; + +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class JdbcDriverLoadingUnitTest { + + @Before + public void setup() throws SQLException { + if (!org.postgresql.Driver.isRegistered()) { + org.postgresql.Driver.register(); + } + } + /** + * Driver is registered automatically with the service provider mechanism. + */ + @Test + public void givenJdbcDriverWithSP_whenGettingDriver_thenDriverIsReturned() throws SQLException { + Driver driver = getDriver(); + assertNotNull("Expected initialized postgres driver", driver); + } + + /** + * Driver is registered automatically, then deregistered. + * @throws SQLException + */ + @Test(expected = SQLException.class) + public void givenRegisteredJdbcDriver_whenDeregister_thenNoDriverIsReturned() throws SQLException { + Driver driver = getDriver(); + DriverManager.deregisterDriver(driver); + driver = getDriver(); + assertNull(driver); + } + + /** + * Driver is automatically by the JVM, then deregistered, then registered again. + * @throws SQLException + * @throws ClassNotFoundException + */ + @Test + public void givenNoRegisteredDriver_whenClassForName_thenDriverIsReturned() throws SQLException, ClassNotFoundException { + deregisterDriver(); + + Driver driver = null; + try { + driver = getDriver(); + } + catch (SQLException e) { + // expected + } + assertNull("Must fail on attempt to get a deregistered driver", driver); + + org.postgresql.Driver.register(); // This is invoked as part of Class.forName() logic + + driver = getDriver(); + assertNotNull("Driver must register as part of class loading", driver); + } + + private void deregisterDriver() throws SQLException { + org.postgresql.Driver.deregister(); + } + + private Driver getDriver() throws SQLException { + return DriverManager.getDriver("jdbc:postgresql:"); + } +} diff --git a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/DatasourceFactoryUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/DatasourceFactoryUnitTest.java new file mode 100644 index 0000000000..5d3b151d5d --- /dev/null +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/DatasourceFactoryUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.statmentVsPreparedstatment; + +import org.junit.jupiter.api.Test; + +import java.sql.Connection; +import java.sql.SQLException; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class DatasourceFactoryUnitTest { + + @Test + void whenCreateConnectionAndTables_thenConnectionIsOpenAndTableIsCreated() + throws SQLException, ClassNotFoundException { + DatasourceFactory factory = new DatasourceFactory(); + Connection connection = factory.getConnection(); + + assertFalse(connection.isClosed()); + assertTrue(factory.createTables()); + } +} \ No newline at end of file diff --git a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/PreparedStatementPersonDaoUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/PreparedStatementPersonDaoUnitTest.java new file mode 100644 index 0000000000..ce79f47802 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/PreparedStatementPersonDaoUnitTest.java @@ -0,0 +1,94 @@ +package com.baeldung.statmentVsPreparedstatment; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; + +class PreparedStatementPersonDaoUnitTest { + private PreparedStatementPersonDao dao; + + @BeforeEach + void setup() throws SQLException, ClassNotFoundException { + DatasourceFactory datasourceFactory = new DatasourceFactory(); + Connection connection = datasourceFactory.getConnection(); + datasourceFactory.createTables(); + dao = new PreparedStatementPersonDao(connection); + } + + @Test + void whenInsertAPerson_thenItNeverThrowsAnException() { + assertDoesNotThrow(() -> dao.insert(new PersonEntity(1, "john"))); + } + + @Test + void whenInsertAPersonWithQuoteInText_thenItNeverThrowsAnException() { + assertDoesNotThrow(() -> dao.insert(new PersonEntity(1, "O'Brien"))); + } + + @Test + void whenGetAPersonById_thenItReturnThePersonInDatabase() throws SQLException { + dao.insert(new PersonEntity(1, "john")); + + Optional maybeEmployee = dao.getById(1); + assertTrue(maybeEmployee.isPresent()); + + PersonEntity personEntity = maybeEmployee.get(); + + assertEquals(1, personEntity.getId()); + assertEquals("john", personEntity.getName()); + } + + @Test + void whenInsertAndGetMultiplePersons_thenItNeverThrowsAnException() throws SQLException { + assertDoesNotThrow(() -> dao.insert( + Arrays.asList(new PersonEntity(1, "john"), new PersonEntity(2, "skit")))); + + List result = dao.getAll(); + + assertEquals(Arrays.asList(new PersonEntity(1, "john"), new PersonEntity(2, "skit")), + result); + } + + @Test + void whenUpdateAnExistentPerson_thenItReturnsTheUpdatedPerson() throws SQLException { + dao.insert(new PersonEntity(1, "john")); + dao.update(new PersonEntity(1, "johnny")); + + Optional maybePerson = dao.getById(1); + + assertTrue(maybePerson.isPresent()); + + PersonEntity personEntity = maybePerson.get(); + + assertEquals(1, personEntity.getId()); + assertEquals("johnny", personEntity.getName()); + } + + @Test + void whenDeleteAPersonById_thenItWillBeAbsentInDatabase() throws SQLException { + dao.insert(new PersonEntity(1, "john")); + dao.deleteById(1); + + Optional maybePerson = dao.getById(1); + + assertFalse(maybePerson.isPresent()); + } + + @Test + void whenAHackerUpdateAPerson_thenItUpdatesTheTargetPerson() throws SQLException { + dao.insert(Arrays.asList(new PersonEntity(1, "john"), new PersonEntity(2, "skeet"))); + dao.update(new PersonEntity(1, "hacker' --")); + + List result = dao.getAll(); + + assertEquals(Arrays.asList(new PersonEntity(1, "hacker' --"), new PersonEntity(2, "skeet")), + result); + } +} \ No newline at end of file diff --git a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/StatementPersonDaoUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/StatementPersonDaoUnitTest.java new file mode 100644 index 0000000000..b31bdcc296 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/statmentVsPreparedstatment/StatementPersonDaoUnitTest.java @@ -0,0 +1,96 @@ +package com.baeldung.statmentVsPreparedstatment; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; + +class StatementPersonDaoUnitTest { + + private StatementPersonDao dao; + + @BeforeEach + void setup() throws SQLException, ClassNotFoundException { + DatasourceFactory datasourceFactory = new DatasourceFactory(); + Connection connection = datasourceFactory.getConnection(); + datasourceFactory.createTables(); + dao = new StatementPersonDao(connection); + } + + @Test + void whenInsertAPerson_thenItNeverThrowsAnException() { + assertDoesNotThrow(() -> dao.insert(new PersonEntity(1, "john"))); + } + + @Test + void whenInsertAPersonWithQuoteInText_thenItWillThrowAnException() { + assertThrows(SQLException.class, () -> dao.insert(new PersonEntity(1, "O'Brien"))); + } + + @Test + void whenGetAPersonById_thenItReturnThePersonInDatabase() throws SQLException { + dao.insert(new PersonEntity(1, "john")); + + Optional maybeEmployee = dao.getById(1); + + assertTrue(maybeEmployee.isPresent()); + + PersonEntity personEntity = maybeEmployee.get(); + + assertEquals(1, personEntity.getId()); + assertEquals("john", personEntity.getName()); + } + + @Test + void whenInsertAndGetMultiplePersons_thenItNeverThrowsAnException() throws SQLException { + assertDoesNotThrow(() -> dao.insert( + Arrays.asList(new PersonEntity(1, "john"), new PersonEntity(2, "skeet")))); + + List result = dao.getAll(); + + assertEquals(Arrays.asList(new PersonEntity(1, "john"), new PersonEntity(2, "skeet")), + result); + } + + @Test + void whenUpdateAnExistentPerson_thenItReturnsTheUpdatedPerson() throws SQLException { + dao.insert(new PersonEntity(1, "john")); + dao.update(new PersonEntity(1, "johnny")); + + Optional maybePerson = dao.getById(1); + + assertTrue(maybePerson.isPresent()); + + PersonEntity personEntity = maybePerson.get(); + + assertEquals(1, personEntity.getId()); + assertEquals("johnny", personEntity.getName()); + } + + @Test + void whenDeleteAPersonById_thenItWillBeAbsentInDatabase() throws SQLException { + dao.insert(new PersonEntity(1, "john")); + dao.deleteById(1); + + Optional maybePerson = dao.getById(1); + + assertFalse(maybePerson.isPresent()); + } + + @Test + void whenAHackerUpdateAPerson_thenItAllPersonsAreUpdated() throws SQLException { + dao.insert(Arrays.asList(new PersonEntity(1, "john"), new PersonEntity(2, "skeet"))); + dao.update(new PersonEntity(1, "hacker' --")); + + List result = dao.getAll(); + + assertEquals(Arrays.asList(new PersonEntity(1, "hacker"), new PersonEntity(2, "hacker")), + result); + } +} \ No newline at end of file diff --git a/persistence-modules/flyway-repair/README.MD b/persistence-modules/flyway-repair/README.MD new file mode 100644 index 0000000000..7d843af9ea --- /dev/null +++ b/persistence-modules/flyway-repair/README.MD @@ -0,0 +1 @@ +### Relevant Articles: diff --git a/persistence-modules/flyway-repair/docker-compose/.env b/persistence-modules/flyway-repair/docker-compose/.env new file mode 100644 index 0000000000..8a9d0e7954 --- /dev/null +++ b/persistence-modules/flyway-repair/docker-compose/.env @@ -0,0 +1 @@ +POSTGRES_PORT=5431 diff --git a/persistence-modules/flyway-repair/docker-compose/docker-compose.yaml b/persistence-modules/flyway-repair/docker-compose/docker-compose.yaml new file mode 100644 index 0000000000..b32b48d1cf --- /dev/null +++ b/persistence-modules/flyway-repair/docker-compose/docker-compose.yaml @@ -0,0 +1,15 @@ +version: '3.0' + +services: + + postgres-test: + image: postgres:11.5 + ports: + - ${POSTGRES_PORT}:5432 + env_file: postgres.env + networks: + - baeldung + +networks: + baeldung: + driver: bridge diff --git a/persistence-modules/flyway-repair/docker-compose/postgres.env b/persistence-modules/flyway-repair/docker-compose/postgres.env new file mode 100644 index 0000000000..1e7373fdf0 --- /dev/null +++ b/persistence-modules/flyway-repair/docker-compose/postgres.env @@ -0,0 +1,3 @@ +POSTGRES_USER=testuser +POSTGRES_PASSWORD=password +POSTGRES_DB=testdb diff --git a/persistence-modules/flyway-repair/pom.xml b/persistence-modules/flyway-repair/pom.xml new file mode 100644 index 0000000000..4d61bd5c0e --- /dev/null +++ b/persistence-modules/flyway-repair/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + flyway + flyway-repair + jar + Flyway Repair Demo + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + org.flywaydb + flyway-core + + + org.springframework.boot + spring-boot-starter-jdbc + + + + + + + org.flywaydb + flyway-maven-plugin + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + h2 + + true + + + h2 + + + + com.h2database + h2 + runtime + + + + + + postgres + + postgres + + + + org.postgresql + postgresql + runtime + + + + + + + + src/main/resources/application-${spring-boot.run.profiles}.properties + + + diff --git a/persistence-modules/flyway-repair/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java b/persistence-modules/flyway-repair/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java new file mode 100644 index 0000000000..34d794f7d1 --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.flywaycallbacks; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class FlywayApplication { + + public static void main(String[] args) { + SpringApplication.run(FlywayApplication.class, args); + } + +} diff --git a/persistence-modules/flyway-repair/src/main/resources/application-callbacks.properties b/persistence-modules/flyway-repair/src/main/resources/application-callbacks.properties new file mode 100644 index 0000000000..46ad86afee --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/application-callbacks.properties @@ -0,0 +1 @@ +spring.flyway.locations=classpath:db/migration,classpath:db/callback diff --git a/persistence-modules/flyway-repair/src/main/resources/application-h2.properties b/persistence-modules/flyway-repair/src/main/resources/application-h2.properties new file mode 100644 index 0000000000..64e485244e --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/application-h2.properties @@ -0,0 +1,3 @@ +flyway.url=jdbc:h2:file:./testdb;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE;MODE=MySQL;DATABASE_TO_UPPER=false; +flyway.user=testuser +flyway.password=password diff --git a/persistence-modules/flyway-repair/src/main/resources/application-postgres.properties b/persistence-modules/flyway-repair/src/main/resources/application-postgres.properties new file mode 100644 index 0000000000..951f8f583d --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/application-postgres.properties @@ -0,0 +1,3 @@ +flyway.url=jdbc:postgresql://127.0.0.1:5431/testdb +flyway.user=testuser +flyway.password=password diff --git a/persistence-modules/flyway-repair/src/main/resources/application.properties b/persistence-modules/flyway-repair/src/main/resources/application.properties new file mode 100644 index 0000000000..da666d3cc2 --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/application.properties @@ -0,0 +1,3 @@ +spring.datasource.url=${flyway.url} +spring.datasource.username=${flyway.user} +spring.datasource.password=${flyway.password} diff --git a/persistence-modules/flyway-repair/src/main/resources/db/callback/afterMigrateError__repair.sql b/persistence-modules/flyway-repair/src/main/resources/db/callback/afterMigrateError__repair.sql new file mode 100644 index 0000000000..ee0cbb6cee --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/db/callback/afterMigrateError__repair.sql @@ -0,0 +1 @@ +DELETE FROM flyway_schema_history WHERE success=false; diff --git a/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_0__add_table.sql b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_0__add_table.sql new file mode 100644 index 0000000000..1774e837b7 --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_0__add_table.sql @@ -0,0 +1,3 @@ +create table table_one ( + id numeric primary key +); diff --git a/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_1__add_table.sql b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_1__add_table.sql new file mode 100644 index 0000000000..76f2ee7ba1 --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_1__add_table.sql @@ -0,0 +1,3 @@ +create table table_two ( + id numeric primary key +); diff --git a/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_2__add_table.sql b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_2__add_table.sql new file mode 100644 index 0000000000..dd5cf34059 --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_2__add_table.sql @@ -0,0 +1,3 @@ +create table table_three ( + id numeric primary key +); diff --git a/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_3__add_table.sql b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_3__add_table.sql new file mode 100644 index 0000000000..4a126ffe33 --- /dev/null +++ b/persistence-modules/flyway-repair/src/main/resources/db/migration/V1_3__add_table.sql @@ -0,0 +1,3 @@ +create table table_four ( + id numeric primary key +); diff --git a/maven-all/maven/src/main/resources/logback.xml b/persistence-modules/flyway-repair/src/main/resources/logback.xml similarity index 57% rename from maven-all/maven/src/main/resources/logback.xml rename to persistence-modules/flyway-repair/src/main/resources/logback.xml index 7d900d8ea8..56af2d397e 100644 --- a/maven-all/maven/src/main/resources/logback.xml +++ b/persistence-modules/flyway-repair/src/main/resources/logback.xml @@ -7,6 +7,12 @@ + + + + + + diff --git a/persistence-modules/hibernate-exceptions/README.md b/persistence-modules/hibernate-exceptions/README.md new file mode 100644 index 0000000000..616800a63d --- /dev/null +++ b/persistence-modules/hibernate-exceptions/README.md @@ -0,0 +1,5 @@ +### Relevant Articles: + +- [Hibernate could not initialize proxy – no Session](https://www.baeldung.com/hibernate-initialize-proxy-exception) +- [Hibernate Error “No Persistence Provider for EntityManager”](https://www.baeldung.com/hibernate-no-persistence-provider) +- [TransactionRequiredException Error](https://www.baeldung.com/jpa-transaction-required-exception) \ No newline at end of file diff --git a/persistence-modules/hibernate-exceptions/pom.xml b/persistence-modules/hibernate-exceptions/pom.xml index e5217e83bd..f7eee22960 100644 --- a/persistence-modules/hibernate-exceptions/pom.xml +++ b/persistence-modules/hibernate-exceptions/pom.xml @@ -33,7 +33,6 @@ 2.4.0 2.3.0 - 5.3.7.Final diff --git a/persistence-modules/hibernate-jpa/README.md b/persistence-modules/hibernate-jpa/README.md index 514fcedb8a..64ec9dcae3 100644 --- a/persistence-modules/hibernate-jpa/README.md +++ b/persistence-modules/hibernate-jpa/README.md @@ -11,7 +11,5 @@ This module contains articles specific to use of Hibernate as a JPA implementati - [Criteria API – An Example of IN Expressions](https://www.baeldung.com/jpa-criteria-api-in-expressions) - [One-to-One Relationship in JPA](https://www.baeldung.com/jpa-one-to-one) - [Enabling Transaction Locks in Spring Data JPA](https://www.baeldung.com/java-jpa-transaction-locks) -- [TransactionRequiredException Error](https://www.baeldung.com/jpa-transaction-required-exception) - [JPA/Hibernate Persistence Context](https://www.baeldung.com/jpa-hibernate-persistence-context) - [Quick Guide to EntityManager#getReference()](https://www.baeldung.com/jpa-entity-manager-get-reference) -- [Hibernate Error “No Persistence Provider for EntityManager”](https://www.baeldung.com/hibernate-no-persistence-provider) diff --git a/persistence-modules/hibernate-libraries/README.md b/persistence-modules/hibernate-libraries/README.md new file mode 100644 index 0000000000..9070c6c9d5 --- /dev/null +++ b/persistence-modules/hibernate-libraries/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [A Guide to the Hibernate Types Library](https://www.baeldung.com/hibernate-types-library) diff --git a/persistence-modules/hibernate-libraries/pom.xml b/persistence-modules/hibernate-libraries/pom.xml index ea2dda7e88..808c47133c 100644 --- a/persistence-modules/hibernate-libraries/pom.xml +++ b/persistence-modules/hibernate-libraries/pom.xml @@ -171,7 +171,6 @@ 2.9.7 5.4.14.Final 2.10.3 - 1.8 3.27.0-GA 2.3.1 2.0.0 diff --git a/persistence-modules/hibernate-queries/pom.xml b/persistence-modules/hibernate-queries/pom.xml index a439ded9df..06f7f42088 100644 --- a/persistence-modules/hibernate-queries/pom.xml +++ b/persistence-modules/hibernate-queries/pom.xml @@ -71,7 +71,6 @@ - 5.3.7.Final 6.0.6 2.2.3 3.8.0 diff --git a/persistence-modules/hibernate5/README.md b/persistence-modules/hibernate5/README.md index bd437c80eb..8793e2e9c7 100644 --- a/persistence-modules/hibernate5/README.md +++ b/persistence-modules/hibernate5/README.md @@ -4,7 +4,7 @@ This module contains articles about Hibernate 5. Let's not add more articles her ### Relevant articles: -- [An Overview of Identifiers in Hibernate](https://www.baeldung.com/hibernate-identifiers) +- [An Overview of Identifiers in Hibernate/JPA](https://www.baeldung.com/hibernate-identifiers) - [Hibernate Interceptors](https://www.baeldung.com/hibernate-interceptor) - [Hibernate Entity Lifecycle](https://www.baeldung.com/hibernate-entity-lifecycle) - [Hibernate 5 Naming Strategy Configuration](https://www.baeldung.com/hibernate-naming-strategy) @@ -12,4 +12,4 @@ This module contains articles about Hibernate 5. Let's not add more articles her - [Hibernate 5 Bootstrapping API](https://www.baeldung.com/hibernate-5-bootstrapping-api) - [Guide to the Hibernate EntityManager](https://www.baeldung.com/hibernate-entitymanager) - [Using c3p0 with Hibernate](https://www.baeldung.com/hibernate-c3p0) -- [Persist a JSON Object Using Hibernate](https://www.baeldung.com/hibernate-persist-json-object) \ No newline at end of file +- [Persist a JSON Object Using Hibernate](https://www.baeldung.com/hibernate-persist-json-object) diff --git a/persistence-modules/persistence-libraries/pom.xml b/persistence-modules/persistence-libraries/pom.xml index a72654f2aa..42f3a33a40 100644 --- a/persistence-modules/persistence-libraries/pom.xml +++ b/persistence-modules/persistence-libraries/pom.xml @@ -4,7 +4,7 @@ 4.0.0 persistence-libraries 1.0-SNAPSHOT - java-sql2o + persistence-libraries com.baeldung diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index a03ba1ec5d..f1154f203b 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -14,6 +14,7 @@ activejdbc + apache-bookkeeper apache-cayenne core-java-persistence deltaspike @@ -77,4 +78,8 @@ spring-persistence-simple-2 + + + 5.2.17.Final + diff --git a/persistence-modules/r2dbc/pom.xml b/persistence-modules/r2dbc/pom.xml index b1de88e9ea..2da81cba06 100644 --- a/persistence-modules/r2dbc/pom.xml +++ b/persistence-modules/r2dbc/pom.xml @@ -10,11 +10,11 @@ Sample R2DBC Project - org.springframework.boot - spring-boot-starter-parent - 2.1.6.RELEASE - - + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + @@ -62,7 +62,6 @@ - 1.8 0.8.1.RELEASE 1.4.200 diff --git a/persistence-modules/r2dbc/src/test/java/com/baeldung/examples/r2dbc/R2dbcExampleApplicationTests.java b/persistence-modules/r2dbc/src/test/java/com/baeldung/examples/r2dbc/R2dbcExampleApplicationIntegrationTest.java similarity index 98% rename from persistence-modules/r2dbc/src/test/java/com/baeldung/examples/r2dbc/R2dbcExampleApplicationTests.java rename to persistence-modules/r2dbc/src/test/java/com/baeldung/examples/r2dbc/R2dbcExampleApplicationIntegrationTest.java index 3fb9e24a8e..7c3badc976 100644 --- a/persistence-modules/r2dbc/src/test/java/com/baeldung/examples/r2dbc/R2dbcExampleApplicationTests.java +++ b/persistence-modules/r2dbc/src/test/java/com/baeldung/examples/r2dbc/R2dbcExampleApplicationIntegrationTest.java @@ -19,7 +19,7 @@ import reactor.core.publisher.Flux; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class R2dbcExampleApplicationTests { +public class R2dbcExampleApplicationIntegrationTest { @Autowired diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml index dab7fc5654..e4c5eb4002 100644 --- a/persistence-modules/redis/pom.xml +++ b/persistence-modules/redis/pom.xml @@ -33,7 +33,7 @@ redis.clients jedis - 3.3.0 + ${jedis.version} com.github.kstyrc @@ -48,12 +48,19 @@ io.lettuce lettuce-core - + + + io.netty + netty-transport-native-epoll + ${epoll.version} + 0.6 - 3.3.0 + 3.13.1 + 3.3.0 + 4.1.50.Final diff --git a/persistence-modules/redis/src/main/java/com/baeldung/CustomMessage.java b/persistence-modules/redis/src/main/java/com/baeldung/CustomMessage.java index 1d6a7e4e13..26ebe46f64 100644 --- a/persistence-modules/redis/src/main/java/com/baeldung/CustomMessage.java +++ b/persistence-modules/redis/src/main/java/com/baeldung/CustomMessage.java @@ -1,9 +1,11 @@ package com.baeldung; +import java.io.Serializable; + /** * Created by johnson on 3/9/17. */ -public class CustomMessage { +public class CustomMessage implements Serializable { private String message; public CustomMessage() { diff --git a/persistence-modules/redis/src/main/java/com/baeldung/Ledger.java b/persistence-modules/redis/src/main/java/com/baeldung/Ledger.java index da72791f7e..c9fb81979e 100644 --- a/persistence-modules/redis/src/main/java/com/baeldung/Ledger.java +++ b/persistence-modules/redis/src/main/java/com/baeldung/Ledger.java @@ -1,6 +1,8 @@ package com.baeldung; -public class Ledger { +import java.io.Serializable; + +public class Ledger implements Serializable { public Ledger() { } diff --git a/persistence-modules/redis/src/main/resources/singleNodeConfig.json b/persistence-modules/redis/src/main/resources/singleNodeConfig.json index f56e13dcfc..c46a542b46 100644 --- a/persistence-modules/redis/src/main/resources/singleNodeConfig.json +++ b/persistence-modules/redis/src/main/resources/singleNodeConfig.json @@ -1,13 +1,10 @@ { "singleServerConfig": { "idleConnectionTimeout": 10000, - "pingTimeout": 1000, "connectTimeout": 10000, "timeout": 3000, "retryAttempts": 3, "retryInterval": 1500, - "reconnectionTimeout": 3000, - "failedAttempts": 3, "password": null, "subscriptionsPerConnection": 5, "clientName": null, @@ -17,11 +14,9 @@ "connectionMinimumIdleSize": 10, "connectionPoolSize": 64, "database": 0, - "dnsMonitoring": false, "dnsMonitoringInterval": 5000 }, "threads": 0, "nettyThreads": 0, - "codec": null, - "useLinuxNativeEpoll": false + "codec": null } \ No newline at end of file diff --git a/persistence-modules/redis/src/main/resources/singleNodeConfig.yaml b/persistence-modules/redis/src/main/resources/singleNodeConfig.yaml index 1b05c46be2..9074434bd1 100644 --- a/persistence-modules/redis/src/main/resources/singleNodeConfig.yaml +++ b/persistence-modules/redis/src/main/resources/singleNodeConfig.yaml @@ -1,12 +1,9 @@ singleServerConfig: idleConnectionTimeout: 10000 - pingTimeout: 1000 connectTimeout: 10000 timeout: 3000 retryAttempts: 3 retryInterval: 1500 - reconnectionTimeout: 3000 - failedAttempts: 3 password: null subscriptionsPerConnection: 5 clientName: null @@ -16,9 +13,7 @@ singleServerConfig: connectionMinimumIdleSize: 10 connectionPoolSize: 64 database: 0 - dnsMonitoring: false dnsMonitoringInterval: 5000 threads: 0 nettyThreads: 0 -codec: ! {} -useLinuxNativeEpoll: false \ No newline at end of file +codec: ! {} \ No newline at end of file diff --git a/persistence-modules/redis/src/test/java/com/baeldung/RedissonConfigurationIntegrationTest.java b/persistence-modules/redis/src/test/java/com/baeldung/RedissonConfigurationIntegrationTest.java index 66f61ae5dd..c2e771d7b8 100644 --- a/persistence-modules/redis/src/test/java/com/baeldung/RedissonConfigurationIntegrationTest.java +++ b/persistence-modules/redis/src/test/java/com/baeldung/RedissonConfigurationIntegrationTest.java @@ -48,7 +48,7 @@ public class RedissonConfigurationIntegrationTest { public void givenJavaConfig_thenRedissonConnectToRedis() { Config config = new Config(); config.useSingleServer() - .setAddress(String.format("127.0.0.1:%s", port)); + .setAddress(String.format("redis://127.0.0.1:%s", port)); client = Redisson.create(config); diff --git a/persistence-modules/redis/src/test/java/com/baeldung/RedissonIntegrationTest.java b/persistence-modules/redis/src/test/java/com/baeldung/RedissonIntegrationTest.java index 53d77c2699..8c8e6a02dd 100644 --- a/persistence-modules/redis/src/test/java/com/baeldung/RedissonIntegrationTest.java +++ b/persistence-modules/redis/src/test/java/com/baeldung/RedissonIntegrationTest.java @@ -7,6 +7,7 @@ import org.redisson.Redisson; import org.redisson.RedissonMultiLock; import org.redisson.api.*; import org.redisson.client.RedisClient; +import org.redisson.client.RedisClientConfig; import org.redisson.client.RedisConnection; import org.redisson.client.codec.StringCodec; import org.redisson.client.protocol.RedisCommands; @@ -103,10 +104,10 @@ public class RedissonIntegrationTest { public void givenTopicSubscribedToAChannel_thenReceiveMessageFromChannel() throws ExecutionException, InterruptedException { CompletableFuture future = new CompletableFuture<>(); - RTopic subscribeTopic = client.getTopic("baeldung"); - subscribeTopic.addListener((channel, customMessage) -> future.complete(customMessage.getMessage())); + RTopic subscribeTopic = client.getTopic("baeldung"); + subscribeTopic.addListener(CustomMessage.class, (channel, customMessage) -> future.complete(customMessage.getMessage())); - RTopic publishTopic = client.getTopic("baeldung"); + RTopic publishTopic = client.getTopic("baeldung"); long clientsReceivedMessage = publishTopic.publish(new CustomMessage("This is a message")); @@ -203,10 +204,10 @@ public class RedissonIntegrationTest { batch.getMap("ledgerMap").fastPutAsync("1", "2"); batch.getMap("ledgerMap").putAsync("2", "5"); - List result = batch.execute(); + BatchResult batchResult = batch.execute(); RMap map = client.getMap("ledgerMap"); - assertTrue(result.size() > 0 && map.get("1").equals("2")); + assertTrue(batchResult.getResponses().size() > 0 && map.get("1").equals("2")); } @Test @@ -220,7 +221,9 @@ public class RedissonIntegrationTest { @Test public void givenLowLevelRedisCommands_thenExecuteLowLevelCommandsOnRedis(){ - RedisClient client = new RedisClient("localhost", 6379); + RedisClientConfig redisClientConfig = new RedisClientConfig(); + redisClientConfig.setAddress("localhost", 6379); + RedisClient client = RedisClient.create(redisClientConfig); RedisConnection conn = client.connect(); conn.sync(StringCodec.INSTANCE, RedisCommands.SET, "test", 0); diff --git a/persistence-modules/sirix/pom.xml b/persistence-modules/sirix/pom.xml index 0f114966f7..67de507cca 100644 --- a/persistence-modules/sirix/pom.xml +++ b/persistence-modules/sirix/pom.xml @@ -6,7 +6,7 @@ io.sirix sirix 1.0-SNAPSHOT - core-api-tutorial + sirix jar http://maven.apache.org diff --git a/persistence-modules/spring-boot-persistence-2/pom.xml b/persistence-modules/spring-boot-persistence-2/pom.xml index f36d8fc43f..e90d61fda3 100644 --- a/persistence-modules/spring-boot-persistence-2/pom.xml +++ b/persistence-modules/spring-boot-persistence-2/pom.xml @@ -6,7 +6,7 @@ com.baeldung.boot.persistence spring-boot-persistence-2 0.0.1-SNAPSHOT - spring-boot-jdbi + spring-boot-persistence-2 Sample SpringBoot JDBI Project diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index cc26ff58d5..9e44a7b9c1 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -74,7 +74,6 @@ - UTF-8 2.23.0 2.0.1.Final diff --git a/persistence-modules/spring-data-elasticsearch/README.md b/persistence-modules/spring-data-elasticsearch/README.md index 63f1185732..9f68a25243 100644 --- a/persistence-modules/spring-data-elasticsearch/README.md +++ b/persistence-modules/spring-data-elasticsearch/README.md @@ -6,7 +6,7 @@ - [Guide to Elasticsearch in Java](https://www.baeldung.com/elasticsearch-java) - [Geospatial Support in ElasticSearch](https://www.baeldung.com/elasticsearch-geo-spatial) - [A Simple Tagging Implementation with Elasticsearch](https://www.baeldung.com/elasticsearch-tagging) -- [Introduction to Spring Data Elasticsearch – test 2](https://www.baeldung.com/spring-data-elasticsearch-test-2) +- [Introduction to Spring Data Elasticsearch (evaluation)](https://www.baeldung.com/spring-data-elasticsearch-test-2) ### Build the Project with Tests Running ``` diff --git a/persistence-modules/spring-data-geode/pom.xml b/persistence-modules/spring-data-geode/pom.xml index 557d09376a..07aa65463c 100644 --- a/persistence-modules/spring-data-geode/pom.xml +++ b/persistence-modules/spring-data-geode/pom.xml @@ -85,7 +85,6 @@ 2.1.9.RELEASE - UTF-8 com.baeldung.springdatageode.app.ClientCacheApp 1.1.1.RELEASE 2.1.9.RELEASE diff --git a/persistence-modules/spring-data-jpa-5/README.md b/persistence-modules/spring-data-jpa-5/README.md index fa29c82bac..0b78ced66c 100644 --- a/persistence-modules/spring-data-jpa-5/README.md +++ b/persistence-modules/spring-data-jpa-5/README.md @@ -2,6 +2,7 @@ - [Spring JPA @Embedded and @EmbeddedId](https://www.baeldung.com/spring-jpa-embedded-method-parameters) - [Generate Database Schema with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-generate-db-schema) +- [Partial Data Update with Spring Data](https://www.baeldung.com/spring-data-partial-update) ### Eclipse Config After importing the project into Eclipse, you may see the following error: diff --git a/persistence-modules/spring-data-jpa-5/pom.xml b/persistence-modules/spring-data-jpa-5/pom.xml index 6a5cdc86c2..db58a16062 100644 --- a/persistence-modules/spring-data-jpa-5/pom.xml +++ b/persistence-modules/spring-data-jpa-5/pom.xml @@ -42,7 +42,7 @@ org.mapstruct mapstruct-jdk8 - 1.3.1.Final + ${mapstruct.version} provided @@ -68,4 +68,13 @@ + + + 2.1.9.RELEASE + com.baeldung.springdatageode.app.ClientCacheApp + 1.1.1.RELEASE + 2.1.9.RELEASE + 1.3.1.Final + + diff --git a/persistence-modules/spring-data-mongodb/pom.xml b/persistence-modules/spring-data-mongodb/pom.xml index 3f7c1cbcb9..fb80ba33ac 100644 --- a/persistence-modules/spring-data-mongodb/pom.xml +++ b/persistence-modules/spring-data-mongodb/pom.xml @@ -22,7 +22,7 @@ org.springframework.data spring-data-releasetrain - Lovelace-SR9 + ${spring-releasetrain} pom @@ -101,6 +101,7 @@ 1.1.3 1.9.2 3.2.0.RELEASE + Lovelace-SR9 diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index d2bf074d03..d271df31c7 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -98,7 +98,6 @@ 3.2.4 0.10.0 0.6 - 2.1.9.RELEASE 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 index d23d0092eb..de8e447ef8 100644 --- 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 @@ -31,11 +31,6 @@ public class RedisConfig { 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() diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/SpringRedisApplication.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/SpringRedisApplication.java new file mode 100644 index 0000000000..82c06f803b --- /dev/null +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/SpringRedisApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.spring.data.redis; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringRedisApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringRedisApplication.class, args); + } + +} 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 index 58846d7c27..cd5994c854 100644 --- 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 @@ -2,9 +2,6 @@ package com.baeldung.spring.data.reactive.redis.template; import com.baeldung.spring.data.reactive.redis.SpringRedisReactiveApplication; - -import java.io.IOException; - import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -13,7 +10,7 @@ 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.data.redis.core.ReactiveStringRedisTemplate; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.junit4.SpringRunner; @@ -21,6 +18,8 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import redis.embedded.RedisServerBuilder; +import java.io.IOException; + @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringRedisReactiveApplication.class) @DirtiesContext(classMode = ClassMode.BEFORE_CLASS) @@ -30,7 +29,7 @@ public class RedisTemplateListOpsIntegrationTest { private static redis.embedded.RedisServer redisServer; @Autowired - private ReactiveRedisTemplate redisTemplate; + private ReactiveStringRedisTemplate redisTemplate; private ReactiveListOperations reactiveListOps; 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 6f9e6a8757..6501f3f9f0 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 @@ -1,44 +1,40 @@ package com.baeldung.spring.data.redis; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.UUID; - +import com.baeldung.spring.data.redis.queue.RedisMessagePublisher; +import com.baeldung.spring.data.redis.queue.RedisMessageSubscriber; import org.junit.AfterClass; import org.junit.BeforeClass; 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.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.ClassMode; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import com.baeldung.spring.data.redis.config.RedisConfig; -import com.baeldung.spring.data.redis.queue.RedisMessagePublisher; -import com.baeldung.spring.data.redis.queue.RedisMessageSubscriber; - +import org.springframework.test.context.junit4.SpringRunner; import redis.embedded.RedisServerBuilder; -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = RedisConfig.class) +import java.util.UUID; + +import static org.junit.Assert.assertTrue; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringRedisApplication.class) @DirtiesContext(classMode = ClassMode.BEFORE_CLASS) public class RedisMessageListenerIntegrationTest { private static redis.embedded.RedisServer redisServer; - + @Autowired private RedisMessagePublisher redisMessagePublisher; - + @BeforeClass - public static void startRedisServer() throws IOException { + public static void startRedisServer() { redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 256M").build(); redisServer.start(); } - + @AfterClass - public static void stopRedisServer() throws IOException { + public static void stopRedisServer() { redisServer.stop(); } diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java index 6ae133ca7a..4927c9957c 100644 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -12,6 +12,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; +import org.springframework.data.domain.AuditorAware; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.hibernate4.HibernateTransactionManager; @@ -60,7 +61,7 @@ public class PersistenceConfig { } @Bean("auditorProvider") - public AuditorAwareImpl auditorAwareImpl() { + public AuditorAware auditorProvider() { return new AuditorAwareImpl(); } diff --git a/persistence-modules/spring-jpa/pom.xml b/persistence-modules/spring-jpa/pom.xml index ef05269c92..410ed592b0 100644 --- a/persistence-modules/spring-jpa/pom.xml +++ b/persistence-modules/spring-jpa/pom.xml @@ -133,8 +133,6 @@ 5.1.5.RELEASE 3.21.0-GA - - 5.2.17.Final 6.0.6 2.1.5.RELEASE diff --git a/persistence-modules/spring-persistence-simple-2/README.md b/persistence-modules/spring-persistence-simple-2/README.md index 477c938f89..d80c7efc57 100644 --- a/persistence-modules/spring-persistence-simple-2/README.md +++ b/persistence-modules/spring-persistence-simple-2/README.md @@ -3,3 +3,4 @@ - [Spring JdbcTemplate Unit Testing](https://www.baeldung.com/spring-jdbctemplate-testing) - [Using a List of Values in a JdbcTemplate IN Clause](https://www.baeldung.com/spring-jdbctemplate-in-list) - [Transactional Annotations: Spring vs. JTA](https://www.baeldung.com/spring-vs-jta-transactional) +- [Test a Mock JNDI Datasource with Spring](https://www.baeldung.com/spring-mock-jndi-datasource) diff --git a/pom.xml b/pom.xml index 7958b31a31..9d9c448887 100644 --- a/pom.xml +++ b/pom.xml @@ -343,26 +343,18 @@ animal-sniffer-mvn-plugin annotations antlr - - apache-avro - apache-bval - apache-curator - apache-cxf - apache-geode - apache-meecrowave - apache-olingo/olingo2 - apache-opennlp - apache-poi - apache-pulsar + + apache-cxf + apache-libraries + apache-olingo/olingo2 + apache-poi apache-rocketmq - apache-shiro - apache-solrj + apache-shiro apache-spark apache-tapestry apache-thrift apache-tika - apache-velocity - apache-zookeeper + apache-velocity asciidoctor asm @@ -394,6 +386,7 @@ core-java-modules core-kotlin-modules + core-scala couchbase custom-pmd @@ -424,6 +417,7 @@ grpc gson guava + guava-2 guava-collections guava-collections-map guava-collections-set @@ -517,7 +511,7 @@ machine-learning mapstruct - maven-all + maven-modules maven-archetype maven-polyglot @@ -565,6 +559,8 @@ rxjava-operators atomikos + reactive-systems + slack @@ -655,6 +651,7 @@ spring-data-rest spring-data-rest-querydsl spring-di + spring-di-2 spring-dispatcher-servlet spring-drools @@ -712,6 +709,7 @@ spring-rest-shell spring-rest-simple spring-resttemplate + spring-resttemplate-2 spring-rest-testing spring-roo @@ -864,27 +862,18 @@ animal-sniffer-mvn-plugin annotations antlr - - apache-avro - apache-beam - apache-bval - apache-curator - apache-cxf - apache-geode - apache-meecrowave - apache-olingo/olingo2 - apache-opennlp - apache-poi - apache-pulsar + + apache-cxf + apache-libraries + apache-olingo/olingo2 + apache-poi apache-rocketmq - apache-shiro - apache-solrj + apache-shiro apache-spark apache-tapestry apache-thrift apache-tika - apache-velocity - apache-zookeeper + apache-velocity asciidoctor asm @@ -915,6 +904,7 @@ core-java-modules core-kotlin-modules + core-scala couchbase custom-pmd @@ -1036,7 +1026,7 @@ machine-learning mapstruct - maven-all + maven-modules maven-archetype maven-polyglot @@ -1084,6 +1074,8 @@ rxjava-operators atomikos + reactive-systems + slack @@ -1224,6 +1216,7 @@ spring-rest-shell spring-rest-simple spring-resttemplate + spring-resttemplate-2 spring-rest-testing spring-roo diff --git a/reactive-systems/README.md b/reactive-systems/README.md new file mode 100644 index 0000000000..0558dd141e --- /dev/null +++ b/reactive-systems/README.md @@ -0,0 +1,7 @@ +## Reactive Systems in Java + +This module contains services for article about reactive systems in Java. Please note that these secrives comprise parts of a full stack application to demonstrate the capabilities of a reactive system. Unless there is an article which extends on this concept, this is probably not a suitable module to add other code. + +### Relevant Articles + +- [Reactive Systems in Java](https://www.baeldung.com/) diff --git a/reactive-systems/frontend/Dockerfile b/reactive-systems/frontend/Dockerfile new file mode 100644 index 0000000000..613126c436 --- /dev/null +++ b/reactive-systems/frontend/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:alpine +COPY nginx.conf /etc/nginx/nginx.conf +WORKDIR /usr/share/nginx/html +COPY dist/frontend . \ No newline at end of file diff --git a/reactive-systems/frontend/README.md b/reactive-systems/frontend/README.md new file mode 100644 index 0000000000..8b22673d92 --- /dev/null +++ b/reactive-systems/frontend/README.md @@ -0,0 +1,27 @@ +# Frontend + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.6. + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/reactive-systems/frontend/angular.json b/reactive-systems/frontend/angular.json new file mode 100644 index 0000000000..1c80d77b7f --- /dev/null +++ b/reactive-systems/frontend/angular.json @@ -0,0 +1,125 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "frontend": { + "projectType": "application", + "schematics": {}, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/frontend", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "aot": true, + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "node_modules/bootstrap/dist/css/bootstrap.min.css", + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "frontend:build" + }, + "configurations": { + "production": { + "browserTarget": "frontend:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "frontend:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.css" + ], + "scripts": [] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "tsconfig.app.json", + "tsconfig.spec.json", + "e2e/tsconfig.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "frontend:serve" + }, + "configurations": { + "production": { + "devServerTarget": "frontend:serve:production" + } + } + } + } + }}, + "defaultProject": "frontend" +} diff --git a/reactive-systems/frontend/browserslist b/reactive-systems/frontend/browserslist new file mode 100644 index 0000000000..80848532e4 --- /dev/null +++ b/reactive-systems/frontend/browserslist @@ -0,0 +1,12 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/reactive-systems/frontend/e2e/protractor.conf.js b/reactive-systems/frontend/e2e/protractor.conf.js new file mode 100644 index 0000000000..7c798cfff0 --- /dev/null +++ b/reactive-systems/frontend/e2e/protractor.conf.js @@ -0,0 +1,32 @@ +// @ts-check +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +/** + * @type { import("protractor").Config } + */ +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './src/**/*.e2e-spec.ts' + ], + capabilities: { + browserName: 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: require('path').join(__dirname, './tsconfig.json') + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; \ No newline at end of file diff --git a/reactive-systems/frontend/e2e/src/app.e2e-spec.ts b/reactive-systems/frontend/e2e/src/app.e2e-spec.ts new file mode 100644 index 0000000000..f8b8268fb2 --- /dev/null +++ b/reactive-systems/frontend/e2e/src/app.e2e-spec.ts @@ -0,0 +1,23 @@ +import { AppPage } from './app.po'; +import { browser, logging } from 'protractor'; + +describe('workspace-project App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getTitleText()).toEqual('frontend app is running!'); + }); + + afterEach(async () => { + // Assert that there are no errors emitted from the browser + const logs = await browser.manage().logs().get(logging.Type.BROWSER); + expect(logs).not.toContain(jasmine.objectContaining({ + level: logging.Level.SEVERE, + } as logging.Entry)); + }); +}); diff --git a/reactive-systems/frontend/e2e/src/app.po.ts b/reactive-systems/frontend/e2e/src/app.po.ts new file mode 100644 index 0000000000..b68475e0fc --- /dev/null +++ b/reactive-systems/frontend/e2e/src/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo(): Promise { + return browser.get(browser.baseUrl) as Promise; + } + + getTitleText(): Promise { + return element(by.css('app-root .content span')).getText() as Promise; + } +} diff --git a/reactive-systems/frontend/e2e/tsconfig.json b/reactive-systems/frontend/e2e/tsconfig.json new file mode 100644 index 0000000000..39b800f789 --- /dev/null +++ b/reactive-systems/frontend/e2e/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/reactive-systems/frontend/karma.conf.js b/reactive-systems/frontend/karma.conf.js new file mode 100644 index 0000000000..d26663c10d --- /dev/null +++ b/reactive-systems/frontend/karma.conf.js @@ -0,0 +1,32 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, './coverage/frontend'), + reports: ['html', 'lcovonly', 'text-summary'], + fixWebpackSourcePaths: true + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true + }); +}; diff --git a/reactive-systems/frontend/nginx.conf b/reactive-systems/frontend/nginx.conf new file mode 100644 index 0000000000..7e3498c8bd --- /dev/null +++ b/reactive-systems/frontend/nginx.conf @@ -0,0 +1,25 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html index.htm; + include /etc/nginx/mime.types; + + gzip on; + gzip_min_length 1000; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; + + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file diff --git a/reactive-systems/frontend/package-lock.json b/reactive-systems/frontend/package-lock.json new file mode 100644 index 0000000000..ec8551d877 --- /dev/null +++ b/reactive-systems/frontend/package-lock.json @@ -0,0 +1,13341 @@ +{ + "name": "frontend", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@angular-devkit/architect": { + "version": "0.901.7", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.901.7.tgz", + "integrity": "sha512-yW/PUEqle55QihOFbmeNXaVTodhfeXkteoFDUpz+YpX3xiQDXDtNbIJSzKOQTojtBKdSMKMvZkQLr+RAa7/1EA==", + "dev": true, + "requires": { + "@angular-devkit/core": "9.1.7", + "rxjs": "6.5.4" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@angular-devkit/build-angular": { + "version": "0.901.7", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-0.901.7.tgz", + "integrity": "sha512-NiBwapx/XJqYGzSmENff78i6Yif9PjYDJ9BB+59t2eDofkCZUcPFrhQmRgliO7rt6RATvT81lDP89+LBXCTQPw==", + "dev": true, + "requires": { + "@angular-devkit/architect": "0.901.7", + "@angular-devkit/build-optimizer": "0.901.7", + "@angular-devkit/build-webpack": "0.901.7", + "@angular-devkit/core": "9.1.7", + "@babel/core": "7.9.0", + "@babel/generator": "7.9.3", + "@babel/preset-env": "7.9.0", + "@babel/template": "7.8.6", + "@jsdevtools/coverage-istanbul-loader": "3.0.3", + "@ngtools/webpack": "9.1.7", + "ajv": "6.12.0", + "autoprefixer": "9.7.4", + "babel-loader": "8.0.6", + "browserslist": "^4.9.1", + "cacache": "15.0.0", + "caniuse-lite": "^1.0.30001032", + "circular-dependency-plugin": "5.2.0", + "copy-webpack-plugin": "5.1.1", + "core-js": "3.6.4", + "css-loader": "3.5.1", + "cssnano": "4.1.10", + "file-loader": "6.0.0", + "find-cache-dir": "3.3.1", + "glob": "7.1.6", + "jest-worker": "25.1.0", + "karma-source-map-support": "1.4.0", + "less": "3.11.1", + "less-loader": "5.0.0", + "license-webpack-plugin": "2.1.4", + "loader-utils": "2.0.0", + "mini-css-extract-plugin": "0.9.0", + "minimatch": "3.0.4", + "open": "7.0.3", + "parse5": "4.0.0", + "postcss": "7.0.27", + "postcss-import": "12.0.1", + "postcss-loader": "3.0.0", + "raw-loader": "4.0.0", + "regenerator-runtime": "0.13.5", + "rimraf": "3.0.2", + "rollup": "2.1.0", + "rxjs": "6.5.4", + "sass": "1.26.3", + "sass-loader": "8.0.2", + "semver": "7.1.3", + "source-map": "0.7.3", + "source-map-loader": "0.2.4", + "speed-measure-webpack-plugin": "1.3.1", + "style-loader": "1.1.3", + "stylus": "0.54.7", + "stylus-loader": "3.0.2", + "terser": "4.6.10", + "terser-webpack-plugin": "2.3.5", + "tree-kill": "1.2.2", + "webpack": "4.42.0", + "webpack-dev-middleware": "3.7.2", + "webpack-dev-server": "3.11.0", + "webpack-merge": "4.2.2", + "webpack-sources": "1.4.3", + "webpack-subresource-integrity": "1.4.0", + "worker-plugin": "4.0.3" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@angular-devkit/build-optimizer": { + "version": "0.901.7", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.901.7.tgz", + "integrity": "sha512-Xuce3StdxhcgLYb0BAaFGr3Bzj5EM2OsAqIT15PkikWY1k5cK50vPxoC/BkX4QDL9eXSHtqAfMBfA6h5N422vw==", + "dev": true, + "requires": { + "loader-utils": "2.0.0", + "source-map": "0.7.3", + "tslib": "1.11.1", + "typescript": "3.6.5", + "webpack-sources": "1.4.3" + }, + "dependencies": { + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, + "typescript": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.5.tgz", + "integrity": "sha512-BEjlc0Z06ORZKbtcxGrIvvwYs5hAnuo6TKdNFL55frVDlB+na3z5bsLhFaIxmT+dPWgBIjMo6aNnTOgHHmHgiQ==", + "dev": true + } + } + }, + "@angular-devkit/build-webpack": { + "version": "0.901.7", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.901.7.tgz", + "integrity": "sha512-pTLW5Eqy9cHgv78LKiH0e30lxqKzUPjh1djvNtFsEemOHsfKQdAfjLjikoaQvqMoBKVaUU7r2vmyyS17cH+1yw==", + "dev": true, + "requires": { + "@angular-devkit/architect": "0.901.7", + "@angular-devkit/core": "9.1.7", + "rxjs": "6.5.4" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@angular-devkit/core": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-9.1.7.tgz", + "integrity": "sha512-guvolu9Cl+qYMTtedLZD9wCqustJjdqzJ2psD2C1Sr1LrX9T0mprmDldR/YnhsitThveJEb6sM/0EvqWxoSvKw==", + "dev": true, + "requires": { + "ajv": "6.12.0", + "fast-json-stable-stringify": "2.1.0", + "magic-string": "0.25.7", + "rxjs": "6.5.4", + "source-map": "0.7.3" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@angular-devkit/schematics": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-9.1.7.tgz", + "integrity": "sha512-oeHPJePBcPp/bd94jHQeFUnft93PGF5iJiKV9szxqS8WWC5OMZ5eK7icRY0PwvLyfenspAZxdZcNaqJqPMul5A==", + "dev": true, + "requires": { + "@angular-devkit/core": "9.1.7", + "ora": "4.0.3", + "rxjs": "6.5.4" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@angular/animations": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-9.1.9.tgz", + "integrity": "sha512-qWVi0TxmU6HeXAgEsfpQvFFygh+a0kH2kGe6bWij4XvG6dWfV3xZjlaFwSIYGk+yK4yL0+9+PAXH+ENfxNw+Cw==" + }, + "@angular/cli": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-9.1.7.tgz", + "integrity": "sha512-NhsIa725S/U/n7nDxp6ForusdYHEXF4aSIvsFRdoK6vbQ889c5e1Rdj+T5EWXLmpQZxeprSKhLI2alNX0nVhhQ==", + "dev": true, + "requires": { + "@angular-devkit/architect": "0.901.7", + "@angular-devkit/core": "9.1.7", + "@angular-devkit/schematics": "9.1.7", + "@schematics/angular": "9.1.7", + "@schematics/update": "0.901.7", + "@yarnpkg/lockfile": "1.1.0", + "ansi-colors": "4.1.1", + "debug": "4.1.1", + "ini": "1.3.5", + "inquirer": "7.1.0", + "npm-package-arg": "8.0.1", + "npm-pick-manifest": "6.0.0", + "open": "7.0.3", + "pacote": "9.5.12", + "read-package-tree": "5.3.1", + "rimraf": "3.0.2", + "semver": "7.1.3", + "symbol-observable": "1.2.0", + "universal-analytics": "0.4.20", + "uuid": "7.0.2" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "uuid": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.2.tgz", + "integrity": "sha512-vy9V/+pKG+5ZTYKf+VcphF5Oc6EFiu3W8Nv3P3zIh0EqVI80ZxOzuPfe9EHjkFNvf8+xuTHVeei4Drydlx4zjw==", + "dev": true + } + } + }, + "@angular/common": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-9.1.9.tgz", + "integrity": "sha512-y/tJtkuOJhV2kcaXZyrLZH84i4uQ1r+vaaEHvXj+JZYfYfcMMd/TDqMiPcIkUb3RxqghtZ+q0ZNW5D1Nlru3Pw==" + }, + "@angular/compiler": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.1.9.tgz", + "integrity": "sha512-kjFgaTB2ckr9lgmkS1dOGRT7kmzpQueydxsxXSHWgICNVE6F/u1PHyeSOyJRpxW0GnrkLq3QM2EUFnQGGga5bg==" + }, + "@angular/compiler-cli": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-9.1.9.tgz", + "integrity": "sha512-aLr2eaDlREN8XybgTbelvjtSZ8eAkxBPilnkddc700BgiC6ImyUSKaItOwa8bnjQwq4Wlz5eVG0ibsrX+5MXwg==", + "dev": true, + "requires": { + "canonical-path": "1.0.0", + "chokidar": "^3.0.0", + "convert-source-map": "^1.5.1", + "dependency-graph": "^0.7.2", + "fs-extra": "4.0.2", + "magic-string": "^0.25.0", + "minimist": "^1.2.0", + "reflect-metadata": "^0.1.2", + "semver": "^6.3.0", + "source-map": "^0.6.1", + "sourcemap-codec": "^1.4.8", + "yargs": "15.3.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.0.tgz", + "integrity": "sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.0" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "@angular/core": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-9.1.9.tgz", + "integrity": "sha512-q/DERgVU6vK2LtTcdVCGGBcoO424WsEfImh3Vcuy+P/ZVmthlDUC/+q+tSKt8MMf4hLpxFDQJE8vUSkktj7QEw==" + }, + "@angular/forms": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-9.1.9.tgz", + "integrity": "sha512-r675yImnb/0pY7K5W3V2ITa7YETu1I2AS+bRfII6UQ6gthyeFFOHb5noa7YneC2yqQiM6E4DQmF5ig3daPuFNg==" + }, + "@angular/platform-browser": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-9.1.9.tgz", + "integrity": "sha512-V861X3MxJp1AlMTnkUPldpBLIJbApXF3ka0A5Dq2nVJCyOFeteGkaRWSBgqe2jxmq+LVpJbzcNvtDFXw6mQ0jA==" + }, + "@angular/platform-browser-dynamic": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-9.1.9.tgz", + "integrity": "sha512-b9MG5MWne+IuL3uLm8jwPhlJzqYaGBGk/qibOqb17T24j1iyrlO7T5bZ8zO6pUy5iT/TahVfHPnPJC1qTK5OmA==" + }, + "@angular/router": { + "version": "9.1.9", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-9.1.9.tgz", + "integrity": "sha512-4u+CWMPB4hCkAsFCEzC94YEWT0wVozqGkc/Dortt2hFaqvZpIegg6iJVZlDxuyDjzFYBPnnbTDdgiTTA8ckfuA==" + }, + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/compat-data": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.1.tgz", + "integrity": "sha512-CHvCj7So7iCkGKPRFUfryXIkU2gSBw7VSZFYLsqVhrS47269VK2Hfi9S/YcublPMW8k1u2bQBlbDruoQEm4fgw==", + "dev": true, + "requires": { + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "semver": "^5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/core": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.9.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.3.tgz", + "integrity": "sha512-RpxM252EYsz9qLUIq6F7YJyK1sv0wWDBFuztfDGWaQKzHjqDHysxSiRUpA/X9jmfqo+WzkAVKFaUily5h+gDCQ==", + "dev": true, + "requires": { + "@babel/types": "^7.9.0", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.1.tgz", + "integrity": "sha512-ewp3rvJEwLaHgyWGe4wQssC2vjks3E80WiUe2BpMb0KhreTjMROCbxXcEovTrbeGVdQct5VjQfrv9EgC+xMzCw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.1.tgz", + "integrity": "sha512-cQpVq48EkYxUU0xozpGCLla3wlkdRRqLWu1ksFMXA9CM5KQmyyRpSEsYXbao7JUkOw/tAaYKCaYyZq6HOFYtyw==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.2.tgz", + "integrity": "sha512-hYgOhF4To2UTB4LTaZepN/4Pl9LD4gfbJx8A34mqoluT8TLbof1mhUlYuNWTEebONa8+UlCC4X0TEXu7AOUyGA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.1", + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "levenary": "^1.1.1", + "semver": "^5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.1.tgz", + "integrity": "sha512-Rx4rHS0pVuJn5pJOqaqcZR4XSgeF9G/pO/79t+4r7380tXFJdzImFnxMU19f83wjSrmKHq6myrM10pFHTGzkUA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-regex": "^7.10.1", + "regexpu-core": "^4.7.0" + } + }, + "@babel/helper-define-map": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.1.tgz", + "integrity": "sha512-+5odWpX+OnvkD0Zmq7panrMuAGQBu6aPUgvMzuMGo4R+jUOvealEj2hiqI6WhxgKrTpFoFj0+VdsuA8KDxHBDg==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/types": "^7.10.1", + "lodash": "^4.17.13" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.1.tgz", + "integrity": "sha512-vcUJ3cDjLjvkKzt6rHrl767FeE7pMEYfPanq5L16GRtrXIoznc0HykNW2aEYkcnP76P0isoqJ34dDMFZwzEpJg==", + "dev": true, + "requires": { + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-function-name": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", + "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + } + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", + "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.1.tgz", + "integrity": "sha512-vLm5srkU8rI6X3+aQ1rQJyfjvCBLXP8cAGeuw04zeAM2ItKb1e7pmVmLyHb4sDaAYnLL13RHOZPLEtcGZ5xvjg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz", + "integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.1.tgz", + "integrity": "sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-module-transforms": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", + "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + } + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz", + "integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.1.tgz", + "integrity": "sha512-fvoGeXt0bJc7VMWZGCAEBEMo/HAjW2mP8apF5eXK0wSqwLAVHAISCWRoLMBMUs2kqeaG77jltVqu4Hn8Egl3nA==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.1.tgz", + "integrity": "sha512-7isHr19RsIJWWLLFn21ubFt223PjQyg1HY7CZEMRr820HttHPpVvrsIN3bUOo44DEfFV4kBXO7Abbn9KTUZV7g==", + "dev": true, + "requires": { + "lodash": "^4.17.13" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.1.tgz", + "integrity": "sha512-RfX1P8HqsfgmJ6CwaXGKMAqbYdlleqglvVtht0HGPMSsy2V6MqLlOJVF/0Qyb/m2ZCi2z3q3+s6Pv7R/dQuZ6A==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-wrap-function": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + } + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", + "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", + "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + } + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", + "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.1.tgz", + "integrity": "sha512-C0MzRGteVDn+H32/ZgbAv5r56f2o1fZSA/rj/TYo8JEJNHg+9BdSmKBUND0shxWRztWhjlT2cvHYuynpPsVJwQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + } + } + }, + "@babel/helpers": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", + "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + } + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", + "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.1.tgz", + "integrity": "sha512-vzZE12ZTdB336POZjmpblWfNNRpMSua45EYnRigE2XsZxcXcIyly2ixnTJasJE4Zq3U7t2d8rRF7XRUuzHxbOw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-remap-async-to-generator": "^7.10.1", + "@babel/plugin-syntax-async-generators": "^7.8.0" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.1.tgz", + "integrity": "sha512-Cpc2yUVHTEGPlmiQzXj026kqwjEQAD9I4ZC16uzdbgWgitg/UHKHLffKNCQZ5+y8jpIZPJcKcwsr2HwPh+w3XA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.1.tgz", + "integrity": "sha512-m8r5BmV+ZLpWPtMY2mOKN7wre6HIO4gfIiV+eOmsnZABNenrt/kzYBwrh+KOfgumSWpnlGs5F70J8afYMSJMBg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-json-strings": "^7.8.0" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.1.tgz", + "integrity": "sha512-56cI/uHYgL2C8HVuHOuvVowihhX0sxb3nnfVRzUeVHTWmRHTZrKuAh/OBIMggGU/S1g/1D2CRCXqP+3u7vX7iA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.1.tgz", + "integrity": "sha512-jjfym4N9HtCiNfyyLAVD8WqPYeHUrw4ihxuAynWj6zzp2gf9Ey2f7ImhFm6ikB3CLf5Z/zmcJDri6B4+9j9RsA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-numeric-separator": "^7.10.1" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.10.1.tgz", + "integrity": "sha512-Z+Qri55KiQkHh7Fc4BW6o+QBuTagbOp9txE+4U1i79u9oWlf2npkiDx+Rf3iK3lbcHBuNy9UOkwuR5wOMH3LIQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.10.1" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.1.tgz", + "integrity": "sha512-VqExgeE62YBqI3ogkGoOJp1R6u12DFZjqwJhqtKc2o5m1YTUuUWnos7bZQFBhwkxIFpWYJ7uB75U7VAPPiKETA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.10.1.tgz", + "integrity": "sha512-dqQj475q8+/avvok72CF3AOSV/SGEcH29zT5hhohqqvvZ2+boQoOr7iGldBG5YXTO2qgCgc2B3WvVLUdbeMlGA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.1.tgz", + "integrity": "sha512-JjfngYRvwmPwmnbRZyNiPFI8zxCZb8euzbCG/LxyKdeTb59tVciKo9GK9bi6JYKInk1H11Dq9j/zRqIH4KigfQ==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.1.tgz", + "integrity": "sha512-uTd0OsHrpe3tH5gRPTxG8Voh99/WCU78vIm5NMRYPAqC8lR4vajt6KkCAknCHrx24vkPdd/05yfdGSB4EIY2mg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.1.tgz", + "integrity": "sha512-hgA5RYkmZm8FTFT3yu2N9Bx7yVVOKYT6yEdXXo6j2JTm0wNxgqaGeQVaSHRjhfnQbX91DtjFB6McRFSlcJH3xQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.1.tgz", + "integrity": "sha512-6AZHgFJKP3DJX0eCNJj01RpytUa3SOGawIxweHkNX2L6PYikOZmoh5B0d7hIHaIgveMjX990IAa/xK7jRTN8OA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.1.tgz", + "integrity": "sha512-XCgYjJ8TY2slj6SReBUyamJn3k2JLUIiiR5b6t1mNCMSvv7yx+jJpaewakikp0uWFQSF7ChPPoe3dHmXLpISkg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-remap-async-to-generator": "^7.10.1" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.1.tgz", + "integrity": "sha512-B7K15Xp8lv0sOJrdVAoukKlxP9N59HS48V1J3U/JGj+Ad+MHq+am6xJVs85AgXrQn4LV8vaYFOB+pr/yIuzW8Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.1.tgz", + "integrity": "sha512-8bpWG6TtF5akdhIm/uWTyjHqENpy13Fx8chg7pFH875aNLwX8JxIxqm08gmAT+Whe6AOmaTeLPe7dpLbXt+xUw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "lodash": "^4.17.13" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.1.tgz", + "integrity": "sha512-P9V0YIh+ln/B3RStPoXpEQ/CoAxQIhRSUn7aXqQ+FZJ2u8+oCtjIXR3+X0vsSD8zv+mb56K7wZW1XiDTDGiDRQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-define-map": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.1.tgz", + "integrity": "sha512-mqSrGjp3IefMsXIenBfGcPXxJxweQe2hEIwMQvjtiDQ9b1IBvDUjkAtV/HMXX47/vXf14qDNedXsIiNd1FmkaQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.1.tgz", + "integrity": "sha512-V/nUc4yGWG71OhaTH705pU8ZSdM6c1KmmLP8ys59oOYbT7RpMYAR3MsVOt6OHL0WzG7BlTU076va9fjJyYzJMA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.1.tgz", + "integrity": "sha512-19VIMsD1dp02RvduFUmfzj8uknaO3uiHHF0s3E1OHnVsNj8oge8EQ5RzHRbJjGSetRnkEuBYO7TG1M5kKjGLOA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.1.tgz", + "integrity": "sha512-wIEpkX4QvX8Mo9W6XF3EdGttrIPZWozHfEaDTU0WJD/TDnXMvdDh30mzUl/9qWhnf7naicYartcEfUghTCSNpA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.1.tgz", + "integrity": "sha512-lr/przdAbpEA2BUzRvjXdEDLrArGRRPwbaF9rvayuHRvdQ7lUTTkZnhZrJ4LE2jvgMRFF4f0YuPQ20vhiPYxtA==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.1.tgz", + "integrity": "sha512-US8KCuxfQcn0LwSCMWMma8M2R5mAjJGsmoCBVwlMygvmDUMkTCykc84IqN1M7t+agSfOmLYTInLCHJM+RUoz+w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.1.tgz", + "integrity": "sha512-//bsKsKFBJfGd65qSNNh1exBy5Y9gD9ZN+DvrJ8f7HXr4avE5POW6zB7Rj6VnqHV33+0vXWUwJT0wSHubiAQkw==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.1.tgz", + "integrity": "sha512-qi0+5qgevz1NHLZroObRm5A+8JJtibb7vdcPQF1KQE12+Y/xxl8coJ+TpPW9iRq+Mhw/NKLjm+5SHtAHCC7lAw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.1.tgz", + "integrity": "sha512-UmaWhDokOFT2GcgU6MkHC11i0NQcL63iqeufXWfRy6pUOGYeCGEKhvfFO6Vz70UfYJYHwveg62GS83Rvpxn+NA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.1.tgz", + "integrity": "sha512-31+hnWSFRI4/ACFr1qkboBbrTxoBIzj7qA69qlq8HY8p7+YCzkCT6/TvQ1a4B0z27VeWtAeJd6pr5G04dc1iHw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.1.tgz", + "integrity": "sha512-AQG4fc3KOah0vdITwt7Gi6hD9BtQP/8bhem7OjbaMoRNCH5Djx42O2vYMfau7QnAzQCa+RJnhJBmFFMGpQEzrg==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.1.tgz", + "integrity": "sha512-ewNKcj1TQZDL3YnO85qh9zo1YF1CHgmSTlRQgHqe63oTrMI85cthKtZjAiZSsSNjPQ5NCaYo5QkbYqEw1ZBgZA==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.10.1", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.1.tgz", + "integrity": "sha512-EIuiRNMd6GB6ulcYlETnYYfgv4AxqrswghmBRQbWLHZxN4s7mupxzglnHqk9ZiUpDI4eRWewedJJNj67PWOXKA==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", + "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.8.3" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.1.tgz", + "integrity": "sha512-MBlzPc1nJvbmO9rPr1fQwXOM2iGut+JC92ku6PbiJMMK7SnQc1rytgpopveE3Evn47gzvGYeCdgfCDbZo0ecUw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.1.tgz", + "integrity": "sha512-WnnStUDN5GL+wGQrJylrnnVlFhFmeArINIR9gjhSeYyvroGhBrSAXYg/RHsnfzmsa+onJrTJrEClPzgNmmQ4Gw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.1.tgz", + "integrity": "sha512-tJ1T0n6g4dXMsL45YsSzzSDZCxiHXAQp/qHrucOq5gEHncTA3xDxnd5+sZcoQp+N1ZbieAaB8r/VUCG0gqseOg==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.1.tgz", + "integrity": "sha512-Kr6+mgag8auNrgEpbfIWzdXYOvqDHZOF0+Bx2xh4H2EDNwcbRb9lY6nkZg8oSjsX+DH9Ebxm9hOqtKW+gRDeNA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.1.tgz", + "integrity": "sha512-B3+Y2prScgJ2Bh/2l9LJxKbb8C8kRfsG4AdPT+n7ixBHIxJaIG8bi8tgjxUMege1+WqSJ+7gu1YeoMVO3gPWzw==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.1.tgz", + "integrity": "sha512-qN1OMoE2nuqSPmpTqEM7OvJ1FkMEV+BjVeZZm9V9mq/x1JLKQ4pcv8riZJMNN3u2AUGl0ouOMjRr2siecvHqUQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.1.tgz", + "integrity": "sha512-AR0E/lZMfLstScFwztApGeyTHJ5u3JUKMjneqRItWeEqDdHWZwAOKycvQNCasCK/3r5YXsuNG25funcJDu7Y2g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.10.1.tgz", + "integrity": "sha512-8wTPym6edIrClW8FI2IoaePB91ETOtg36dOkj3bYcNe7aDMN2FXEoUa+WrmPc4xa1u2PQK46fUX2aCb+zo9rfw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.1.tgz", + "integrity": "sha512-j17ojftKjrL7ufX8ajKvwRilwqTok4q+BjkknmQw9VNHnItTyMP5anPFzxFJdCQs7clLcWpCV3ma+6qZWLnGMA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-regex": "^7.10.1" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.1.tgz", + "integrity": "sha512-t7B/3MQf5M1T9hPCRG28DNGZUuxAuDqLYS03rJrIk2prj/UV7Z6FOneijhQhnv/Xa039vidXeVbvjK2SK5f7Gg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.1.tgz", + "integrity": "sha512-qX8KZcmbvA23zDi+lk9s6hC1FM7jgLHYIjuLgULgc8QtYnmB3tAVIYkNoKRQ75qWBeyzcoMoK8ZQmogGtC/w0g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.1.tgz", + "integrity": "sha512-Y/2a2W299k0VIUdbqYm9X2qS6fE0CUBhhiPpimK6byy7OJ/kORLlIX+J6UrjgNu5awvs62k+6RSslxhcvVw2Tw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/preset-env": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.0.tgz", + "integrity": "sha512-712DeRXT6dyKAM/FMbQTV/FvRCms2hPCx+3weRjZ8iQVQWZejWWk1wwG6ViWMyqb/ouBbGOl5b6aCk0+j1NmsQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.9.0", + "@babel/helper-compilation-targets": "^7.8.7", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-proposal-async-generator-functions": "^7.8.3", + "@babel/plugin-proposal-dynamic-import": "^7.8.3", + "@babel/plugin-proposal-json-strings": "^7.8.3", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-proposal-numeric-separator": "^7.8.3", + "@babel/plugin-proposal-object-rest-spread": "^7.9.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.9.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.3", + "@babel/plugin-transform-arrow-functions": "^7.8.3", + "@babel/plugin-transform-async-to-generator": "^7.8.3", + "@babel/plugin-transform-block-scoped-functions": "^7.8.3", + "@babel/plugin-transform-block-scoping": "^7.8.3", + "@babel/plugin-transform-classes": "^7.9.0", + "@babel/plugin-transform-computed-properties": "^7.8.3", + "@babel/plugin-transform-destructuring": "^7.8.3", + "@babel/plugin-transform-dotall-regex": "^7.8.3", + "@babel/plugin-transform-duplicate-keys": "^7.8.3", + "@babel/plugin-transform-exponentiation-operator": "^7.8.3", + "@babel/plugin-transform-for-of": "^7.9.0", + "@babel/plugin-transform-function-name": "^7.8.3", + "@babel/plugin-transform-literals": "^7.8.3", + "@babel/plugin-transform-member-expression-literals": "^7.8.3", + "@babel/plugin-transform-modules-amd": "^7.9.0", + "@babel/plugin-transform-modules-commonjs": "^7.9.0", + "@babel/plugin-transform-modules-systemjs": "^7.9.0", + "@babel/plugin-transform-modules-umd": "^7.9.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", + "@babel/plugin-transform-new-target": "^7.8.3", + "@babel/plugin-transform-object-super": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.8.7", + "@babel/plugin-transform-property-literals": "^7.8.3", + "@babel/plugin-transform-regenerator": "^7.8.7", + "@babel/plugin-transform-reserved-words": "^7.8.3", + "@babel/plugin-transform-shorthand-properties": "^7.8.3", + "@babel/plugin-transform-spread": "^7.8.3", + "@babel/plugin-transform-sticky-regex": "^7.8.3", + "@babel/plugin-transform-template-literals": "^7.8.3", + "@babel/plugin-transform-typeof-symbol": "^7.8.4", + "@babel/plugin-transform-unicode-regex": "^7.8.3", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.9.0", + "browserslist": "^4.9.1", + "core-js-compat": "^3.6.2", + "invariant": "^2.2.2", + "levenary": "^1.1.1", + "semver": "^5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/preset-modules": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", + "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/runtime": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz", + "integrity": "sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/traverse": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", + "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/generator": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", + "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", + "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, + "@jsdevtools/coverage-istanbul-loader": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/coverage-istanbul-loader/-/coverage-istanbul-loader-3.0.3.tgz", + "integrity": "sha512-TAdNkeGB5Fe4Og+ZkAr1Kvn9by2sfL44IAHFtxlh1BA1XJ5cLpO9iSNki5opWESv3l3vSHsZ9BNKuqFKbEbFaA==", + "dev": true, + "requires": { + "convert-source-map": "^1.7.0", + "istanbul-lib-instrument": "^4.0.1", + "loader-utils": "^1.4.0", + "merge-source-map": "^1.1.0", + "schema-utils": "^2.6.4" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "@ngtools/webpack": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.7.tgz", + "integrity": "sha512-A7VB2I42Kn+7jl0tDKzGNLAoZLWSqkKo9Hg1bmKpvAAIz+DSbq3uV+JWgGgTprM3tn0lfkVgmqk4H17HKwAOcg==", + "dev": true, + "requires": { + "@angular-devkit/core": "9.1.7", + "enhanced-resolve": "4.1.1", + "rxjs": "6.5.4", + "webpack-sources": "1.4.3" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@schematics/angular": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-9.1.7.tgz", + "integrity": "sha512-ld3WcoMWvup04V3OWioQ+AFGQBzz7IDM4Fxc5+Qc3wILWkDJnNkrc4EmJAow96Ab4/T1+Wl1vof3tV4At0BTzA==", + "dev": true, + "requires": { + "@angular-devkit/core": "9.1.7", + "@angular-devkit/schematics": "9.1.7" + } + }, + "@schematics/update": { + "version": "0.901.7", + "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.901.7.tgz", + "integrity": "sha512-6IpQVFvbu47CrXfqqHAzv2vi7AOdfi1S+SiayXU6FWTeA2wV47H8R60VjxurL8JkDGoVhFgC4+lK6KG++g3dQw==", + "dev": true, + "requires": { + "@angular-devkit/core": "9.1.7", + "@angular-devkit/schematics": "9.1.7", + "@yarnpkg/lockfile": "1.1.0", + "ini": "1.3.5", + "npm-package-arg": "^8.0.0", + "pacote": "9.5.12", + "rxjs": "6.5.4", + "semver": "7.1.3", + "semver-intersect": "1.4.0" + }, + "dependencies": { + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + } + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-VgNIkxK+j7Nz5P7jvUZlRvhuPSmsEfS03b0alKcq5V/STUKAa3Plemsn5mrQUO7am6OErJ4rhGEGJbACclrtRA==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/jasmine": { + "version": "3.5.10", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.10.tgz", + "integrity": "sha512-3F8qpwBAiVc5+HPJeXJpbrl+XjawGmciN5LgiO7Gv1pl1RHtjoMNqZpqEksaPJW05ViKe8snYInRs6xB25Xdew==", + "dev": true + }, + "@types/jasminewd2": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@types/jasminewd2/-/jasminewd2-2.0.8.tgz", + "integrity": "sha512-d9p31r7Nxk0ZH0U39PTH0hiDlJ+qNVGjlt1ucOoTUptxb2v+Y5VMnsxfwN+i3hK4yQnqBi3FMmoMFcd1JHDxdg==", + "dev": true, + "requires": { + "@types/jasmine": "*" + } + }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", + "dev": true + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.12.44", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.44.tgz", + "integrity": "sha512-jM6QVv0Sm5d3nW+nUD5jSzPcO6oPqboitSNcwgBay9hifVq/Rauq1PYnROnsmuw45JMBiTnsPAno0bKu2e2xrg==", + "dev": true + }, + "@types/q": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", + "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", + "dev": true + }, + "@types/selenium-webdriver": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", + "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", + "dev": true + }, + "@types/source-list-map": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", + "integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==", + "dev": true + }, + "@types/webpack-sources": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.8.tgz", + "integrity": "sha512-JHB2/xZlXOjzjBB6fMOpH1eQAfsrpqVVIbneE0Rok16WXwFaznaI5vfg75U5WgGJm7V9W1c4xeRQDjX/zwvghA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/source-list-map": "*", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@webassemblyjs/ast": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", + "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", + "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", + "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", + "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", + "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", + "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", + "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "mamacro": "^0.0.3" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", + "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", + "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", + "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", + "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", + "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", + "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/helper-wasm-section": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-opt": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", + "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", + "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", + "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", + "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/floating-point-hex-parser": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-code-frame": "1.8.5", + "@webassemblyjs/helper-fsm": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", + "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + }, + "adm-zip": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.14.tgz", + "integrity": "sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==", + "dev": true + }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "dev": true + }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", + "dev": true, + "requires": { + "humanize-ms": "^1.2.1" + } + }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true + }, + "ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "dev": true + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true + }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + } + }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "app-root-path": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.2.1.tgz", + "integrity": "sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA==", + "dev": true + }, + "append-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "aria-query": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", + "integrity": "sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=", + "dev": true, + "requires": { + "ast-types-flow": "0.0.7", + "commander": "^2.11.0" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arraybuffer.slice": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "ast-types-flow": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", + "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "autoprefixer": { + "version": "9.7.4", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.7.4.tgz", + "integrity": "sha512-g0Ya30YrMBAEZk60lp+qfX5YQllG+S5W3GYCFvyHTvhOki0AEQJLPEcIuGRsqVwLi8FvXPVtwTGhfr38hVpm0g==", + "dev": true, + "requires": { + "browserslist": "^4.8.3", + "caniuse-lite": "^1.0.30001020", + "chalk": "^2.4.2", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^7.0.26", + "postcss-value-parser": "^4.0.2" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", + "dev": true + }, + "axobject-query": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.0.2.tgz", + "integrity": "sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww==", + "dev": true, + "requires": { + "ast-types-flow": "0.0.7" + } + }, + "babel-loader": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", + "integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==", + "dev": true, + "requires": { + "find-cache-dir": "^2.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1", + "pify": "^4.0.1" + }, + "dependencies": { + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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" + } + } + } + }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "dev": true + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, + "base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "dev": true + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "dev": true, + "requires": { + "callsite": "1.0.0" + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "blob": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", + "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==", + "dev": true + }, + "blocking-proxy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/blocking-proxy/-/blocking-proxy-1.0.1.tgz", + "integrity": "sha512-KE8NFMZr3mN2E0HcvCgRtX7DjhiIQrwle+nSVJVC/yqFb9+xznHl2ZcoBp2L9qzkI4t4cBFJ1efXF8Dwi132RA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", + "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", + "dev": true + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "bootstrap": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz", + "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/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": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "browserify-sign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz", + "integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.2", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", + "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001043", + "electron-to-chromium": "^1.3.413", + "node-releases": "^1.1.53", + "pkg-up": "^2.0.0" + } + }, + "browserstack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/browserstack/-/browserstack-1.6.0.tgz", + "integrity": "sha512-HJDJ0TSlmkwnt9RZ+v5gFpa1XZTBYTj0ywvLwJ3241J7vMw2jAsGNVhKHtmCOyg+VxeLZyaibO9UL71AsUeDIw==", + "dev": true, + "requires": { + "https-proxy-agent": "^2.2.1" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true + }, + "cacache": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.0.tgz", + "integrity": "sha512-L0JpXHhplbJSiDGzyJJnJCTL7er7NzbBgxzVqLswEb4bO91Zbv17OUMuUeu/q0ZwKn3V+1HM4wb9tO4eVE/K8g==", + "dev": true, + "requires": { + "chownr": "^1.1.2", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "move-concurrently": "^1.0.1", + "p-map": "^3.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^2.7.1", + "ssri": "^8.0.0", + "tar": "^6.0.1", + "unique-filename": "^1.1.1" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/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" + } + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-api": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "caniuse-lite": { + "version": "1.0.30001078", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001078.tgz", + "integrity": "sha512-sF12qXe9VMm32IEf/+NDvmTpwJaaU7N1igpiH2FdI4DyABJSsOqG3ZAcFvszLkoLoo1y6VJLMYivukUAxaMASw==", + "dev": true + }, + "canonical-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/canonical-path/-/canonical-path-1.0.0.tgz", + "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "chokidar": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/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" + } + }, + "circular-dependency-plugin": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.0.tgz", + "integrity": "sha512-7p4Kn/gffhQaavNfyDFg7LS5S/UT1JAjyGd4UqR2+jzoYF02eDkj0Ec3+48TsIa4zghjLY87nQHIh/ecK9qLdw==", + "dev": true + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-spinners": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.3.0.tgz", + "integrity": "sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w==", + "dev": true + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "codelyzer": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/codelyzer/-/codelyzer-5.2.2.tgz", + "integrity": "sha512-jB4FZ1Sx7kZhvZVdf+N2BaKTdrrNZOL0Bj10RRfrhHrb3zEvXjJvvq298JPMJAiyiCS/v4zs1QlGU0ip7xGqeA==", + "dev": true, + "requires": { + "app-root-path": "^2.2.1", + "aria-query": "^3.0.0", + "axobject-query": "2.0.2", + "css-selector-tokenizer": "^0.7.1", + "cssauron": "^1.4.0", + "damerau-levenshtein": "^1.0.4", + "semver-dsl": "^1.0.1", + "source-map": "^0.5.7", + "sprintf-js": "^1.1.2" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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.1.2", + "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz", + "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==", + "dev": true, + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-string": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "dev": true + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dev": true, + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/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" + } + }, + "connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", + "dev": true + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-webpack-plugin": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-5.1.1.tgz", + "integrity": "sha512-P15M5ZC8dyCjQHWwd4Ia/dm0SgVvZJMYeykVIVYXbGyqO4dWB5oyPHp9i7wjwo5LhtlhKbiBCdS2NvM07Wlybg==", + "dev": true, + "requires": { + "cacache": "^12.0.3", + "find-cache-dir": "^2.1.0", + "glob-parent": "^3.1.0", + "globby": "^7.1.1", + "is-glob": "^4.0.1", + "loader-utils": "^1.2.3", + "minimatch": "^3.0.4", + "normalize-path": "^3.0.0", + "p-limit": "^2.2.1", + "schema-utils": "^1.0.0", + "serialize-javascript": "^2.1.2", + "webpack-log": "^2.0.0" + }, + "dependencies": { + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + } + } + }, + "core-js": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", + "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", + "dev": true + }, + "core-js-compat": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", + "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", + "dev": true, + "requires": { + "browserslist": "^4.8.5", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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": "6.0.5", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/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": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "dev": true + }, + "css-declaration-sorter": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz", + "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==", + "dev": true, + "requires": { + "postcss": "^7.0.1", + "timsort": "^0.3.0" + } + }, + "css-loader": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.5.1.tgz", + "integrity": "sha512-0G4CbcZzQ9D1Q6ndOfjFuMDo8uLYMu5vc9Abs5ztyHcKvmil6GJrMiNjzzi3tQvUF+mVRuDg7bE6Oc0Prolgig==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "cssesc": "^3.0.0", + "icss-utils": "^4.1.1", + "loader-utils": "^1.2.3", + "normalize-path": "^3.0.0", + "postcss": "^7.0.27", + "postcss-modules-extract-imports": "^2.0.0", + "postcss-modules-local-by-default": "^3.0.2", + "postcss-modules-scope": "^2.2.0", + "postcss-modules-values": "^3.0.0", + "postcss-value-parser": "^4.0.3", + "schema-utils": "^2.6.5", + "semver": "^6.3.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "css-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-2.0.0.tgz", + "integrity": "sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=", + "dev": true, + "requires": { + "css": "^2.0.0" + } + }, + "css-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", + "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^3.2.1", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, + "css-selector-tokenizer": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.2.tgz", + "integrity": "sha512-yj856NGuAymN6r8bn8/Jl46pR+OC3eEvAhfGYDUe7YPtTPAYrSSw4oAniZ9Y8T5B92hjhwTBLUen0/vKPxf6pw==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "fastparse": "^1.1.2", + "regexpu-core": "^4.6.0" + } + }, + "css-tree": { + "version": "1.0.0-alpha.37", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", + "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "dev": true, + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-what": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.3.0.tgz", + "integrity": "sha512-pv9JPyatiPaQ6pf4OvD/dbfm0o5LviWmwxNWzblYf/1u9QZd0ihV+PMwy5jdQWQ3349kZmKEx9WXuSka2dM4cg==", + "dev": true + }, + "cssauron": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz", + "integrity": "sha1-pmAt/34EqDBtwNuaVR6S6LVmKtg=", + "dev": true, + "requires": { + "through": "X.X.X" + } + }, + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true + }, + "cssnano": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", + "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.0", + "cssnano-preset-default": "^4.0.7", + "is-resolvable": "^1.0.0", + "postcss": "^7.0.0" + } + }, + "cssnano-preset-default": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", + "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", + "dev": true, + "requires": { + "css-declaration-sorter": "^4.0.1", + "cssnano-util-raw-cache": "^4.0.1", + "postcss": "^7.0.0", + "postcss-calc": "^7.0.1", + "postcss-colormin": "^4.0.3", + "postcss-convert-values": "^4.0.1", + "postcss-discard-comments": "^4.0.2", + "postcss-discard-duplicates": "^4.0.2", + "postcss-discard-empty": "^4.0.1", + "postcss-discard-overridden": "^4.0.1", + "postcss-merge-longhand": "^4.0.11", + "postcss-merge-rules": "^4.0.3", + "postcss-minify-font-values": "^4.0.2", + "postcss-minify-gradients": "^4.0.2", + "postcss-minify-params": "^4.0.2", + "postcss-minify-selectors": "^4.0.2", + "postcss-normalize-charset": "^4.0.1", + "postcss-normalize-display-values": "^4.0.2", + "postcss-normalize-positions": "^4.0.2", + "postcss-normalize-repeat-style": "^4.0.2", + "postcss-normalize-string": "^4.0.2", + "postcss-normalize-timing-functions": "^4.0.2", + "postcss-normalize-unicode": "^4.0.1", + "postcss-normalize-url": "^4.0.1", + "postcss-normalize-whitespace": "^4.0.2", + "postcss-ordered-values": "^4.1.2", + "postcss-reduce-initial": "^4.0.3", + "postcss-reduce-transforms": "^4.0.2", + "postcss-svgo": "^4.0.2", + "postcss-unique-selectors": "^4.0.1" + } + }, + "cssnano-util-get-arguments": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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.1", + "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz", + "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, + "cssnano-util-same-parent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz", + "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==", + "dev": true + }, + "csso": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.0.3.tgz", + "integrity": "sha512-NL3spysxUkcrOgnpsT4Xdl2aiEiBG6bXswAABQVHcMrfjjBisFOKwLDOmf4wf32aPdcJws1zds2B0Rg+jqMyHQ==", + "dev": true, + "requires": { + "css-tree": "1.0.0-alpha.39" + }, + "dependencies": { + "css-tree": { + "version": "1.0.0-alpha.39", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.39.tgz", + "integrity": "sha512-7UvkEYgBAHRG9Nt980lYxjsTrCyHFN53ky3wVsDkiMdVqylqRt+Zc+jm5qw7/qyOvN2dHSYtX0e4MbCCExSvnA==", + "dev": true, + "requires": { + "mdn-data": "2.0.6", + "source-map": "^0.6.1" + } + }, + "mdn-data": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.6.tgz", + "integrity": "sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "custom-event": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", + "dev": true + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "damerau-levenshtein": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz", + "integrity": "sha512-JVrozIeElnj3QzfUIt8tB8YMluBJom4Vw9qTPpjGYQ9fYlB3D/rb6OordUxf3xeFB35LKWs0xqcO5U6ySvBtug==", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-format": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", + "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, + "default-gateway": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", + "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "ip-regex": "^2.1.0" + } + }, + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + } + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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" + } + } + } + }, + "del": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + }, + "dependencies": { + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "dependency-graph": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.7.2.tgz", + "integrity": "sha512-KqtH4/EZdtdfWX0p6MGP9jljvxSY6msy/pRUD4jgNwVpv3v1QmNLlsB3LDSSUg79BRVSn7jI1QPRtArGABovAQ==", + "dev": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-node": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", + "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", + "dev": true + }, + "dezalgo": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", + "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", + "dev": true, + "requires": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "di": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", + "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + } + }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", + "dev": true + }, + "dns-packet": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "dev": true, + "requires": { + "buffer-indexof": "^1.0.0" + } + }, + "dom-serialize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", + "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", + "dev": true, + "requires": { + "custom-event": "~1.0.0", + "ent": "~2.2.0", + "extend": "^3.0.0", + "void-elements": "^2.0.0" + } + }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", + "dev": true + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "dot-prop": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", + "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.463", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.463.tgz", + "integrity": "sha512-mAqvpG0efJXV9BGXPVjFdBFiqmawGoIc+c8T2uXYEvbV1/261PaOT0EzZ9dKW4IdGiHXQGSKnnOU86QhJ+5JcA==", + "dev": true + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "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" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "engine.io": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.2.tgz", + "integrity": "sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg==", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "0.3.1", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "ws": "^7.1.2" + }, + "dependencies": { + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "ws": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", + "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", + "dev": true + } + } + }, + "engine.io-client": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.3.tgz", + "integrity": "sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw==", + "dev": true, + "requires": { + "component-emitter": "~1.3.0", + "component-inherit": "0.0.3", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~6.1.0", + "xmlhttprequest-ssl": "~1.5.4", + "yeast": "0.1.2" + }, + "dependencies": { + "ws": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "engine.io-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", + "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", + "dev": true, + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "~0.0.7", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.5", + "has-binary2": "~1.0.2" + } + }, + "enhanced-resolve": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", + "integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", + "dev": true + }, + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", + "dev": true + }, + "err-code": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", + "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=", + "dev": true + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eventemitter3": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", + "dev": true + }, + "events": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", + "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", + "dev": true + }, + "eventsource": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", + "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", + "dev": true, + "requires": { + "original": "^1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/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" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.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://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "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.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fastparse": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", + "dev": true + }, + "faye-websocket": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-loader": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz", + "integrity": "sha512-/aMOAYEFXDdjG0wytpTL5YQLfZnnTmLNjn+AIrJ/6HVnTfDqLsVKUUwkDf4I4kgex36BvjuXEn/TX9B/1ESyqQ==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^2.6.5" + } + }, + "fileset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "^7.0.3", + "minimatch": "^3.0.3" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "follow-redirects": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.11.0.tgz", + "integrity": "sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA==", + "dev": true, + "requires": { + "debug": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/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": "4.0.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", + "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "genfun": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", + "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "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://registry.npmjs.org/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://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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.3", + "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", + "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", + "dev": true, + "requires": { + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + } + } + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hex-color-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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" + } + }, + "hosted-git-info": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.4.tgz", + "integrity": "sha512-4oT62d2jwSDBbLLFLZE+1vPuQ1h8p9wjrJ8Mqx5TjsyWmBMV5B13eJqn8pvluqubLf3cJPTfiYCIwNwDNmzScQ==", + "dev": true, + "requires": { + "lru-cache": "^5.1.1" + } + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz", + "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=", + "dev": true + }, + "hsla-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz", + "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=", + "dev": true + }, + "html-comment-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", + "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", + "dev": true + }, + "html-entities": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.1.tgz", + "integrity": "sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4", + "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "dev": true, + "requires": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "icss-utils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz", + "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", + "dev": true, + "requires": { + "postcss": "^7.0.14" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "ignore-walk": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", + "dev": true, + "optional": true + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", + "dev": true + }, + "import-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", + "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=", + "dev": true, + "requires": { + "import-from": "^2.1.0" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "import-from": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", + "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "internal-ip": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", + "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", + "dev": true, + "requires": { + "default-gateway": "^4.2.0", + "ipaddr.js": "^1.9.0" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "dev": true + }, + "is-color-stop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-docker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", + "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true + }, + "is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "dev": true, + "requires": { + "is-path-inside": "^2.1.0" + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-svg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", + "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", + "dev": true, + "requires": { + "html-comment-regex": "^1.1.0" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isbinaryfile": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.6.tgz", + "integrity": "sha512-ORrEy+SNVqUhrCaal4hA4fBzhggQQ+BaLntyPOdoEiwlKZW9BZiJXjg3RMiruE4tPEI3pyVPpySHQF/dKWperg==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-api": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.7.tgz", + "integrity": "sha512-LYTOa2UrYFyJ/aSczZi/6lBykVMjCCvUmT64gOe+jPZFy4w6FYfPGqFT2IiQ2BxVHHDOvCD7qrIXb0EOh4uGWw==", + "dev": true, + "requires": { + "async": "^2.6.2", + "compare-versions": "^3.4.0", + "fileset": "^2.0.3", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-hook": "^2.0.7", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.5", + "js-yaml": "^3.13.1", + "make-dir": "^2.1.0", + "minimatch": "^3.0.4", + "once": "^1.4.0" + }, + "dependencies": { + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", + "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.7.tgz", + "integrity": "sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0" + } + }, + "jasmine": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", + "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", + "dev": true, + "requires": { + "exit": "^0.1.2", + "glob": "^7.0.6", + "jasmine-core": "~2.8.0" + }, + "dependencies": { + "jasmine-core": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=", + "dev": true + } + } + }, + "jasmine-core": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", + "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", + "dev": true + }, + "jasmine-spec-reporter": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", + "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", + "dev": true, + "requires": { + "colors": "1.1.2" + } + }, + "jasminewd2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz", + "integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=", + "dev": true + }, + "jest-worker": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.1.0.tgz", + "integrity": "sha512-ZHhHtlxOWSxCoNOKHGbiLzXnl42ga9CxDr27H36Qn+15pQZd3R/F24jrmjDelw9j/iHUIWMWs08/u2QN50HHOg==", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz", + "integrity": "sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/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" + } + }, + "jszip": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.4.0.tgz", + "integrity": "sha512-gZAOYuPl4EhPTXT0GjhI3o+ZAz3su6EhLrKUoAivcKqyqC7laS5JEv4XWZND9BgcDcF83vI85yGbDmDR6UhrIg==", + "dev": true, + "requires": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" + } + }, + "karma": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/karma/-/karma-5.0.9.tgz", + "integrity": "sha512-dUA5z7Lo7G4FRSe1ZAXqOINEEWxmCjDBbfRBmU/wYlSMwxUQJP/tEEP90yJt3Uqo03s9rCgVnxtlfq+uDhxSPg==", + "dev": true, + "requires": { + "body-parser": "^1.19.0", + "braces": "^3.0.2", + "chokidar": "^3.0.0", + "colors": "^1.4.0", + "connect": "^3.7.0", + "di": "^0.0.1", + "dom-serialize": "^2.2.1", + "flatted": "^2.0.2", + "glob": "^7.1.6", + "graceful-fs": "^4.2.4", + "http-proxy": "^1.18.1", + "isbinaryfile": "^4.0.6", + "lodash": "^4.17.15", + "log4js": "^6.2.1", + "mime": "^2.4.5", + "minimatch": "^3.0.4", + "qjobs": "^1.2.0", + "range-parser": "^1.2.1", + "rimraf": "^3.0.2", + "socket.io": "^2.3.0", + "source-map": "^0.6.1", + "tmp": "0.2.1", + "ua-parser-js": "0.7.21", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "mime": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "requires": { + "rimraf": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "karma-chrome-launcher": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", + "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", + "dev": true, + "requires": { + "which": "^1.2.1" + } + }, + "karma-coverage-istanbul-reporter": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-2.1.1.tgz", + "integrity": "sha512-CH8lTi8+kKXGvrhy94+EkEMldLCiUA0xMOiL31vvli9qK0T+qcXJAwWBRVJWnVWxYkTmyWar8lPz63dxX6/z1A==", + "dev": true, + "requires": { + "istanbul-api": "^2.1.6", + "minimatch": "^3.0.4" + } + }, + "karma-jasmine": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-3.0.3.tgz", + "integrity": "sha512-80iBR8/hLFY2Uw3S2GG6EndWtMCGMJjrCYNwYROWsJFVTjWrRSsLqcA2ye+U3ygW5sjOQo8f+78L8cGUxjC/+A==", + "dev": true, + "requires": { + "jasmine-core": "^3.5.0" + } + }, + "karma-jasmine-html-reporter": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-1.5.4.tgz", + "integrity": "sha512-PtilRLno5O6wH3lDihRnz0Ba8oSn0YUJqKjjux1peoYGwo0AQqrWRbdWk/RLzcGlb+onTyXAnHl6M+Hu3UxG/Q==", + "dev": true + }, + "karma-source-map-support": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz", + "integrity": "sha512-RsBECncGO17KAoJCYXjv+ckIz+Ii9NCi+9enk+rq6XC81ezYkb4/RHE6CTXdA7IOJqoF3wcaLfVG0CPmE5ca6A==", + "dev": true, + "requires": { + "source-map-support": "^0.5.5" + } + }, + "killable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "less": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/less/-/less-3.11.1.tgz", + "integrity": "sha512-tlWX341RECuTOvoDIvtFqXsKj072hm3+9ymRBe76/mD6O5ZZecnlAOVDlWAleF2+aohFrxNidXhv2773f6kY7g==", + "dev": true, + "requires": { + "clone": "^2.1.2", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "mime": "^1.4.1", + "mkdirp": "^0.5.0", + "promise": "^7.1.1", + "request": "^2.83.0", + "source-map": "~0.6.0", + "tslib": "^1.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "less-loader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-5.0.0.tgz", + "integrity": "sha512-bquCU89mO/yWLaUq0Clk7qCsKhsF/TZpJUzETRvJa9KSVEL9SO3ovCvdEHISBhrC81OwC8QSVX7E0bzElZj9cg==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "loader-utils": "^1.1.0", + "pify": "^4.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levenary": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", + "dev": true, + "requires": { + "leven": "^3.1.0" + } + }, + "license-webpack-plugin": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-2.1.4.tgz", + "integrity": "sha512-1Xq72fmPbTg5KofXs+yI5L4QqPFjQ6mZxoeI6D7gfiEDOtaEIk6PGrdLaej90bpDqKNHNxlQ/MW4tMAL6xMPJQ==", + "dev": true, + "requires": { + "@types/webpack-sources": "^0.1.5", + "webpack-sources": "^1.2.0" + } + }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "requires": { + "immediate": "~3.0.5" + } + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/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.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, + "log4js": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.3.0.tgz", + "integrity": "sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==", + "dev": true, + "requires": { + "date-format": "^3.0.0", + "debug": "^4.1.1", + "flatted": "^2.0.1", + "rfdc": "^1.1.4", + "streamroller": "^2.2.4" + } + }, + "loglevel": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", + "integrity": "sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + }, + "dependencies": { + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-fetch-happen": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", + "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", + "dev": true, + "requires": { + "agentkeepalive": "^3.4.1", + "cacache": "^12.0.0", + "http-cache-semantics": "^3.8.1", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "node-fetch-npm": "^2.0.2", + "promise-retry": "^1.1.1", + "socks-proxy-agent": "^4.0.0", + "ssri": "^6.0.0" + }, + "dependencies": { + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + } + } + }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", + "dev": true + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "dev": true + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/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": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/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" + } + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "mini-css-extract-plugin": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz", + "integrity": "sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "normalize-url": "1.9.1", + "schema-utils": "^1.0.0", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/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" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minipass": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", + "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.3.tgz", + "integrity": "sha512-cFOknTvng5vqnwOpDsZTWhNll6Jf8o2x+/diplafmxpuIymAjzoOolZG0VvQf3V2HgqzJNhnuKHYp2BqDgz8IQ==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz", + "integrity": "sha512-EzTZN/fjSvifSX0SlqUERCN39o6T40AMarPbv0MrarSFtIITCBh7bi+dU8nxGFHuqs9jdIAeoYoKuQAAASsPPA==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/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.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "multicast-dns": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/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" + } + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-fetch-npm": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz", + "integrity": "sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "json-parse-better-errors": "^1.0.0", + "safe-buffer": "^5.1.1" + } + }, + "node-forge": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", + "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==", + "dev": true + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "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": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "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.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "node-releases": { + "version": "1.1.58", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz", + "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, + "normalize-url": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "dev": true + }, + "npm-bundled": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-install-checks": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", + "integrity": "sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w==", + "dev": true, + "requires": { + "semver": "^7.1.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "npm-package-arg": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.0.1.tgz", + "integrity": "sha512-/h5Fm6a/exByzFSTm7jAyHbgOqErl9qSNJDQF32Si/ZzgwT2TERVxRxn3Jurw1wflgyVVAxnFR4fRHPM7y1ClQ==", + "dev": true, + "requires": { + "hosted-git-info": "^3.0.2", + "semver": "^7.0.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "npm-packlist": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "dev": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-pick-manifest": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.0.0.tgz", + "integrity": "sha512-PdJpXMvjqt4nftNEDpCgjBUF8yI3Q3MyuAmVB9nemnnCg32F4BPL/JFBfdj8DubgHCYUFQhtLWmBPvdsFtjWMg==", + "dev": true, + "requires": { + "npm-install-checks": "^4.0.0", + "npm-package-arg": "^8.0.0", + "semver": "^7.0.0" + } + }, + "npm-registry-fetch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.4.tgz", + "integrity": "sha512-6jb34hX/iYNQebqWUHtU8YF6Cjb1H6ouTFPClYsyiW6lpFkljTpdeftm53rRojtja1rKAvKNIIiTS5Sjpw4wsA==", + "dev": true, + "requires": { + "JSONStream": "^1.3.4", + "bluebird": "^3.5.1", + "figgy-pudding": "^3.4.1", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "npm-package-arg": "^6.1.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-is": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", + "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "open": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/open/-/open-7.0.3.tgz", + "integrity": "sha512-sP2ru2v0P290WFfv49Ap8MF6PkzGNnGlAwHweB4WR4mr5d2d0woiCluUeJ218w7/+PmoBy9JmYgD5A4mLcWOFA==", + "dev": true, + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + }, + "dependencies": { + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + } + } + }, + "ora": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.3.tgz", + "integrity": "sha512-fnDebVFyz309A73cqCipVL1fBZewq4vwgSHfxh43vVy31mbyoQ8sCH3Oeaog/owYOs/lLlGVPCISQonTneg6Pg==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.2.0", + "is-interactive": "^1.0.0", + "log-symbols": "^3.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "original": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", + "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", + "dev": true, + "requires": { + "url-parse": "^1.4.3" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-retry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz", + "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", + "dev": true, + "requires": { + "retry": "^0.12.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pacote": { + "version": "9.5.12", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.12.tgz", + "integrity": "sha512-BUIj/4kKbwWg4RtnBncXPJd15piFSVNpTzY0rysSr3VnMowTYgkGKcaHrbReepAkjTr8lH2CVWRi58Spg2CicQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.3", + "cacache": "^12.0.2", + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.1.0", + "glob": "^7.1.3", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "minimatch": "^3.0.4", + "minipass": "^2.3.5", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "normalize-package-data": "^2.4.0", + "npm-normalize-package-bin": "^1.0.0", + "npm-package-arg": "^6.1.0", + "npm-packlist": "^1.1.12", + "npm-pick-manifest": "^3.0.0", + "npm-registry-fetch": "^4.0.0", + "osenv": "^0.1.5", + "promise-inflight": "^1.0.1", + "promise-retry": "^1.1.1", + "protoduck": "^5.0.1", + "rimraf": "^2.6.2", + "safe-buffer": "^5.1.2", + "semver": "^5.6.0", + "ssri": "^6.0.1", + "tar": "^4.4.10", + "unique-filename": "^1.1.1", + "which": "^1.3.1" + }, + "dependencies": { + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "npm-pick-manifest": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", + "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.0.0", + "semver": "^5.4.1" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "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", + "safe-buffer": "^5.1.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "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://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + } + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "portfinder": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.26.tgz", + "integrity": "sha512-Xi7mKxJHHMI3rIUrnm/jjUgwhbYMkp/XKEcZX3aG4BrumLpq3nmoQMX+ClYnDZnZ/New7IatC1no5RX0zo1vXQ==", + "dev": true, + "requires": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "postcss": { + "version": "7.0.27", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.27.tgz", + "integrity": "sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-calc": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.2.tgz", + "integrity": "sha512-rofZFHUg6ZIrvRwPeFktv06GdbDYLcGqh9EwiMutZg+a0oePCCw1zHOEiji6LCpyRcjTREtPASuUqeAvYlEVvQ==", + "dev": true, + "requires": { + "postcss": "^7.0.27", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.0.2" + } + }, + "postcss-colormin": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz", + "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "color": "^3.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-convert-values": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz", + "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-discard-comments": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", + "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-discard-duplicates": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz", + "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-discard-empty": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz", + "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-discard-overridden": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz", + "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-import": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-12.0.1.tgz", + "integrity": "sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw==", + "dev": true, + "requires": { + "postcss": "^7.0.1", + "postcss-value-parser": "^3.2.3", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-load-config": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz", + "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.0", + "import-cwd": "^2.0.0" + } + }, + "postcss-loader": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-3.0.0.tgz", + "integrity": "sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "postcss": "^7.0.0", + "postcss-load-config": "^2.0.0", + "schema-utils": "^1.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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" + } + } + } + }, + "postcss-merge-longhand": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", + "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", + "dev": true, + "requires": { + "css-color-names": "0.0.4", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "stylehacks": "^4.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-merge-rules": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", + "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "cssnano-util-same-parent": "^4.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0", + "vendors": "^1.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-minify-font-values": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz", + "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-minify-gradients": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", + "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "is-color-stop": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-minify-params": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", + "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "browserslist": "^4.0.0", + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "uniqs": "^2.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-minify-selectors": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", + "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-modules-extract-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", + "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", + "dev": true, + "requires": { + "postcss": "^7.0.5" + } + }, + "postcss-modules-local-by-default": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz", + "integrity": "sha512-jM/V8eqM4oJ/22j0gx4jrp63GSvDH6v86OqyTHHUvk4/k1vceipZsaymiZ5PvocqZOl5SFHiFJqjs3la0wnfIQ==", + "dev": true, + "requires": { + "icss-utils": "^4.1.1", + "postcss": "^7.0.16", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.0.0" + } + }, + "postcss-modules-scope": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz", + "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==", + "dev": true, + "requires": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^6.0.0" + } + }, + "postcss-modules-values": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", + "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "dev": true, + "requires": { + "icss-utils": "^4.0.0", + "postcss": "^7.0.6" + } + }, + "postcss-normalize-charset": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz", + "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-normalize-display-values": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", + "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-positions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", + "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-repeat-style": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", + "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-string": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", + "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", + "dev": true, + "requires": { + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-timing-functions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", + "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-unicode": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz", + "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz", + "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==", + "dev": true, + "requires": { + "is-absolute-url": "^2.0.0", + "normalize-url": "^3.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-normalize-whitespace": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", + "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-ordered-values": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", + "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-reduce-initial": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", + "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0" + } + }, + "postcss-reduce-transforms": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", + "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-selector-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz", + "integrity": "sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "postcss-svgo": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", + "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", + "dev": true, + "requires": { + "is-svg": "^3.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "svgo": "^1.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + } + } + }, + "postcss-unique-selectors": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz", + "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "postcss": "^7.0.0", + "uniqs": "^2.0.0" + } + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "optional": true, + "requires": { + "asap": "~2.0.3" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "promise-retry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", + "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", + "dev": true, + "requires": { + "err-code": "^1.0.0", + "retry": "^0.10.0" + }, + "dependencies": { + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "dev": true + } + } + }, + "protoduck": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", + "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", + "dev": true, + "requires": { + "genfun": "^5.0.0" + } + }, + "protractor": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/protractor/-/protractor-5.4.4.tgz", + "integrity": "sha512-BaL4vePgu3Vfa/whvTUAlgaCAId4uNSGxIFSCXMgj7LMYENPWLp85h5RBi9pdpX/bWQ8SF6flP7afmi2TC4eHw==", + "dev": true, + "requires": { + "@types/q": "^0.0.32", + "@types/selenium-webdriver": "^3.0.0", + "blocking-proxy": "^1.0.0", + "browserstack": "^1.5.1", + "chalk": "^1.1.3", + "glob": "^7.0.3", + "jasmine": "2.8.0", + "jasminewd2": "^2.1.0", + "q": "1.4.1", + "saucelabs": "^1.5.0", + "selenium-webdriver": "3.6.0", + "source-map-support": "~0.4.0", + "webdriver-js-extender": "2.1.0", + "webdriver-manager": "^12.0.6", + "yargs": "^12.0.5" + }, + "dependencies": { + "@types/q": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", + "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/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" + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "webdriver-manager": { + "version": "12.1.7", + "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.7.tgz", + "integrity": "sha512-XINj6b8CYuUYC93SG3xPkxlyUc3IJbD6Vvo75CVGuG9uzsefDzWQrhz0Lq8vbPxtb4d63CZdYophF8k8Or/YiA==", + "dev": true, + "requires": { + "adm-zip": "^0.4.9", + "chalk": "^1.1.1", + "del": "^2.2.0", + "glob": "^7.0.3", + "ini": "^1.3.4", + "minimist": "^1.2.0", + "q": "^1.4.1", + "request": "^2.87.0", + "rimraf": "^2.5.2", + "semver": "^5.3.0", + "xml2js": "^0.4.17" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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" + } + } + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.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 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dev": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "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", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qjobs": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "querystringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/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.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + } + } + }, + "raw-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.0.tgz", + "integrity": "sha512-iINUOYvl1cGEmfoaLjnZXt4bKfT2LJnZZib5N/LLyAphC+Dd11vNP9CNVb38j+SAJpFI1uo8j9frmih53ASy7Q==", + "dev": true, + "requires": { + "loader-utils": "^1.2.3", + "schema-utils": "^2.5.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=", + "dev": true, + "requires": { + "pify": "^2.3.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "read-package-json": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.1.tgz", + "integrity": "sha512-dAiqGtVc/q5doFz6096CcnXhpYk0ZN8dEKVkGLU0CsASt8SrgF6SF7OTKAYubfvFhWaqofl+Y8HK19GR8jwW+A==", + "dev": true, + "requires": { + "glob": "^7.1.1", + "graceful-fs": "^4.1.2", + "json-parse-better-errors": "^1.0.1", + "normalize-package-data": "^2.0.0", + "npm-normalize-package-bin": "^1.0.0" + } + }, + "read-package-tree": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", + "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", + "dev": true, + "requires": { + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0", + "util-promisify": "^2.1.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "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" + } + }, + "readdir-scoped-modules": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", + "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "dev": true, + "requires": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" + } + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, + "regenerate": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", + "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.4.tgz", + "integrity": "sha512-EaJaKPBI9GvKpvUz2mz4fhx7WPgvwRLY9v3hlNHWmAuJHI13T4nwKnNvm5RWJzEdnI5g5UwtOww+S8IdoUC2bw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4", + "private": "^0.1.8" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "regexpu-core": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", + "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "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.3", + "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.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, + "rfdc": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.1.4.tgz", + "integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug==", + "dev": true + }, + "rgb-regex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", + "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=", + "dev": true + }, + "rgba-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", + "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rollup": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.1.0.tgz", + "integrity": "sha512-gfE1455AEazVVTJoeQtcOq/U6GSxwoj4XPSWVsuWmgIxj7sBQNLDOSA82PbdMe+cP8ql8fR1jogPFe8Wg8g4SQ==", + "dev": true, + "requires": { + "fsevents": "~2.1.2" + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sass": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.3.tgz", + "integrity": "sha512-5NMHI1+YFYw4sN3yfKjpLuV9B5l7MqQ6FlkTcC4FT+oHbBRUZoSjHrrt/mE0nFXJyY2kQtU9ou9HxvFVjLFuuw==", + "dev": true, + "requires": { + "chokidar": ">=2.0.0 <4.0.0" + } + }, + "sass-loader": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-8.0.2.tgz", + "integrity": "sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "loader-utils": "^1.2.3", + "neo-async": "^2.6.1", + "schema-utils": "^2.6.1", + "semver": "^6.3.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "saucelabs": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-1.5.0.tgz", + "integrity": "sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==", + "dev": true, + "requires": { + "https-proxy-agent": "^2.2.1" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + }, + "dependencies": { + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } + } + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", + "dev": true + }, + "selenium-webdriver": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz", + "integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==", + "dev": true, + "requires": { + "jszip": "^3.1.3", + "rimraf": "^2.5.4", + "tmp": "0.0.30", + "xml2js": "^0.4.17" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "tmp": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz", + "integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, + "selfsigned": { + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", + "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "dev": true, + "requires": { + "node-forge": "0.9.0" + } + }, + "semver": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", + "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==", + "dev": true + }, + "semver-dsl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/semver-dsl/-/semver-dsl-1.0.1.tgz", + "integrity": "sha1-02eN5VVeimH2Ke7QJTZq5fJzQKA=", + "dev": true, + "requires": { + "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver-intersect": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/semver-intersect/-/semver-intersect-1.4.0.tgz", + "integrity": "sha512-d8fvGg5ycKAq0+I6nfWeCx6ffaWJCsBYU0H2Rq56+/zFePYfT8mXkB3tWBSjR5BerkHNZ5eTPIk1/LBYas35xQ==", + "dev": true, + "requires": { + "semver": "^5.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "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.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "serialize-javascript": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", + "dev": true + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/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" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/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" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "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://registry.npmjs.org/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://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/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": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + } + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "smart-buffer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "socket.io": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", + "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", + "dev": true, + "requires": { + "debug": "~4.1.0", + "engine.io": "~3.4.0", + "has-binary2": "~1.0.2", + "socket.io-adapter": "~1.1.0", + "socket.io-client": "2.3.0", + "socket.io-parser": "~3.4.0" + } + }, + "socket.io-adapter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", + "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", + "dev": true + }, + "socket.io-client": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", + "dev": true, + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "engine.io-client": "~3.4.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.3.0", + "to-array": "0.1.4" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "socket.io-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", + "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "isarray": "2.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + } + } + }, + "socket.io-parser": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", + "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "isarray": "2.0.1" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + } + } + }, + "sockjs": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.20.tgz", + "integrity": "sha512-SpmVOVpdq0DJc0qArhF3E5xsxvaiqGNb73XfgBpK1y3UD5gs8DSo8aCTsuT5pX8rssdc2NDIzANwP9eCAiSdTA==", + "dev": true, + "requires": { + "faye-websocket": "^0.10.0", + "uuid": "^3.4.0", + "websocket-driver": "0.6.5" + } + }, + "sockjs-client": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.4.0.tgz", + "integrity": "sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==", + "dev": true, + "requires": { + "debug": "^3.2.5", + "eventsource": "^1.0.7", + "faye-websocket": "~0.11.1", + "inherits": "^2.0.3", + "json3": "^3.3.2", + "url-parse": "^1.4.3" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "faye-websocket": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", + "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + } + } + }, + "socks": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", + "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", + "dev": true, + "requires": { + "ip": "1.1.5", + "smart-buffer": "^4.1.0" + } + }, + "socks-proxy-agent": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", + "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", + "dev": true, + "requires": { + "agent-base": "~4.2.1", + "socks": "~2.3.2" + }, + "dependencies": { + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + } + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/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.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + }, + "source-map-loader": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-0.2.4.tgz", + "integrity": "sha512-OU6UJUty+i2JDpTItnizPrlpOIBLmQbWMuBg9q5bVtnHACqw1tn9nNwqJLbv0/00JjnJb/Ee5g5WS5vrRv7zIQ==", + "dev": true, + "requires": { + "async": "^2.5.0", + "loader-utils": "^1.1.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "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.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + } + }, + "spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "speed-measure-webpack-plugin": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.1.tgz", + "integrity": "sha512-qVIkJvbtS9j/UeZumbdfz0vg+QfG/zxonAjzefZrqzkr7xOncLVXkeGbTpzd1gjCBM4PmVNkWlkeTVhgskAGSQ==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/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.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "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": "8.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", + "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/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.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "streamroller": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.4.tgz", + "integrity": "sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==", + "dev": true, + "requires": { + "date-format": "^2.1.0", + "debug": "^4.1.1", + "fs-extra": "^8.1.0" + }, + "dependencies": { + "date-format": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", + "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } + } + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/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": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "style-loader": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.1.3.tgz", + "integrity": "sha512-rlkH7X/22yuwFYK357fMN/BxYOorfnfq0eD7+vqlemSK4wEcejFF1dg4zxP0euBW8NrYx2WZzZ8PPFevr7D+Kw==", + "dev": true, + "requires": { + "loader-utils": "^1.2.3", + "schema-utils": "^2.6.4" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "stylehacks": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", + "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "stylus": { + "version": "0.54.7", + "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.7.tgz", + "integrity": "sha512-Yw3WMTzVwevT6ZTrLCYNHAFmanMxdylelL3hkWNgPMeTCpMwpV3nXjpOHuBXtFv7aiO2xRuQS6OoAdgkNcSNug==", + "dev": true, + "requires": { + "css-parse": "~2.0.0", + "debug": "~3.1.0", + "glob": "^7.1.3", + "mkdirp": "~0.5.x", + "safer-buffer": "^2.1.2", + "sax": "~1.2.4", + "semver": "^6.0.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "stylus-loader": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/stylus-loader/-/stylus-loader-3.0.2.tgz", + "integrity": "sha512-+VomPdZ6a0razP+zinir61yZgpw2NfljeSsdUF5kJuEzlo3khXhY19Fn6l8QQz1GRJGtMCo8nG5C04ePyV7SUA==", + "dev": true, + "requires": { + "loader-utils": "^1.0.2", + "lodash.clonedeep": "^4.5.0", + "when": "~3.6.x" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "svgo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", + "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.37", + "csso": "^4.0.2", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + } + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "dev": true + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + }, + "tar": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", + "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.0", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, + "terser": { + "version": "4.6.10", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.10.tgz", + "integrity": "sha512-qbF/3UOo11Hggsbsqm2hPa6+L4w7bkr+09FNseEe8xrcVD3APGLFqE+Oz1ZKAxjYnFsj80rLOfgAtJ0LNJjtTA==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.5.tgz", + "integrity": "sha512-WlWksUoq+E4+JlJ+h+U+QUzXpcsMSSNXkDy9lBVkSqDn1w23Gg29L/ary9GeJVYCGiNJJX7LnVc4bwL1N3/g1w==", + "dev": true, + "requires": { + "cacache": "^13.0.1", + "find-cache-dir": "^3.2.0", + "jest-worker": "^25.1.0", + "p-limit": "^2.2.2", + "schema-utils": "^2.6.4", + "serialize-javascript": "^2.1.2", + "source-map": "^0.6.1", + "terser": "^4.4.3", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "cacache": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz", + "integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==", + "dev": true, + "requires": { + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "minipass": "^3.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "p-map": "^3.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^2.7.1", + "ssri": "^7.0.0", + "unique-filename": "^1.1.1" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "ssri": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.0.tgz", + "integrity": "sha512-77/WrDZUWocK0mvA5NTRQyveUf+wsrIc6vyrxpS8tVvYBcX215QbafrJR3KtkpskIzoFLqqNuuYQvxaMjXJ/0g==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "minipass": "^3.1.1" + } + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "dev": true + }, + "timers-browserify": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", + "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, + "ts-node": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", + "integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.6", + "yn": "^3.0.0" + } + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + }, + "tslint": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.2.tgz", + "integrity": "sha512-UyNrLdK3E0fQG/xWNqAFAC5ugtFyPO4JJR1KyyfQAyzR8W0fTRrC91A8Wej4BntFzcvETdCSDa/4PnNYJQLYiA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.3", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.10.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.21", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz", + "integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "dev": true + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universal-analytics": { + "version": "0.4.20", + "resolved": "https://registry.npmjs.org/universal-analytics/-/universal-analytics-0.4.20.tgz", + "integrity": "sha512-gE91dtMvNkjO+kWsPstHRtSwHXz0l2axqptGYp5ceg4MsuurloM0PU3pdOfpb5zBXUvyjT4PwhWK2m39uczZuw==", + "dev": true, + "requires": { + "debug": "^3.0.0", + "request": "^2.88.0", + "uuid": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-parse": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util-promisify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", + "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "vendors": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz", + "integrity": "sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", + "dev": true + }, + "watchpack": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.2.tgz", + "integrity": "sha512-ymVbbQP40MFTp+cNMvpyBpBtygHnPzPkHqoIwRRj/0B8KhqQwV8LaKjtbaxF2lK4vl8zN9wCxS46IFCU5K4W0g==", + "dev": true, + "requires": { + "chokidar": "^3.4.0", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.0" + } + }, + "watchpack-chokidar2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", + "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", + "dev": true, + "optional": true, + "requires": { + "chokidar": "^2.1.8" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": 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" + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "webdriver-js-extender": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", + "integrity": "sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ==", + "dev": true, + "requires": { + "@types/selenium-webdriver": "^3.0.0", + "selenium-webdriver": "^3.0.1" + } + }, + "webpack": { + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.42.0.tgz", + "integrity": "sha512-EzJRHvwQyBiYrYqhyjW9AqM90dE4+s1/XtCfn7uWg6cS72zH+2VPFAlsnW0+W0cDi0XRjNKUMoJtpSi50+Ph6w==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/wasm-edit": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.2.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.1", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.6.0", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/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" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "serialize-javascript": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", + "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "terser-webpack-plugin": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz", + "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^3.1.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + } + } + } + }, + "webpack-dev-middleware": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz", + "integrity": "sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw==", + "dev": true, + "requires": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + }, + "dependencies": { + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/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" + } + }, + "mime": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", + "dev": true + } + } + }, + "webpack-dev-server": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz", + "integrity": "sha512-PUxZ+oSTxogFQgkTtFndEtJIPNmml7ExwufBZ9L2/Xyyd5PnOL5UreWe5ZT7IU25DSdykL9p1MLQzmLh2ljSeg==", + "dev": true, + "requires": { + "ansi-html": "0.0.7", + "bonjour": "^3.5.0", + "chokidar": "^2.1.8", + "compression": "^1.7.4", + "connect-history-api-fallback": "^1.6.0", + "debug": "^4.1.1", + "del": "^4.1.1", + "express": "^4.17.1", + "html-entities": "^1.3.1", + "http-proxy-middleware": "0.19.1", + "import-local": "^2.0.0", + "internal-ip": "^4.3.0", + "ip": "^1.1.5", + "is-absolute-url": "^3.0.3", + "killable": "^1.0.1", + "loglevel": "^1.6.8", + "opn": "^5.5.0", + "p-retry": "^3.0.1", + "portfinder": "^1.0.26", + "schema-utils": "^1.0.0", + "selfsigned": "^1.10.7", + "semver": "^6.3.0", + "serve-index": "^1.9.1", + "sockjs": "0.3.20", + "sockjs-client": "1.4.0", + "spdy": "^4.0.2", + "strip-ansi": "^3.0.1", + "supports-color": "^6.1.0", + "url": "^0.11.0", + "webpack-dev-middleware": "^3.7.2", + "webpack-log": "^2.0.0", + "ws": "^6.2.1", + "yargs": "^13.3.2" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/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" + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true + }, + "is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/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" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/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" + } + } + } + }, + "webpack-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz", + "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", + "dev": true, + "requires": { + "ansi-colors": "^3.0.0", + "uuid": "^3.3.2" + } + }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "webpack-subresource-integrity": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-1.4.0.tgz", + "integrity": "sha512-GB1kB/LwAWC3CxwcedGhMkxGpNZxSheCe1q+KJP1bakuieAdX/rGHEcf5zsEzhKXpqsGqokgsDoD9dIkr61VDQ==", + "dev": true, + "requires": { + "webpack-sources": "^1.3.0" + } + }, + "websocket-driver": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", + "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=", + "dev": true, + "requires": { + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true + }, + "when": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/when/-/when-3.6.4.tgz", + "integrity": "sha1-RztRfsFZ4rhQBUl6E5g/CVQS404=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "worker-plugin": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/worker-plugin/-/worker-plugin-4.0.3.tgz", + "integrity": "sha512-7hFDYWiKcE3yHZvemsoM9lZis/PzurHAEX1ej8PLCu818Rt6QqUAiDdxHPCKZctzmhqzPpcFSgvMCiPbtooqAg==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true + }, + "xmlhttprequest-ssl": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", + "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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://registry.npmjs.org/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.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/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.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "zone.js": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.10.3.tgz", + "integrity": "sha512-LXVLVEq0NNOqK/fLJo3d0kfzd4sxwn2/h67/02pjCjfKDxgx1i9QqpvtHD8CrBnSSwMw5+dy11O7FRX5mkO7Cg==" + } + } +} diff --git a/reactive-systems/frontend/package.json b/reactive-systems/frontend/package.json new file mode 100644 index 0000000000..e3c202f9c4 --- /dev/null +++ b/reactive-systems/frontend/package.json @@ -0,0 +1,47 @@ +{ + "name": "frontend", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "~9.1.7", + "@angular/common": "~9.1.7", + "@angular/compiler": "~9.1.7", + "@angular/core": "~9.1.7", + "@angular/forms": "~9.1.7", + "@angular/platform-browser": "~9.1.7", + "@angular/platform-browser-dynamic": "~9.1.7", + "@angular/router": "~9.1.7", + "bootstrap": "^4.5.0", + "rxjs": "~6.5.4", + "tslib": "^1.10.0", + "zone.js": "~0.10.2" + }, + "devDependencies": { + "@angular-devkit/build-angular": "~0.901.6", + "@angular/cli": "~9.1.6", + "@angular/compiler-cli": "~9.1.7", + "@types/node": "^12.11.1", + "@types/jasmine": "~3.5.0", + "@types/jasminewd2": "~2.0.3", + "codelyzer": "^5.1.2", + "jasmine-core": "~3.5.0", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~5.0.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage-istanbul-reporter": "~2.1.0", + "karma-jasmine": "~3.0.1", + "karma-jasmine-html-reporter": "^1.4.2", + "protractor": "~5.4.3", + "ts-node": "~8.3.0", + "tslint": "~6.1.0", + "typescript": "~3.8.3" + } +} diff --git a/reactive-systems/frontend/src/app/app.component.css b/reactive-systems/frontend/src/app/app.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/reactive-systems/frontend/src/app/app.component.html b/reactive-systems/frontend/src/app/app.component.html new file mode 100644 index 0000000000..c7af16bbae --- /dev/null +++ b/reactive-systems/frontend/src/app/app.component.html @@ -0,0 +1 @@ + diff --git a/reactive-systems/frontend/src/app/app.component.spec.ts b/reactive-systems/frontend/src/app/app.component.spec.ts new file mode 100644 index 0000000000..34f86dc45a --- /dev/null +++ b/reactive-systems/frontend/src/app/app.component.spec.ts @@ -0,0 +1,31 @@ +import { TestBed, async } from '@angular/core/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'frontend'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('frontend'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement; + expect(compiled.querySelector('.content span').textContent).toContain('frontend app is running!'); + }); +}); diff --git a/reactive-systems/frontend/src/app/app.component.ts b/reactive-systems/frontend/src/app/app.component.ts new file mode 100644 index 0000000000..9d6b2f11d5 --- /dev/null +++ b/reactive-systems/frontend/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { + title = 'frontend'; +} diff --git a/reactive-systems/frontend/src/app/app.module.ts b/reactive-systems/frontend/src/app/app.module.ts new file mode 100644 index 0000000000..7a8709583c --- /dev/null +++ b/reactive-systems/frontend/src/app/app.module.ts @@ -0,0 +1,29 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; + +import { AppComponent } from './app.component'; +import { OrdersComponent } from './orders/orders.component'; + +import { ReactiveFormsModule } from '@angular/forms'; +import { HttpClientModule } from '@angular/common/http'; + +import { OrdersBlockingService } from './orders/orders-blocking.service'; +import { OrdersReactiveService } from './orders/orders-reactive.service'; + +@NgModule({ + declarations: [ + AppComponent, + OrdersComponent + ], + imports: [ + BrowserModule, + ReactiveFormsModule, + HttpClientModule + ], + providers: [ + OrdersBlockingService, + OrdersReactiveService + ], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/reactive-systems/frontend/src/app/orders/orders-blocking.service.ts b/reactive-systems/frontend/src/app/orders/orders-blocking.service.ts new file mode 100644 index 0000000000..13ca2c936c --- /dev/null +++ b/reactive-systems/frontend/src/app/orders/orders-blocking.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from "@angular/common/http"; +import { Observable } from 'rxjs'; + +@Injectable() +export class OrdersBlockingService { + + url: string = 'http://localhost:8080/api/orders' + + constructor(private http: HttpClient) {} + + getOrders() { + return this.http.get(this.url) + } + +} diff --git a/reactive-systems/frontend/src/app/orders/orders-reactive.service.ts b/reactive-systems/frontend/src/app/orders/orders-reactive.service.ts new file mode 100644 index 0000000000..85ef5b3348 --- /dev/null +++ b/reactive-systems/frontend/src/app/orders/orders-reactive.service.ts @@ -0,0 +1,42 @@ +import { Injectable, NgZone } from '@angular/core'; +import { Observable } from 'rxjs'; +const EventSource: any = window['EventSource']; + +@Injectable() +export class OrdersReactiveService { + + url: string = 'http://localhost:8080/api/orders' + + orders: string[] = [] + + constructor(private _zone: NgZone) {} + + getOrderStream() { + this.orders = [] + return Observable.create((observer) => { + let eventSource = new EventSource(this.url) + eventSource.onmessage = (event) => { + console.log('Received event: ', event) + let json = JSON.parse(event.data) + this.orders.push(json); + this._zone.run(() => { + observer.next(this.orders) + }) + } + eventSource.onerror = (error) => { + if(eventSource.readyState === 0) { + console.log('The stream has been closed by the server.') + eventSource.close() + this._zone.run(() => { + observer.complete() + }) + } else { + this._zone.run(() => { + observer.error('EventSource error: ' + error) + }) + } + } + }) + } + +} diff --git a/reactive-systems/frontend/src/app/orders/orders.component.css b/reactive-systems/frontend/src/app/orders/orders.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/reactive-systems/frontend/src/app/orders/orders.component.html b/reactive-systems/frontend/src/app/orders/orders.component.html new file mode 100644 index 0000000000..c1348da17a --- /dev/null +++ b/reactive-systems/frontend/src/app/orders/orders.component.html @@ -0,0 +1,60 @@ +
+

Please place a new Order!

+
+
+

Your order {{response.id}} was successfully placed, please check the status of order.

+
+
+

Your order could not be placed at the moment: {{error.message}}

+
+
+
+

Product Quantities:

+
+
  • + {{ form.controls.lineItems['controls'][i].controls.name.value }}: +

    Only {{ form.controls.lineItems['controls'][i].controls.stock.value }} left in the stock!

    +
  • +
    +   +
    +

    Payment Mode: + +

    +
    +   +
    +

    Address:

    + + + + + +
    +   +
    + +
    +
    +
    + +
    + +
    + +
    + +
    +
    +

    Your orders placed so far:

    +
      +
    • +

      Order ID: {{ order.id }}, Order Status: {{order.orderStatus}}, Order Message: {{order.responseMessage}}

      +
    • +
    +
    diff --git a/reactive-systems/frontend/src/app/orders/orders.component.spec.ts b/reactive-systems/frontend/src/app/orders/orders.component.spec.ts new file mode 100644 index 0000000000..b8efbb0f4e --- /dev/null +++ b/reactive-systems/frontend/src/app/orders/orders.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OrdersComponent } from './orders.component'; + +describe('OrdersComponent', () => { + let component: OrdersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OrdersComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrdersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/reactive-systems/frontend/src/app/orders/orders.component.ts b/reactive-systems/frontend/src/app/orders/orders.component.ts new file mode 100644 index 0000000000..d9cd6a7697 --- /dev/null +++ b/reactive-systems/frontend/src/app/orders/orders.component.ts @@ -0,0 +1,104 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormControl, FormArray } from "@angular/forms"; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { OrdersBlockingService } from './orders-blocking.service'; +import { OrdersReactiveService } from './orders-reactive.service'; + +@Component({ + selector: 'app-orders', + templateUrl: './orders.component.html', + styleUrls: ['./orders.component.css'] +}) + +export class OrdersComponent implements OnInit { + form: FormGroup + response: any + error: any + previousOrders: Observable + itemList: any + paymentModes: any + + constructor(public fb: FormBuilder, private http: HttpClient, + private ordersBlockingService: OrdersBlockingService, + private ordersReactiveService: OrdersReactiveService) { + this.paymentModes = this.fetchPaymentModes() + this.fetchProducts().then(data => this.form = this.createForm()); + } + + ngOnInit() { + this.response = null + this.error = null + this.previousOrders = null + } + + createForm() { + let fb = this.fb + let form = fb.group({ + userId: 'Bob Marley', + paymentMode: [this.paymentModes[0]], + lineItems: this.fb.array([]), + shippingAddress: this.fb.group({ + name: ['Bob Marley'], + house: ['24'], + street: ['Ashford Av.'], + city: ['New York'], + zip: ['11001'] + }) + }) + let items = this.itemList + items.forEach(function (value, index) { + (form.get('lineItems')).push(fb.group({ + 'productId':items[index].id, + 'name': items[index].name, + 'stock': items[index].stock, + 'quantity': 10} + )) + }); + return form + } + + async fetchProducts() { + let products = [ + {"id":"p001", "name": "Product A1", "stock": 101}, + {"id":"p002", "name": "Product A2", "stock": 102} + ] + let data = await this.http.get('http://localhost:8081/api/products').toPromise() + this.itemList = data + } + + fetchPaymentModes() { + let paymentModes = ["Cash on Delivery", "Card on Delivery"] + return paymentModes + } + + createOrder() { + let headers = new HttpHeaders({ + 'Content-Type': 'application/json' + }); + let options = { + headers: headers + } + this.http.post('http://localhost:8080/api/orders', this.form.value, options).subscribe( + (response) => { + console.log(response) + this.error = null + this.response = response + }, + (error) => { + console.log(error) + this.response = null + this.error = error + } + ) + } + + getOrders() { + this.previousOrders = this.ordersBlockingService.getOrders() + } + + getOrderStream() { + this.previousOrders = this.ordersReactiveService.getOrderStream() + } + +} diff --git a/reactive-systems/frontend/src/assets/.gitkeep b/reactive-systems/frontend/src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/reactive-systems/frontend/src/environments/environment.prod.ts b/reactive-systems/frontend/src/environments/environment.prod.ts new file mode 100644 index 0000000000..3612073bc3 --- /dev/null +++ b/reactive-systems/frontend/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/reactive-systems/frontend/src/environments/environment.ts b/reactive-systems/frontend/src/environments/environment.ts new file mode 100644 index 0000000000..7b4f817adb --- /dev/null +++ b/reactive-systems/frontend/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/reactive-systems/frontend/src/favicon.ico b/reactive-systems/frontend/src/favicon.ico new file mode 100644 index 0000000000..997406ad22 Binary files /dev/null and b/reactive-systems/frontend/src/favicon.ico differ diff --git a/reactive-systems/frontend/src/index.html b/reactive-systems/frontend/src/index.html new file mode 100644 index 0000000000..3af61ec9be --- /dev/null +++ b/reactive-systems/frontend/src/index.html @@ -0,0 +1,13 @@ + + + + + Frontend + + + + + + + + diff --git a/reactive-systems/frontend/src/main.ts b/reactive-systems/frontend/src/main.ts new file mode 100644 index 0000000000..c7b673cf44 --- /dev/null +++ b/reactive-systems/frontend/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/reactive-systems/frontend/src/polyfills.ts b/reactive-systems/frontend/src/polyfills.ts new file mode 100644 index 0000000000..03711e5d92 --- /dev/null +++ b/reactive-systems/frontend/src/polyfills.ts @@ -0,0 +1,63 @@ +/** + * 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/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + */ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/reactive-systems/frontend/src/styles.css b/reactive-systems/frontend/src/styles.css new file mode 100644 index 0000000000..90d4ee0072 --- /dev/null +++ b/reactive-systems/frontend/src/styles.css @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/reactive-systems/frontend/src/test.ts b/reactive-systems/frontend/src/test.ts new file mode 100644 index 0000000000..50193eb0f2 --- /dev/null +++ b/reactive-systems/frontend/src/test.ts @@ -0,0 +1,25 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + keys(): string[]; + (id: string): T; + }; +}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/reactive-systems/frontend/tsconfig.app.json b/reactive-systems/frontend/tsconfig.app.json new file mode 100644 index 0000000000..f758d9820d --- /dev/null +++ b/reactive-systems/frontend/tsconfig.app.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/reactive-systems/frontend/tsconfig.json b/reactive-systems/frontend/tsconfig.json new file mode 100644 index 0000000000..8c4ef3bbae --- /dev/null +++ b/reactive-systems/frontend/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "module": "esnext", + "moduleResolution": "node", + "importHelpers": true, + "target": "es2015", + "lib": [ + "es2018", + "dom" + ] + }, + "angularCompilerOptions": { + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true + } +} diff --git a/reactive-systems/frontend/tsconfig.spec.json b/reactive-systems/frontend/tsconfig.spec.json new file mode 100644 index 0000000000..6400fde7d5 --- /dev/null +++ b/reactive-systems/frontend/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "src/test.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/reactive-systems/frontend/tslint.json b/reactive-systems/frontend/tslint.json new file mode 100644 index 0000000000..d92ff5d1b1 --- /dev/null +++ b/reactive-systems/frontend/tslint.json @@ -0,0 +1,148 @@ +{ + "extends": "tslint:recommended", + "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, + "array-type": false, + "arrow-return-shorthand": true, + "curly": true, + "deprecation": { + "severity": "warning" + }, + "component-class-suffix": true, + "contextual-lifecycle": true, + "directive-class-suffix": true, + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ], + "eofline": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, + "max-classes-per-file": false, + "max-line-length": [ + true, + 140 + ], + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-empty": false, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-switch-case-fall-through": true, + "no-var-requires": false, + "object-literal-key-quotes": [ + true, + "as-needed" + ], + "quotemark": [ + true, + "single" + ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, + "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + }, + "no-conflicting-lifecycle": true, + "no-host-metadata-property": true, + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "template-banana-in-box": true, + "template-no-negated-async": true, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true + }, + "rulesDirectory": [ + "codelyzer" + ] +} \ No newline at end of file diff --git a/reactive-systems/inventory-service/.mvn/wrapper/MavenWrapperDownloader.java b/reactive-systems/inventory-service/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..e76d1f3241 --- /dev/null +++ b/reactive-systems/inventory-service/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * 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 + * + * https://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 { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * 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/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".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 directory '" + 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 { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + 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/reactive-systems/inventory-service/.mvn/wrapper/maven-wrapper.jar b/reactive-systems/inventory-service/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000..2cc7d4a55c Binary files /dev/null and b/reactive-systems/inventory-service/.mvn/wrapper/maven-wrapper.jar differ diff --git a/reactive-systems/inventory-service/.mvn/wrapper/maven-wrapper.properties b/reactive-systems/inventory-service/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000000..642d572ce9 --- /dev/null +++ b/reactive-systems/inventory-service/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/reactive-systems/inventory-service/Dockerfile b/reactive-systems/inventory-service/Dockerfile new file mode 100644 index 0000000000..d37887cf34 --- /dev/null +++ b/reactive-systems/inventory-service/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:8-jdk-alpine +COPY target/inventory-service-async-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/app.jar"] \ No newline at end of file diff --git a/reactive-systems/inventory-service/HELP.md b/reactive-systems/inventory-service/HELP.md new file mode 100644 index 0000000000..53d5801551 --- /dev/null +++ b/reactive-systems/inventory-service/HELP.md @@ -0,0 +1,11 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/#build-image) +* [Spring Data Reactive MongoDB](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-mongodb) +* [Spring for Apache Kafka](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-kafka) + diff --git a/reactive-systems/inventory-service/mvnw b/reactive-systems/inventory-service/mvnw new file mode 100644 index 0000000000..a16b5431b4 --- /dev/null +++ b/reactive-systems/inventory-service/mvnw @@ -0,0 +1,310 @@ +#!/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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven 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)`" +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 + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + 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 $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + 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 + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +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/reactive-systems/inventory-service/mvnw.cmd b/reactive-systems/inventory-service/mvnw.cmd new file mode 100644 index 0000000000..c8d43372c9 --- /dev/null +++ b/reactive-systems/inventory-service/mvnw.cmd @@ -0,0 +1,182 @@ +@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 https://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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%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/reactive-systems/inventory-service/pom.xml b/reactive-systems/inventory-service/pom.xml new file mode 100644 index 0000000000..4c04afb5cb --- /dev/null +++ b/reactive-systems/inventory-service/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + com.baeldung.reactive + inventory-service + inventory-service + Demo project for Spring Boot + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-mongodb-reactive + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.kafka + spring-kafka + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + io.projectreactor + reactor-test + test + + + org.springframework.kafka + spring-kafka-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/AsyncApplication.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/AsyncApplication.java new file mode 100644 index 0000000000..ed04eadac6 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/AsyncApplication.java @@ -0,0 +1,46 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.data.mongodb.ReactiveMongoDatabaseFactory; +import org.springframework.data.mongodb.ReactiveMongoTransactionManager; +import org.springframework.data.repository.init.Jackson2RepositoryPopulatorFactoryBean; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +@SpringBootApplication +public class AsyncApplication { + + public static void main(String[] args) { + SpringApplication.run(AsyncApplication.class, args); + } + + /** + * TODO: This does not work for reactive repositories from Mongo. + */ + @Bean + public Jackson2RepositoryPopulatorFactoryBean getRespositoryPopulator() { + Jackson2RepositoryPopulatorFactoryBean factory = new Jackson2RepositoryPopulatorFactoryBean(); + factory.setResources(new Resource[] { new ClassPathResource("data.json") }); + return factory; + } + + @Bean + ReactiveMongoTransactionManager transactionManager(ReactiveMongoDatabaseFactory dbFactory) { + return new ReactiveMongoTransactionManager(dbFactory); + } + + @ControllerAdvice + public class ExceptionController { + @ExceptionHandler(value = RuntimeException.class) + public ResponseEntity exception(RuntimeException exception) { + return new ResponseEntity<>(exception.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); + } + } + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java new file mode 100644 index 0000000000..5bdc9693df --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java @@ -0,0 +1,57 @@ +package com.baeldung.async.consumer; + +import java.io.IOException; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Service; + +import com.baeldung.async.producer.OrderProducer; +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.reactive.service.ProductService; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class OrderConsumer { + + @Autowired + ProductService productService; + + @Autowired + OrderProducer orderProducer; + + @KafkaListener(topics = "orders", groupId = "inventory") + public void consume(Order order) throws IOException { + log.info("Order received to process: {}", order); + if (OrderStatus.RESERVE_INVENTORY.equals(order.getOrderStatus())) { + productService.handleOrder(order) + .doOnSuccess(o -> { + log.info("Order processed succesfully."); + orderProducer.sendMessage(order.setOrderStatus(OrderStatus.INVENTORY_SUCCESS)); + }) + .doOnError(e -> { + if (log.isDebugEnabled()) + log.error("Order failed to process: " + e); + orderProducer.sendMessage(order.setOrderStatus(OrderStatus.INVENTORY_FAILURE) + .setResponseMessage(e.getMessage())); + }) + .subscribe(); + } else if (OrderStatus.REVERT_INVENTORY.equals(order.getOrderStatus())) { + productService.revertOrder(order) + .doOnSuccess(o -> { + log.info("Order reverted succesfully."); + orderProducer.sendMessage(order.setOrderStatus(OrderStatus.INVENTORY_REVERT_SUCCESS)); + }) + .doOnError(e -> { + if (log.isDebugEnabled()) + log.error("Order failed to revert: " + e); + orderProducer.sendMessage(order.setOrderStatus(OrderStatus.INVENTORY_REVERT_FAILURE) + .setResponseMessage(e.getMessage())); + }) + .subscribe(); + } + } +} \ No newline at end of file diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/async/producer/OrderProducer.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/async/producer/OrderProducer.java new file mode 100644 index 0000000000..082d274ab0 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/async/producer/OrderProducer.java @@ -0,0 +1,23 @@ +package com.baeldung.async.producer; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.stereotype.Service; + +import com.baeldung.domain.Order; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class OrderProducer { + + @Autowired + private KafkaTemplate kafkaTemplate; + + public void sendMessage(Order order) { + log.info("Order processed to dispatch: {}", order); + this.kafkaTemplate.send("orders", order); + } + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/constants/OrderStatus.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/constants/OrderStatus.java new file mode 100644 index 0000000000..030d302e2e --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/constants/OrderStatus.java @@ -0,0 +1,7 @@ +package com.baeldung.constants; + +public enum OrderStatus { + + SUCCESS, FAILURE, INITIATION_SUCCESS, RESERVE_INVENTORY, REVERT_INVENTORY, INVENTORY_SUCCESS, INVENTORY_FAILURE, INVENTORY_REVERT_SUCCESS, INVENTORY_REVERT_FAILURE, PREPARE_SHIPPING, SHIPPING_SUCCESS, SHIPPING_FAILURE, + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/LineItem.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/LineItem.java new file mode 100644 index 0000000000..0a475aed8d --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/LineItem.java @@ -0,0 +1,29 @@ +package com.baeldung.domain; + +import org.bson.types.ObjectId; + +import com.baeldung.serdeser.ObjectIdSerializer; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class LineItem { + + @JsonSerialize(using = ObjectIdSerializer.class) + private ObjectId productId; + private int quantity; + + public LineItem setProductId(ObjectId productId) { + this.productId = productId; + return this; + } + + public LineItem setQuantity(int quantity) { + this.quantity = quantity; + return this; + } + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/Order.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/Order.java new file mode 100644 index 0000000000..595b555eed --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/Order.java @@ -0,0 +1,40 @@ +package com.baeldung.domain; + +import java.util.List; + +import org.bson.types.ObjectId; +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + +import com.baeldung.constants.OrderStatus; +import com.baeldung.serdeser.ObjectIdSerializer; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import lombok.Data; + +@Data +@Document +@JsonIgnoreProperties(ignoreUnknown = true) +public class Order { + + @Id + @JsonSerialize(using = ObjectIdSerializer.class) + private ObjectId id; + private String userId; + private List lineItems; + private Long total; + private OrderStatus orderStatus; + private String responseMessage; + + public Order setOrderStatus(OrderStatus orderStatus) { + this.orderStatus = orderStatus; + return this; + } + + public Order setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + return this; + } + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/Product.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/Product.java new file mode 100644 index 0000000000..33f801c194 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/domain/Product.java @@ -0,0 +1,21 @@ +package com.baeldung.domain; + +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.core.mapping.Document; + +import com.baeldung.serdeser.ObjectIdSerializer; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import lombok.Data; + +@Data +@Document +public class Product { + + @JsonSerialize(using = ObjectIdSerializer.class) + private ObjectId id; + private String name; + private Long price; + private Integer stock; + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/controller/ProductController.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/controller/ProductController.java new file mode 100644 index 0000000000..500400f74f --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/controller/ProductController.java @@ -0,0 +1,30 @@ +package com.baeldung.reactive.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.domain.Product; +import com.baeldung.reactive.service.ProductService; + +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Flux; + +@Slf4j +@RestController +@CrossOrigin(origins = "*") +@RequestMapping("/api/products") +public class ProductController { + + @Autowired + ProductService productService; + + @GetMapping + public Flux getAllProducts() { + log.info("Get all products invoked."); + return productService.getProducts(); + } + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/repository/ProductRepository.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/repository/ProductRepository.java new file mode 100644 index 0000000000..7dbaf2a4c4 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/repository/ProductRepository.java @@ -0,0 +1,10 @@ +package com.baeldung.reactive.repository; + +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.repository.ReactiveMongoRepository; + +import com.baeldung.domain.Product; + +public interface ProductRepository extends ReactiveMongoRepository { + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/service/ProductService.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/service/ProductService.java new file mode 100644 index 0000000000..087d0a3be5 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/reactive/service/ProductService.java @@ -0,0 +1,72 @@ +package com.baeldung.reactive.service; + +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.domain.Product; +import com.baeldung.reactive.repository.ProductRepository; + +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@Slf4j +@Service +public class ProductService { + + @Autowired + ProductRepository productRepository; + + @Transactional + public Mono handleOrder(Order order) { + log.info("Handle order invoked with: {}", order); + return Flux.fromIterable(order.getLineItems()) + .flatMap(l -> productRepository.findById(l.getProductId())) + .flatMap(p -> { + int q = order.getLineItems() + .stream() + .filter(l -> l.getProductId() + .equals(p.getId())) + .findAny() + .get() + .getQuantity(); + if (p.getStock() >= q) { + p.setStock(p.getStock() - q); + return productRepository.save(p); + } else { + return Mono.error(new RuntimeException("Product is out of stock: " + p.getId())); + } + }) + .then(Mono.just(order.setOrderStatus(OrderStatus.SUCCESS))); + } + + @Transactional + public Mono revertOrder(Order order) { + log.info("Revert order invoked with: {}", order); + return Flux.fromIterable(order.getLineItems()) + .flatMap(l -> productRepository.findById(l.getProductId())) + .flatMap(p -> { + int q = order.getLineItems() + .stream() + .filter(l -> l.getProductId() + .equals(p.getId())) + .collect(Collectors.toList()) + .get(0) + .getQuantity(); + + p.setStock(p.getStock() + q); + return productRepository.save(p); + }) + .then(Mono.just(order.setOrderStatus(OrderStatus.SUCCESS))); + } + + public Flux getProducts() { + return productRepository.findAll(); + } + +} diff --git a/reactive-systems/inventory-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java b/reactive-systems/inventory-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java new file mode 100644 index 0000000000..0b0b743e7e --- /dev/null +++ b/reactive-systems/inventory-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java @@ -0,0 +1,20 @@ +package com.baeldung.serdeser; + +import java.io.IOException; + +import org.bson.types.ObjectId; +import org.springframework.stereotype.Component; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +@Component +public class ObjectIdSerializer extends JsonSerializer { + + @Override + public void serialize(ObjectId value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeString(value.toString()); + } +} diff --git a/reactive-systems/inventory-service/src/main/resources/application-docker.properties b/reactive-systems/inventory-service/src/main/resources/application-docker.properties new file mode 100644 index 0000000000..2b494a8dbc --- /dev/null +++ b/reactive-systems/inventory-service/src/main/resources/application-docker.properties @@ -0,0 +1,7 @@ +server.port=8081 +spring.data.mongodb.uri=mongodb://mongo-db:27017/reactive-systems +spring.kafka.bootstrap-servers=kafka-broker:9092 +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.producer.properties.spring.json.add.type.headers=false +spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer +spring.kafka.consumer.properties.spring.json.value.default.type=com.baeldung.domain.Order \ No newline at end of file diff --git a/reactive-systems/inventory-service/src/main/resources/application.properties b/reactive-systems/inventory-service/src/main/resources/application.properties new file mode 100644 index 0000000000..d8a8c7af08 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/resources/application.properties @@ -0,0 +1,7 @@ +server.port=8081 +spring.data.mongodb.uri=mongodb://localhost:27017/reactive-systems +spring.kafka.bootstrap-servers=localhost:9092 +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.producer.properties.spring.json.add.type.headers=false +spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer +spring.kafka.consumer.properties.spring.json.value.default.type=com.baeldung.domain.Order \ No newline at end of file diff --git a/reactive-systems/inventory-service/src/main/resources/data.json b/reactive-systems/inventory-service/src/main/resources/data.json new file mode 100644 index 0000000000..624770ca60 --- /dev/null +++ b/reactive-systems/inventory-service/src/main/resources/data.json @@ -0,0 +1,16 @@ +[ + { + "_class" : "com.baeldung.domain.Product", + "id": "5edcbfd30717397ae8cfb7f0", + "name" : "Product A", + "price" : "12", + "stock" : "100" + }, + { + "_class" : "com.baeldung.domain.Product", + "id": "5edcbfd30717397ae8cfb7f1", + "name" : "Product D", + "price" : "16", + "stock" : "100" + } +] \ No newline at end of file diff --git a/reactive-systems/order-service/.mvn/wrapper/MavenWrapperDownloader.java b/reactive-systems/order-service/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..e76d1f3241 --- /dev/null +++ b/reactive-systems/order-service/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * 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 + * + * https://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 { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * 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/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".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 directory '" + 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 { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + 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/reactive-systems/order-service/.mvn/wrapper/maven-wrapper.jar b/reactive-systems/order-service/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000..2cc7d4a55c Binary files /dev/null and b/reactive-systems/order-service/.mvn/wrapper/maven-wrapper.jar differ diff --git a/reactive-systems/order-service/.mvn/wrapper/maven-wrapper.properties b/reactive-systems/order-service/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000000..642d572ce9 --- /dev/null +++ b/reactive-systems/order-service/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/reactive-systems/order-service/Dockerfile b/reactive-systems/order-service/Dockerfile new file mode 100644 index 0000000000..516e088a05 --- /dev/null +++ b/reactive-systems/order-service/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:8-jdk-alpine +COPY target/order-service-async-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/app.jar"] \ No newline at end of file diff --git a/reactive-systems/order-service/HELP.md b/reactive-systems/order-service/HELP.md new file mode 100644 index 0000000000..53d5801551 --- /dev/null +++ b/reactive-systems/order-service/HELP.md @@ -0,0 +1,11 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/#build-image) +* [Spring Data Reactive MongoDB](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-mongodb) +* [Spring for Apache Kafka](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-kafka) + diff --git a/reactive-systems/order-service/mvnw b/reactive-systems/order-service/mvnw new file mode 100644 index 0000000000..a16b5431b4 --- /dev/null +++ b/reactive-systems/order-service/mvnw @@ -0,0 +1,310 @@ +#!/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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven 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)`" +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 + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + 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 $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + 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 + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +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/reactive-systems/order-service/mvnw.cmd b/reactive-systems/order-service/mvnw.cmd new file mode 100644 index 0000000000..c8d43372c9 --- /dev/null +++ b/reactive-systems/order-service/mvnw.cmd @@ -0,0 +1,182 @@ +@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 https://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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%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/reactive-systems/order-service/pom.xml b/reactive-systems/order-service/pom.xml new file mode 100644 index 0000000000..c793f448b5 --- /dev/null +++ b/reactive-systems/order-service/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + com.baeldung.reactive + order-service + order-service + Demo project for Spring Boot + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-mongodb-reactive + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.kafka + spring-kafka + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + io.projectreactor + reactor-test + test + + + org.springframework.kafka + spring-kafka-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/AsyncApplication.java b/reactive-systems/order-service/src/main/java/com/baeldung/AsyncApplication.java new file mode 100644 index 0000000000..892122984e --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/AsyncApplication.java @@ -0,0 +1,25 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +@SpringBootApplication +public class AsyncApplication { + + public static void main(String[] args) { + SpringApplication.run(AsyncApplication.class, args); + } + + @ControllerAdvice + public class ExceptionController { + @ExceptionHandler(value = RuntimeException.class) + public ResponseEntity exception(RuntimeException exception) { + return new ResponseEntity<>(exception.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); + } + } + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java b/reactive-systems/order-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java new file mode 100644 index 0000000000..31599f76ba --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java @@ -0,0 +1,66 @@ +package com.baeldung.async.consumer; + +import java.io.IOException; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Service; + +import com.baeldung.async.producer.OrderProducer; +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.reactive.repository.OrderRepository; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class OrderConsumer { + + @Autowired + OrderRepository orderRepository; + + @Autowired + OrderProducer orderProducer; + + @KafkaListener(topics = "orders", groupId = "orders") + public void consume(Order order) throws IOException { + log.info("Order received to process: {}", order); + if (OrderStatus.INITIATION_SUCCESS.equals(order.getOrderStatus())) { + orderRepository.findById(order.getId()) + .map(o -> { + orderProducer.sendMessage(o.setOrderStatus(OrderStatus.RESERVE_INVENTORY)); + return o.setOrderStatus(order.getOrderStatus()) + .setResponseMessage(order.getResponseMessage()); + }) + .flatMap(orderRepository::save) + .subscribe(); + } else if (OrderStatus.INVENTORY_SUCCESS.equals(order.getOrderStatus())) { + orderRepository.findById(order.getId()) + .map(o -> { + orderProducer.sendMessage(o.setOrderStatus(OrderStatus.PREPARE_SHIPPING)); + return o.setOrderStatus(order.getOrderStatus()) + .setResponseMessage(order.getResponseMessage()); + }) + .flatMap(orderRepository::save) + .subscribe(); + } else if (OrderStatus.SHIPPING_FAILURE.equals(order.getOrderStatus())) { + orderRepository.findById(order.getId()) + .map(o -> { + orderProducer.sendMessage(o.setOrderStatus(OrderStatus.REVERT_INVENTORY)); + return o.setOrderStatus(order.getOrderStatus()) + .setResponseMessage(order.getResponseMessage()); + }) + .flatMap(orderRepository::save) + .subscribe(); + } else { + orderRepository.findById(order.getId()) + .map(o -> { + return o.setOrderStatus(order.getOrderStatus()) + .setResponseMessage(order.getResponseMessage()); + }) + .flatMap(orderRepository::save) + .subscribe(); + } + } +} \ No newline at end of file diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/async/producer/OrderProducer.java b/reactive-systems/order-service/src/main/java/com/baeldung/async/producer/OrderProducer.java new file mode 100644 index 0000000000..082d274ab0 --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/async/producer/OrderProducer.java @@ -0,0 +1,23 @@ +package com.baeldung.async.producer; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.stereotype.Service; + +import com.baeldung.domain.Order; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class OrderProducer { + + @Autowired + private KafkaTemplate kafkaTemplate; + + public void sendMessage(Order order) { + log.info("Order processed to dispatch: {}", order); + this.kafkaTemplate.send("orders", order); + } + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/constants/OrderStatus.java b/reactive-systems/order-service/src/main/java/com/baeldung/constants/OrderStatus.java new file mode 100644 index 0000000000..030d302e2e --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/constants/OrderStatus.java @@ -0,0 +1,7 @@ +package com.baeldung.constants; + +public enum OrderStatus { + + SUCCESS, FAILURE, INITIATION_SUCCESS, RESERVE_INVENTORY, REVERT_INVENTORY, INVENTORY_SUCCESS, INVENTORY_FAILURE, INVENTORY_REVERT_SUCCESS, INVENTORY_REVERT_FAILURE, PREPARE_SHIPPING, SHIPPING_SUCCESS, SHIPPING_FAILURE, + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/domain/Address.java b/reactive-systems/order-service/src/main/java/com/baeldung/domain/Address.java new file mode 100644 index 0000000000..987803d9c1 --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/domain/Address.java @@ -0,0 +1,14 @@ +package com.baeldung.domain; + +import lombok.Data; + +@Data +public class Address { + + private String name; + private String house; + private String street; + private String city; + private String zip; + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/domain/LineItem.java b/reactive-systems/order-service/src/main/java/com/baeldung/domain/LineItem.java new file mode 100644 index 0000000000..0a475aed8d --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/domain/LineItem.java @@ -0,0 +1,29 @@ +package com.baeldung.domain; + +import org.bson.types.ObjectId; + +import com.baeldung.serdeser.ObjectIdSerializer; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class LineItem { + + @JsonSerialize(using = ObjectIdSerializer.class) + private ObjectId productId; + private int quantity; + + public LineItem setProductId(ObjectId productId) { + this.productId = productId; + return this; + } + + public LineItem setQuantity(int quantity) { + this.quantity = quantity; + return this; + } + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/domain/Order.java b/reactive-systems/order-service/src/main/java/com/baeldung/domain/Order.java new file mode 100644 index 0000000000..2176aceb89 --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/domain/Order.java @@ -0,0 +1,52 @@ +package com.baeldung.domain; + +import java.util.Date; +import java.util.List; + +import org.bson.types.ObjectId; +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + +import com.baeldung.constants.OrderStatus; +import com.baeldung.serdeser.ObjectIdSerializer; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import lombok.Data; + +@Data +@Document +public class Order { + + @Id + @JsonSerialize(using = ObjectIdSerializer.class) + private ObjectId id; + private String userId; + private List lineItems; + private Long total; + private String paymentMode; + private Address shippingAddress; + private Date shippingDate; + private OrderStatus orderStatus; + private String responseMessage; + + public Order setLineItems(List lineItems) { + this.lineItems = lineItems; + return this; + } + + public Order setShippingDate(Date shippingDate) { + this.shippingDate = shippingDate; + return this; + } + + public Order setOrderStatus(OrderStatus orderStatus) { + this.orderStatus = orderStatus; + return this; + } + + public Order setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + return this; + } + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/reactive/controller/OrderController.java b/reactive-systems/order-service/src/main/java/com/baeldung/reactive/controller/OrderController.java new file mode 100644 index 0000000000..2aea36820b --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/reactive/controller/OrderController.java @@ -0,0 +1,47 @@ +package com.baeldung.reactive.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.reactive.service.OrderService; + +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@Slf4j +@RestController +@CrossOrigin(origins = "*") +@RequestMapping("/api/orders") +public class OrderController { + + @Autowired + private OrderService orderService; + + @PostMapping + public Mono create(@RequestBody Order order) { + log.info("Create order invoked with: {}", order); + return orderService.createOrder(order) + .flatMap(o -> { + if (OrderStatus.FAILURE.equals(o.getOrderStatus())) { + return Mono.error(new RuntimeException("Order processing failed, please try again later. " + o.getResponseMessage())); + } else { + return Mono.just(o); + } + }); + } + + @GetMapping + public Flux getAll() { + log.info("Get all orders invoked."); + return orderService.getOrders(); + } + +} \ No newline at end of file diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/reactive/repository/OrderRepository.java b/reactive-systems/order-service/src/main/java/com/baeldung/reactive/repository/OrderRepository.java new file mode 100644 index 0000000000..f461813a65 --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/reactive/repository/OrderRepository.java @@ -0,0 +1,10 @@ +package com.baeldung.reactive.repository; + +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.repository.ReactiveMongoRepository; + +import com.baeldung.domain.Order; + +public interface OrderRepository extends ReactiveMongoRepository { + +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/reactive/service/OrderService.java b/reactive-systems/order-service/src/main/java/com/baeldung/reactive/service/OrderService.java new file mode 100644 index 0000000000..625345cb4e --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/reactive/service/OrderService.java @@ -0,0 +1,52 @@ +package com.baeldung.reactive.service; + +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baeldung.async.producer.OrderProducer; +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.reactive.repository.OrderRepository; + +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@Slf4j +@Service +public class OrderService { + + @Autowired + private OrderRepository orderRepository; + + @Autowired + private OrderProducer orderProducer; + + public Mono createOrder(Order order) { + log.info("Create order invoked with: {}", order); + return Mono.just(order) + .map(o -> { + return o.setLineItems(o.getLineItems() + .stream() + .filter(l -> l.getQuantity() > 0) + .collect(Collectors.toList())); + }) + .flatMap(orderRepository::save) + .map(o -> { + orderProducer.sendMessage(o.setOrderStatus(OrderStatus.INITIATION_SUCCESS)); + return o; + }) + .onErrorResume(err -> { + return Mono.just(order.setOrderStatus(OrderStatus.FAILURE) + .setResponseMessage(err.getMessage())); + }) + .flatMap(orderRepository::save); + } + + public Flux getOrders() { + log.info("Get all orders invoked."); + return orderRepository.findAll(); + } +} diff --git a/reactive-systems/order-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java b/reactive-systems/order-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java new file mode 100644 index 0000000000..0b0b743e7e --- /dev/null +++ b/reactive-systems/order-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java @@ -0,0 +1,20 @@ +package com.baeldung.serdeser; + +import java.io.IOException; + +import org.bson.types.ObjectId; +import org.springframework.stereotype.Component; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +@Component +public class ObjectIdSerializer extends JsonSerializer { + + @Override + public void serialize(ObjectId value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeString(value.toString()); + } +} diff --git a/reactive-systems/order-service/src/main/resources/application-docker.properties b/reactive-systems/order-service/src/main/resources/application-docker.properties new file mode 100644 index 0000000000..326c86af7b --- /dev/null +++ b/reactive-systems/order-service/src/main/resources/application-docker.properties @@ -0,0 +1,7 @@ +server.port=8080 +spring.data.mongodb.uri=mongodb://mongo-db:27017/reactive-systems +spring.kafka.bootstrap-servers=kafka-broker:9092 +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.producer.properties.spring.json.add.type.headers=false +spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer +spring.kafka.consumer.properties.spring.json.value.default.type=com.baeldung.domain.Order \ No newline at end of file diff --git a/reactive-systems/order-service/src/main/resources/application.properties b/reactive-systems/order-service/src/main/resources/application.properties new file mode 100644 index 0000000000..759ba14164 --- /dev/null +++ b/reactive-systems/order-service/src/main/resources/application.properties @@ -0,0 +1,7 @@ +server.port=8080 +spring.data.mongodb.uri=mongodb://localhost:27017/reactive-systems +spring.kafka.bootstrap-servers=localhost:9092 +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.producer.properties.spring.json.add.type.headers=false +spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer +spring.kafka.consumer.properties.spring.json.value.default.type=com.baeldung.domain.Order \ No newline at end of file diff --git a/maven-all/pom.xml b/reactive-systems/pom.xml similarity index 59% rename from maven-all/pom.xml rename to reactive-systems/pom.xml index 3a79a2a686..bce2575d9e 100644 --- a/maven-all/pom.xml +++ b/reactive-systems/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - maven-all + reactive-systems 0.0.1-SNAPSHOT - maven-all + reactive-systems pom @@ -14,12 +14,9 @@ - - maven - maven-custom-plugin/counter-maven-plugin - maven-war-plugin - profiles - versions-maven-plugin + inventory-service + shipping-service + order-service diff --git a/reactive-systems/shipping-service/.mvn/wrapper/MavenWrapperDownloader.java b/reactive-systems/shipping-service/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..e76d1f3241 --- /dev/null +++ b/reactive-systems/shipping-service/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * 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 + * + * https://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 { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * 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/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".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 directory '" + 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 { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + 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/reactive-systems/shipping-service/.mvn/wrapper/maven-wrapper.jar b/reactive-systems/shipping-service/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000..2cc7d4a55c Binary files /dev/null and b/reactive-systems/shipping-service/.mvn/wrapper/maven-wrapper.jar differ diff --git a/reactive-systems/shipping-service/.mvn/wrapper/maven-wrapper.properties b/reactive-systems/shipping-service/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000000..642d572ce9 --- /dev/null +++ b/reactive-systems/shipping-service/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/reactive-systems/shipping-service/Dockerfile b/reactive-systems/shipping-service/Dockerfile new file mode 100644 index 0000000000..4906d1d9a8 --- /dev/null +++ b/reactive-systems/shipping-service/Dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:8-jdk-alpine +COPY target/shipping-service-async-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/app.jar"] \ No newline at end of file diff --git a/reactive-systems/shipping-service/HELP.md b/reactive-systems/shipping-service/HELP.md new file mode 100644 index 0000000000..53d5801551 --- /dev/null +++ b/reactive-systems/shipping-service/HELP.md @@ -0,0 +1,11 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/#build-image) +* [Spring Data Reactive MongoDB](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-mongodb) +* [Spring for Apache Kafka](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/htmlsingle/#boot-features-kafka) + diff --git a/reactive-systems/shipping-service/mvnw b/reactive-systems/shipping-service/mvnw new file mode 100644 index 0000000000..a16b5431b4 --- /dev/null +++ b/reactive-systems/shipping-service/mvnw @@ -0,0 +1,310 @@ +#!/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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven 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)`" +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 + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + 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 $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + 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 + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +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/reactive-systems/shipping-service/mvnw.cmd b/reactive-systems/shipping-service/mvnw.cmd new file mode 100644 index 0000000000..c8d43372c9 --- /dev/null +++ b/reactive-systems/shipping-service/mvnw.cmd @@ -0,0 +1,182 @@ +@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 https://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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%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/reactive-systems/shipping-service/pom.xml b/reactive-systems/shipping-service/pom.xml new file mode 100644 index 0000000000..72487e691e --- /dev/null +++ b/reactive-systems/shipping-service/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + com.baeldung.reactive + shipping-service + shipping-service + Demo project for Spring Boot + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-mongodb-reactive + + + org.springframework.kafka + spring-kafka + + + + com.fasterxml.jackson.core + jackson-databind + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + io.projectreactor + reactor-test + test + + + org.springframework.kafka + spring-kafka-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/AsyncApplication.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/AsyncApplication.java new file mode 100644 index 0000000000..20eb0d30ab --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/AsyncApplication.java @@ -0,0 +1,13 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AsyncApplication { + + public static void main(String[] args) { + SpringApplication.run(AsyncApplication.class, args); + } + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java new file mode 100644 index 0000000000..16808c0b40 --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/async/consumer/OrderConsumer.java @@ -0,0 +1,45 @@ +package com.baeldung.async.consumer; + +import java.io.IOException; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Service; + +import com.baeldung.async.producer.OrderProducer; +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.reactive.service.ShippingService; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class OrderConsumer { + + @Autowired + ShippingService shippingService; + + @Autowired + OrderProducer orderProducer; + + @KafkaListener(topics = "orders", groupId = "shipping") + public void consume(Order order) throws IOException { + log.info("Order received to process: {}", order); + if (OrderStatus.PREPARE_SHIPPING.equals(order.getOrderStatus())) { + shippingService.handleOrder(order) + .doOnSuccess(o -> { + log.info("Order processed succesfully."); + orderProducer.sendMessage(order.setOrderStatus(OrderStatus.SHIPPING_SUCCESS) + .setShippingDate(o.getShippingDate())); + }) + .doOnError(e -> { + if (log.isErrorEnabled()) + log.error("Order failed to process: " + e); + orderProducer.sendMessage(order.setOrderStatus(OrderStatus.SHIPPING_FAILURE) + .setResponseMessage(e.getMessage())); + }) + .subscribe(); + } + } +} \ No newline at end of file diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/async/producer/OrderProducer.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/async/producer/OrderProducer.java new file mode 100644 index 0000000000..082d274ab0 --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/async/producer/OrderProducer.java @@ -0,0 +1,23 @@ +package com.baeldung.async.producer; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.stereotype.Service; + +import com.baeldung.domain.Order; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class OrderProducer { + + @Autowired + private KafkaTemplate kafkaTemplate; + + public void sendMessage(Order order) { + log.info("Order processed to dispatch: {}", order); + this.kafkaTemplate.send("orders", order); + } + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/constants/OrderStatus.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/constants/OrderStatus.java new file mode 100644 index 0000000000..030d302e2e --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/constants/OrderStatus.java @@ -0,0 +1,7 @@ +package com.baeldung.constants; + +public enum OrderStatus { + + SUCCESS, FAILURE, INITIATION_SUCCESS, RESERVE_INVENTORY, REVERT_INVENTORY, INVENTORY_SUCCESS, INVENTORY_FAILURE, INVENTORY_REVERT_SUCCESS, INVENTORY_REVERT_FAILURE, PREPARE_SHIPPING, SHIPPING_SUCCESS, SHIPPING_FAILURE, + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Address.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Address.java new file mode 100644 index 0000000000..987803d9c1 --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Address.java @@ -0,0 +1,14 @@ +package com.baeldung.domain; + +import lombok.Data; + +@Data +public class Address { + + private String name; + private String house; + private String street; + private String city; + private String zip; + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Order.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Order.java new file mode 100644 index 0000000000..ed1f85aa4b --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Order.java @@ -0,0 +1,45 @@ +package com.baeldung.domain; + +import java.time.LocalDate; + +import org.bson.types.ObjectId; +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + +import com.baeldung.constants.OrderStatus; +import com.baeldung.serdeser.ObjectIdSerializer; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import lombok.Data; + +@Data +@Document +public class Order { + + @Id + @JsonSerialize(using = ObjectIdSerializer.class) + private ObjectId id; + private String userId; + private Long total; + private String paymentMode; + private Address shippingAddress; + private LocalDate shippingDate; + private OrderStatus orderStatus; + private String responseMessage; + + public Order setShippingDate(LocalDate shippingDate) { + this.shippingDate = shippingDate; + return this; + } + + public Order setOrderStatus(OrderStatus orderStatus) { + this.orderStatus = orderStatus; + return this; + } + + public Order setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + return this; + } + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Shipment.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Shipment.java new file mode 100644 index 0000000000..74971f942b --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/domain/Shipment.java @@ -0,0 +1,28 @@ +package com.baeldung.domain; + +import java.time.LocalDate; + +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.core.mapping.Document; + +import lombok.Data; + +@Data +@Document +public class Shipment { + + private ObjectId id; + private LocalDate shippingDate; + private Address address; + + public Shipment setShippingDate(LocalDate shippingDate) { + this.shippingDate = shippingDate; + return this; + } + + public Shipment setAddress(Address address) { + this.address = address; + return this; + } + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/reactive/repository/ShipmentRepository.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/reactive/repository/ShipmentRepository.java new file mode 100644 index 0000000000..5916cc1b06 --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/reactive/repository/ShipmentRepository.java @@ -0,0 +1,10 @@ +package com.baeldung.reactive.repository; + +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.repository.ReactiveMongoRepository; + +import com.baeldung.domain.Shipment; + +public interface ShipmentRepository extends ReactiveMongoRepository { + +} diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/reactive/service/ShippingService.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/reactive/service/ShippingService.java new file mode 100644 index 0000000000..14afbb9ed6 --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/reactive/service/ShippingService.java @@ -0,0 +1,45 @@ +package com.baeldung.reactive.service; + +import java.time.LocalDate; +import java.time.LocalTime; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baeldung.constants.OrderStatus; +import com.baeldung.domain.Order; +import com.baeldung.domain.Shipment; +import com.baeldung.reactive.repository.ShipmentRepository; + +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Mono; + +@Slf4j +@Service +public class ShippingService { + + @Autowired + ShipmentRepository shipmentRepository; + + public Mono handleOrder(Order order) { + log.info("Handle order invoked with: {}", order); + return Mono.just(order) + .flatMap(o -> { + LocalDate shippingDate = null; + if (LocalTime.now() + .isAfter(LocalTime.parse("10:00")) + && LocalTime.now() + .isBefore(LocalTime.parse("18:00"))) { + shippingDate = LocalDate.now() + .plusDays(1); + } else { + return Mono.error(new RuntimeException("The current time is off the limits to place order.")); + } + return shipmentRepository.save(new Shipment().setAddress(order.getShippingAddress()) + .setShippingDate(shippingDate)); + }) + .map(s -> order.setShippingDate(s.getShippingDate()) + .setOrderStatus(OrderStatus.SUCCESS)); + } + +} \ No newline at end of file diff --git a/reactive-systems/shipping-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java b/reactive-systems/shipping-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java new file mode 100644 index 0000000000..0b0b743e7e --- /dev/null +++ b/reactive-systems/shipping-service/src/main/java/com/baeldung/serdeser/ObjectIdSerializer.java @@ -0,0 +1,20 @@ +package com.baeldung.serdeser; + +import java.io.IOException; + +import org.bson.types.ObjectId; +import org.springframework.stereotype.Component; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +@Component +public class ObjectIdSerializer extends JsonSerializer { + + @Override + public void serialize(ObjectId value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeString(value.toString()); + } +} diff --git a/reactive-systems/shipping-service/src/main/resources/application-docker.properties b/reactive-systems/shipping-service/src/main/resources/application-docker.properties new file mode 100644 index 0000000000..1909018ce8 --- /dev/null +++ b/reactive-systems/shipping-service/src/main/resources/application-docker.properties @@ -0,0 +1,7 @@ +server.port=8082 +spring.data.mongodb.uri=mongodb://mongo-db:27017/reactive-systems +spring.kafka.bootstrap-servers=kafka-broker:9092 +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.producer.properties.spring.json.add.type.headers=false +spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer +spring.kafka.consumer.properties.spring.json.value.default.type=com.baeldung.domain.Order \ No newline at end of file diff --git a/reactive-systems/shipping-service/src/main/resources/application.properties b/reactive-systems/shipping-service/src/main/resources/application.properties new file mode 100644 index 0000000000..d71073a4cc --- /dev/null +++ b/reactive-systems/shipping-service/src/main/resources/application.properties @@ -0,0 +1,7 @@ +server.port=8082 +spring.data.mongodb.uri=mongodb://localhost:27017/reactive-systems +spring.kafka.bootstrap-servers=localhost:9092 +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.producer.properties.spring.json.add.type.headers=false +spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer +spring.kafka.consumer.properties.spring.json.value.default.type=com.baeldung.domain.Order \ No newline at end of file diff --git a/rule-engines/jess/pom.xml b/rule-engines/jess/pom.xml new file mode 100644 index 0000000000..40d50fae70 --- /dev/null +++ b/rule-engines/jess/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + com.baeldung.rules.jess + jess + 1.0-SNAPSHOT + + + + + jsr94 + jsr94 + 1.1 + + + gov.sandia + jess + 7.1p2 + + + + \ No newline at end of file diff --git a/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessHello.java b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessHello.java new file mode 100644 index 0000000000..1462996a4c --- /dev/null +++ b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessHello.java @@ -0,0 +1,17 @@ +package com.baeldung.rules.jess; + +import jess.JessException; +import jess.Rete; + +public class JessHello { + public static final String RULES_FILE = "helloJess.clp"; + + public static void main(String[] args) throws JessException { + Rete engine = new Rete(); + engine.reset(); + + engine.batch(RULES_FILE); + + engine.run(); + } +} diff --git a/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessWithData.java b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessWithData.java new file mode 100644 index 0000000000..5d5dc9b983 --- /dev/null +++ b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessWithData.java @@ -0,0 +1,42 @@ +package com.baeldung.rules.jess; + +import com.baeldung.rules.jess.model.Answer; +import com.baeldung.rules.jess.model.Question; +import jess.Filter; +import jess.JessException; +import jess.Rete; + +import java.util.Iterator; +import java.util.logging.Logger; + +public class JessWithData { + public static final String RULES_BONUS_FILE = "bonus.clp"; + private static Logger log = Logger.getLogger("JessWithData"); + + public static void main(String[] args) throws JessException { + Rete engine = new Rete(); + engine.reset(); + + engine.batch(RULES_BONUS_FILE); + + prepareData(engine); + + engine.run(); + + checkResults(engine); + } + + private static void checkResults(Rete engine) { + Iterator results = engine.getObjects(new Filter.ByClass(Answer.class)); + while (results.hasNext()) { + Answer answer = (Answer) results.next(); + log.info(answer.toString()); + } + } + + private static void prepareData(Rete engine) throws JessException { + Question question = new Question("Can I have a bonus?", -5); + log.info(question.toString()); + engine.add(question); + } +} diff --git a/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessWithJsr94.java b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessWithJsr94.java new file mode 100644 index 0000000000..f07bf10a7a --- /dev/null +++ b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/JessWithJsr94.java @@ -0,0 +1,98 @@ +package com.baeldung.rules.jess; + +import com.baeldung.rules.jess.model.Answer; +import com.baeldung.rules.jess.model.Question; + +import javax.rules.*; +import javax.rules.admin.RuleAdministrator; +import javax.rules.admin.RuleExecutionSet; +import javax.rules.admin.RuleExecutionSetCreateException; +import javax.rules.admin.RuleExecutionSetRegisterException; +import java.io.IOException; +import java.io.InputStream; +import java.rmi.RemoteException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Logger; + +public class JessWithJsr94 { + public static final String RULES_BONUS_FILE = "/bonus.clp"; + public static final String RULES_URI = "com/baeldung/rules/bonus"; + private static final String RULE_SERVICE_PROVIDER = "jess.jsr94"; + private static Logger log = Logger.getLogger("JessWithData"); + + public static void main(String[] args) throws Exception { + RuleServiceProvider ruleServiceProvider = instantiateJessInstance(); + + // load our rules and register them with the rules provider + registerRules(RULES_BONUS_FILE, RULES_URI, ruleServiceProvider); + + runRules(RULES_URI, ruleServiceProvider); + } + + private static RuleServiceProvider instantiateJessInstance() throws ClassNotFoundException, ConfigurationException { + // Load the rule service provider of the reference implementation. + // Loading this class will automatically register this provider with the provider manager. + Class.forName(RULE_SERVICE_PROVIDER + ".RuleServiceProviderImpl"); + + // Get the rule service provider from the provider manager. + return RuleServiceProviderManager.getRuleServiceProvider(RULE_SERVICE_PROVIDER); + } + + private static void runRules(String rulesURI, RuleServiceProvider ruleServiceProvider) + throws ConfigurationException, RuleSessionTypeUnsupportedException, RuleSessionCreateException, RuleExecutionSetNotFoundException, RemoteException, InvalidRuleSessionException { + // Get a RuleRuntime and invoke the rule engine. + RuleRuntime ruleRuntime = ruleServiceProvider.getRuleRuntime(); + + //Create a statelessRuleSession. + StatelessRuleSession statelessRuleSession = (StatelessRuleSession) ruleRuntime.createRuleSession(rulesURI, new HashMap(), RuleRuntime.STATELESS_SESSION_TYPE); + + calculateResults(statelessRuleSession); + + statelessRuleSession.release(); + } + + private static void calculateResults(StatelessRuleSession statelessRuleSession) throws InvalidRuleSessionException, RemoteException { + List data = prepareData(); + + // execute the rules + List results = statelessRuleSession.executeRules(data); + + checkResults(results); + } + + private static List prepareData() { + List data = new ArrayList(); + data.add(new Question("Can I have a bonus?", -5)); + return data; + } + + private static void checkResults(List results) { + Iterator itr = results.iterator(); + while (itr.hasNext()) { + Object obj = itr.next(); + if (obj instanceof Answer) { + log.info(obj.toString()); + } + } + } + + private static void registerRules(String rulesFile, String rulesURI, RuleServiceProvider serviceProvider) throws ConfigurationException, RuleExecutionSetCreateException, IOException, RuleExecutionSetRegisterException { + // Get the rule administrator. + RuleAdministrator ruleAdministrator = serviceProvider.getRuleAdministrator(); + + // load the rules + InputStream ruleInput = JessWithJsr94.class.getResourceAsStream(rulesFile); + HashMap vendorProperties = new HashMap(); + + // Create the RuleExecutionSet + RuleExecutionSet ruleExecutionSet = ruleAdministrator + .getLocalRuleExecutionSetProvider(vendorProperties) + .createRuleExecutionSet(ruleInput, vendorProperties); + + // Register the rule execution set. + ruleAdministrator.registerRuleExecutionSet(rulesURI, ruleExecutionSet, vendorProperties); + } +} \ No newline at end of file diff --git a/rule-engines/jess/src/main/java/com/baeldung/rules/jess/model/Answer.java b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/model/Answer.java new file mode 100644 index 0000000000..d690d04e13 --- /dev/null +++ b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/model/Answer.java @@ -0,0 +1,31 @@ +package com.baeldung.rules.jess.model; + +public class Answer { + private String answer; + private int newBalance; + + public Answer(String answer, int newBalance) { + this.answer = answer; + this.newBalance = newBalance; + } + + public int getNewBalance() { + return newBalance; + } + + public void setNewBalance(int newBalance) { + this.newBalance = newBalance; + } + + public String getAnswer() { + return answer; + } + + public void setAnswer(String answer) { + this.answer = answer; + } + + public String toString() { + return "Answer(answer=" + answer + ", newBalance=" + newBalance + ")"; + } +} diff --git a/rule-engines/jess/src/main/java/com/baeldung/rules/jess/model/Question.java b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/model/Question.java new file mode 100644 index 0000000000..499113d0fc --- /dev/null +++ b/rule-engines/jess/src/main/java/com/baeldung/rules/jess/model/Question.java @@ -0,0 +1,32 @@ +package com.baeldung.rules.jess.model; + +public class Question { + private String question; + private int balance; + + public Question(String question, int balance) { + this.question = question; + this.balance = balance; + } + + public String getQuestion() { + return question; + } + + public void setQuestion(String question) { + this.question = question; + } + + public int getBalance() { + return balance; + } + + public void setBalance(int balance) { + this.balance = balance; + } + + public String toString() { + return "Question(question=" + question + ", balance=" + balance + ")"; + } + +} diff --git a/rule-engines/jess/src/main/resources/bonus.clp b/rule-engines/jess/src/main/resources/bonus.clp new file mode 100644 index 0000000000..7f430bc43f --- /dev/null +++ b/rule-engines/jess/src/main/resources/bonus.clp @@ -0,0 +1,8 @@ +(import com.baeldung.rules.jess.model.*) +(deftemplate Question (declare (from-class Question))) +(deftemplate Answer (declare (from-class Answer))) + +(defrule avoid-overdraft "Give $50 to anyone overdrawn" + ?q <- (Question { balance < 0 }) + => + (add (new Answer "Overdrawn bonus" (+ ?q.balance 50)))) diff --git a/rule-engines/jess/src/main/resources/helloJess.clp b/rule-engines/jess/src/main/resources/helloJess.clp new file mode 100644 index 0000000000..547294eca6 --- /dev/null +++ b/rule-engines/jess/src/main/resources/helloJess.clp @@ -0,0 +1,3 @@ +;; Hello, world in Jess! + +(printout t "Hello from Jess!" crlf) diff --git a/spf4j/spf4j-aspects-app/pom.xml b/spf4j/spf4j-aspects-app/pom.xml index db6a18f26a..24a419233e 100644 --- a/spf4j/spf4j-aspects-app/pom.xml +++ b/spf4j/spf4j-aspects-app/pom.xml @@ -81,7 +81,6 @@ - UTF-8 8.6.10 1.7.21 3.8.0 diff --git a/spf4j/spf4j-core-app/pom.xml b/spf4j/spf4j-core-app/pom.xml index 48cbf4a1c9..280a59e0d9 100644 --- a/spf4j/spf4j-core-app/pom.xml +++ b/spf4j/spf4j-core-app/pom.xml @@ -81,7 +81,6 @@ - UTF-8 8.6.10 1.7.21 3.8.0 diff --git a/spring-5-mvc/pom.xml b/spring-5-mvc/pom.xml index 945ddef5e1..fd9868ad66 100644 --- a/spring-5-mvc/pom.xml +++ b/spring-5-mvc/pom.xml @@ -87,7 +87,7 @@ com.github.javafaker javafaker - 0.18 + ${javafaker.version} org.apache.httpcomponents @@ -177,6 +177,7 @@ 1.2.71 4.5.8 com.baeldung.Spring5Application + 0.18 diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index cc728398f3..0b5efd1a47 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -60,12 +60,12 @@ com.squareup.okhttp3 okhttp - 4.0.1 + ${okhttp.version} com.squareup.okhttp3 mockwebserver - 4.0.1 + ${okhttp.version} test @@ -171,6 +171,7 @@ 1.0 4.1 1.0.3 + 4.0.1 diff --git a/spring-5-reactive-oauth/pom.xml b/spring-5-reactive-oauth/pom.xml index e286e821b2..e9882a6d32 100644 --- a/spring-5-reactive-oauth/pom.xml +++ b/spring-5-reactive-oauth/pom.xml @@ -65,8 +65,6 @@ - UTF-8 - UTF-8 2.1.0.RELEASE diff --git a/spring-5-reactive-security/src/main/resources/application.properties b/spring-5-reactive-security/src/main/resources/application.properties index 234834b894..d13007ded7 100644 --- a/spring-5-reactive-security/src/main/resources/application.properties +++ b/spring-5-reactive-security/src/main/resources/application.properties @@ -1,5 +1,9 @@ logging.level.root=INFO -management.endpoints.web.exposure.include.=* +management.endpoints.web.exposure.include=* info.app.name=Spring Boot 2 actuator Application +management.endpoint.health.group.custom.include=diskSpace,ping +management.endpoint.health.group.custom.show-components=always +management.endpoint.health.group.custom.show-details=always +management.endpoint.health.group.custom.status.http-mapping.up=207 \ No newline at end of file diff --git a/spring-5-webflux/pom.xml b/spring-5-webflux/pom.xml index 22f429da2a..292e4d7ad9 100644 --- a/spring-5-webflux/pom.xml +++ b/spring-5-webflux/pom.xml @@ -64,7 +64,4 @@ - - 2.2.0.RELEASE - diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml index eef4d37ff8..4803827b45 100644 --- a/spring-activiti/pom.xml +++ b/spring-activiti/pom.xml @@ -56,8 +56,6 @@ - UTF-8 - UTF-8 6.0.0 diff --git a/spring-aop/README.md b/spring-aop/README.md index 4522cd63c1..91cccbd114 100644 --- a/spring-aop/README.md +++ b/spring-aop/README.md @@ -3,9 +3,11 @@ This module contains articles about Spring aspect oriented programming (AOP) ### Relevant articles + - [Implementing a Custom Spring AOP Annotation](https://www.baeldung.com/spring-aop-annotation) - [Intro to AspectJ](https://www.baeldung.com/aspectj) - [Spring Performance Logging](https://www.baeldung.com/spring-performance-logging) - [Introduction to Spring AOP](https://www.baeldung.com/spring-aop) - [Introduction to Pointcut Expressions in Spring](https://www.baeldung.com/spring-aop-pointcut-tutorial) -- [Introduction to Advice Types in Spring](https://www.baeldung.com/spring-aop-advice-tutorial) \ No newline at end of file +- [Introduction to Advice Types in Spring](https://www.baeldung.com/spring-aop-advice-tutorial) +- [When Does Java Throw UndeclaredThrowableException?](https://www.baeldung.com/java-undeclaredthrowableexception) diff --git a/spring-aop/pom.xml b/spring-aop/pom.xml index 69de2d66fd..74b6f48b46 100644 --- a/spring-aop/pom.xml +++ b/spring-aop/pom.xml @@ -18,6 +18,11 @@ org.springframework.boot spring-boot-starter-aop + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/SomeCheckedException.java b/spring-aop/src/test/java/com/baeldung/undeclared/SomeCheckedException.java new file mode 100644 index 0000000000..bbb28681fa --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/SomeCheckedException.java @@ -0,0 +1,7 @@ +package com.baeldung.undeclared; + +public class SomeCheckedException extends Exception { + public SomeCheckedException(String message) { + super(message); + } +} diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/ThrowUndeclared.java b/spring-aop/src/test/java/com/baeldung/undeclared/ThrowUndeclared.java new file mode 100644 index 0000000000..dd6436e722 --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/ThrowUndeclared.java @@ -0,0 +1,11 @@ +package com.baeldung.undeclared; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface ThrowUndeclared { +} diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredApplication.java b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredApplication.java new file mode 100644 index 0000000000..37a0ec89b5 --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.undeclared; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class UndeclaredApplication { + + public static void main(String[] args) { + SpringApplication.run(UndeclaredApplication.class, args); + } +} diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredAspect.java b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredAspect.java new file mode 100644 index 0000000000..076fdff66c --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredAspect.java @@ -0,0 +1,16 @@ +package com.baeldung.undeclared; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.stereotype.Component; + +@Aspect +@Component +public class UndeclaredAspect { + + @Around("@annotation(undeclared)") + public Object advise(ProceedingJoinPoint pjp, ThrowUndeclared undeclared) throws Throwable { + throw new SomeCheckedException("AOP Checked Exception"); + } +} diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredService.java b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredService.java new file mode 100644 index 0000000000..6cc16c1ceb --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredService.java @@ -0,0 +1,10 @@ +package com.baeldung.undeclared; + +import org.springframework.stereotype.Service; + +@Service +public class UndeclaredService { + + @ThrowUndeclared + public void doSomething() {} +} diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java new file mode 100644 index 0000000000..e64a45d418 --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java @@ -0,0 +1,25 @@ +package com.baeldung.undeclared; + +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 java.lang.reflect.UndeclaredThrowableException; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UndeclaredApplication.class) +public class UndeclaredThrowableExceptionIntegrationTest { + + @Autowired private UndeclaredService service; + + @Test + public void givenAnAspect_whenCallingAdvisedMethod_thenShouldWrapTheException() { + assertThatThrownBy(service::doSomething) + .isInstanceOf(UndeclaredThrowableException.class) + .hasCauseInstanceOf(SomeCheckedException.class); + } +} diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java new file mode 100644 index 0000000000..464239d12d --- /dev/null +++ b/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java @@ -0,0 +1,48 @@ +package com.baeldung.undeclared; + +import org.junit.Test; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.lang.reflect.UndeclaredThrowableException; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +public class UndeclaredThrowableExceptionUnitTest { + + @Test + @SuppressWarnings("unchecked") + public void givenAProxy_whenProxyUndeclaredThrowsCheckedException_thenShouldBeWrapped() { + ClassLoader classLoader = getClass().getClassLoader(); + InvocationHandler invocationHandler = new ExceptionalInvocationHandler(); + List proxy = (List) Proxy.newProxyInstance(classLoader, new Class[] { List.class }, invocationHandler); + + assertThatThrownBy(proxy::size) + .isInstanceOf(UndeclaredThrowableException.class) + .hasCauseInstanceOf(SomeCheckedException.class); + } + + @Test + @SuppressWarnings("unchecked") + public void givenAProxy_whenProxyThrowsUncheckedException_thenShouldBeThrownAsIs() { + ClassLoader classLoader = getClass().getClassLoader(); + InvocationHandler invocationHandler = new ExceptionalInvocationHandler(); + List proxy = (List) Proxy.newProxyInstance(classLoader, new Class[] { List.class }, invocationHandler); + + assertThatThrownBy(proxy::isEmpty).isInstanceOf(RuntimeException.class); + } + + private static class ExceptionalInvocationHandler implements InvocationHandler { + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + if ("size".equals(method.getName())) { + throw new SomeCheckedException("Always fails"); + } + + throw new RuntimeException(); + } + } +} diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 14f071b5e5..84f1f0e86c 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -2,15 +2,19 @@ 4.0.0 + com.baeldung.spring-boot-modules spring-boot-modules - spring-boot-modules + 1.0.0-SNAPSHOT pom + spring-boot-modules + com.baeldung - parent-modules - 1.0.0-SNAPSHOT + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 @@ -45,6 +49,7 @@ spring-boot-kotlin spring-boot-mvc spring-boot-mvc-2 + spring-boot-mvc-3 spring-boot-mvc-birt spring-boot-nashorn spring-boot-parent @@ -60,4 +65,49 @@ spring-boot-actuator + + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + org.junit.jupiter + junit-jupiter + + + org.junit.vintage + junit-vintage-engine + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + + + 5.6.2 + 2.6 + diff --git a/spring-boot-modules/spring-boot-actuator/README.MD b/spring-boot-modules/spring-boot-actuator/README.MD index c41d52c186..fbb4dfba0f 100644 --- a/spring-boot-modules/spring-boot-actuator/README.MD +++ b/spring-boot-modules/spring-boot-actuator/README.MD @@ -6,3 +6,5 @@ This module contains articles about Spring Boot Actuator The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: + +- [Liveness and Readiness Probes in Spring Boot](https://www.baeldung.com/spring-liveness-readiness-probes) diff --git a/spring-boot-modules/spring-boot-admin/pom.xml b/spring-boot-modules/spring-boot-admin/pom.xml index f7dc98770a..6109081723 100644 --- a/spring-boot-modules/spring-boot-admin/pom.xml +++ b/spring-boot-modules/spring-boot-admin/pom.xml @@ -2,21 +2,22 @@ 4.0.0 - spring-boot-admin - 0.0.1-SNAPSHOT - spring-boot-admin - pom - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-admin + 0.0.1-SNAPSHOT + pom + + spring-boot-admin + spring-boot-admin-server spring-boot-admin-client - diff --git a/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml index 8bb8c7bac3..eb40bfe8ea 100644 --- a/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml +++ b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml @@ -2,18 +2,21 @@ 4.0.0 - spring-boot-admin-client - 0.0.1-SNAPSHOT - spring-boot-admin-client - jar - Spring Boot Admin Client - com.baeldung + com.baeldung.spring-boot-modules spring-boot-admin 0.0.1-SNAPSHOT + ../ + spring-boot-admin-client + 0.0.1-SNAPSHOT + jar + + spring-boot-admin-client + Spring Boot Admin Client + org.springframework.boot @@ -61,5 +64,4 @@ 2.2.2 2.0.4.RELEASE - diff --git a/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml index 118b270812..4c1dcdef6b 100644 --- a/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml +++ b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml @@ -2,18 +2,21 @@ 4.0.0 - spring-boot-admin-server - 0.0.1-SNAPSHOT - spring-boot-admin-server - Spring Boot Admin Server - jar - com.baeldung + com.baeldung.spring-boot-modules spring-boot-admin 0.0.1-SNAPSHOT + ../ + spring-boot-admin-server + 0.0.1-SNAPSHOT + jar + + spring-boot-admin-server + Spring Boot Admin Server + org.springframework.boot @@ -84,5 +87,4 @@ 1.5.7 2.0.4.RELEASE - diff --git a/spring-boot-modules/spring-boot-angular/pom.xml b/spring-boot-modules/spring-boot-angular/pom.xml index 5cfc530100..4b3ac27834 100644 --- a/spring-boot-modules/spring-boot-angular/pom.xml +++ b/spring-boot-modules/spring-boot-angular/pom.xml @@ -2,18 +2,20 @@ 4.0.0 + + + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + + com.baeldung.springbootangular spring-boot-angular 1.0 - spring-boot-angular jar - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - + spring-boot-angular @@ -27,7 +29,7 @@ com.h2database h2 - 1.4.197 + ${h2.version} runtime diff --git a/spring-boot-modules/spring-boot-annotations/pom.xml b/spring-boot-modules/spring-boot-annotations/pom.xml index 59de83b4e5..799692d51b 100644 --- a/spring-boot-modules/spring-boot-annotations/pom.xml +++ b/spring-boot-modules/spring-boot-annotations/pom.xml @@ -2,22 +2,24 @@ 4.0.0 - spring-boot-annotations - spring-boot-annotations - war - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-annotations + war + + spring-boot-annotations + org.aspectj aspectjweaver - 1.9.1 + ${aspectjweaver.version} diff --git a/spring-boot-modules/spring-boot-artifacts/pom.xml b/spring-boot-modules/spring-boot-artifacts/pom.xml index de9f6ab635..2704b71bd6 100644 --- a/spring-boot-modules/spring-boot-artifacts/pom.xml +++ b/spring-boot-modules/spring-boot-artifacts/pom.xml @@ -2,20 +2,21 @@ 4.0.0 - spring-boot-artifacts - spring-boot-artifacts - war - Demo project for Spring Boot - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ - + spring-boot-artifacts + war + spring-boot-artifacts + Demo project for Spring Boot + + org.springframework.boot spring-boot-starter-web diff --git a/spring-boot-modules/spring-boot-autoconfiguration/pom.xml b/spring-boot-modules/spring-boot-autoconfiguration/pom.xml index 34db784176..5709d1d796 100644 --- a/spring-boot-modules/spring-boot-autoconfiguration/pom.xml +++ b/spring-boot-modules/spring-boot-autoconfiguration/pom.xml @@ -2,19 +2,21 @@ 4.0.0 - spring-boot-autoconfiguration - 0.0.1-SNAPSHOT - spring-boot-autoconfiguration - war - This is simple boot application demonstrating a custom auto-configuration - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-autoconfiguration + 0.0.1-SNAPSHOT + war + + spring-boot-autoconfiguration + This is simple boot application demonstrating a custom auto-configuration + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-basic-customization/pom.xml b/spring-boot-modules/spring-boot-basic-customization/pom.xml index 7c2c89def4..fc34994a85 100644 --- a/spring-boot-modules/spring-boot-basic-customization/pom.xml +++ b/spring-boot-modules/spring-boot-basic-customization/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-basic-customization - spring-boot-basic-customization - jar - Module For Spring Boot Basic Customization - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-basic-customization + jar + + spring-boot-basic-customization + Module For Spring Boot Basic Customization + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-bootstrap/pom.xml b/spring-boot-modules/spring-boot-bootstrap/pom.xml index 1dc75c7e61..6a1be7a2c8 100644 --- a/spring-boot-modules/spring-boot-bootstrap/pom.xml +++ b/spring-boot-modules/spring-boot-bootstrap/pom.xml @@ -2,18 +2,20 @@ 4.0.0 - spring-boot-bootstrap - spring-boot-bootstrap - jar - Demo project for Spring Boot - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-bootstrap + jar + + spring-boot-bootstrap + Demo project for Spring Boot + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-camel/pom.xml b/spring-boot-modules/spring-boot-camel/pom.xml index 7c1e28b3ee..881b021b96 100644 --- a/spring-boot-modules/spring-boot-camel/pom.xml +++ b/spring-boot-modules/spring-boot-camel/pom.xml @@ -8,9 +8,10 @@ spring-boot-camel - com.baeldung.spring-boot-modules - spring-boot-modules - 1.0.0-SNAPSHOT + com.baeldung + parent-boot-1 + 0.0.1-SNAPSHOT + ../../parent-boot-1 diff --git a/spring-boot-modules/spring-boot-ci-cd/pom.xml b/spring-boot-modules/spring-boot-ci-cd/pom.xml index 25e45d56f3..61a2e299fb 100644 --- a/spring-boot-modules/spring-boot-ci-cd/pom.xml +++ b/spring-boot-modules/spring-boot-ci-cd/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-ci-cd - 0.0.1-SNAPSHOT - spring-boot-ci-cd - jar - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-ci-cd + 0.0.1-SNAPSHOT + jar + + spring-boot-ci-cd + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-client/pom.xml b/spring-boot-modules/spring-boot-client/pom.xml index 40a8690953..aa832497e9 100644 --- a/spring-boot-modules/spring-boot-client/pom.xml +++ b/spring-boot-modules/spring-boot-client/pom.xml @@ -2,40 +2,22 @@ 4.0.0 - spring-boot-client - 0.0.1-SNAPSHOT - spring-boot-client - war - This is simple boot client application for Spring boot actuator test - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-client + 0.0.1-SNAPSHOT + war + + spring-boot-client + This is simple boot client application for Spring boot actuator test + - - - - 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-web @@ -134,7 +116,6 @@ 18.0 - 1.2.0 2.2.4 diff --git a/spring-boot-modules/spring-boot-config-jpa-error/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/pom.xml index f578957a1a..d236a581d8 100644 --- a/spring-boot-modules/spring-boot-config-jpa-error/pom.xml +++ b/spring-boot-modules/spring-boot-config-jpa-error/pom.xml @@ -2,18 +2,19 @@ 4.0.0 + + + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + + com.baeldung.spring-boot-config-jpa-error spring-boot-config-jpa-error 0.0.1-SNAPSHOT pom - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2/pom.xml - - data-jpa-library data-jpa-application diff --git a/spring-boot-modules/spring-boot-crud/pom.xml b/spring-boot-modules/spring-boot-crud/pom.xml index 676d522f84..8ba7bab171 100644 --- a/spring-boot-modules/spring-boot-crud/pom.xml +++ b/spring-boot-modules/spring-boot-crud/pom.xml @@ -3,16 +3,18 @@ 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 - spring-boot-crud - spring-boot-crud - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-crud + + spring-boot-crud + org.springframework.boot @@ -79,8 +81,4 @@ - - UTF-8 - - diff --git a/spring-boot-modules/spring-boot-ctx-fluent/pom.xml b/spring-boot-modules/spring-boot-ctx-fluent/pom.xml index 872e15d307..cfbc6ffac0 100644 --- a/spring-boot-modules/spring-boot-ctx-fluent/pom.xml +++ b/spring-boot-modules/spring-boot-ctx-fluent/pom.xml @@ -2,18 +2,20 @@ 4.0.0 - spring-boot-ctx-fluent - 0.0.1-SNAPSHOT - spring-boot-ctx-fluent - jar - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-ctx-fluent + 0.0.1-SNAPSHOT + jar + + spring-boot-ctx-fluent + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index 8d328b88be..6291756d21 100644 --- a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -7,10 +7,10 @@ greeter-spring-boot-sample-app - com.baeldung - parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-custom-starter 0.0.1-SNAPSHOT - ../../../parent-boot-2 + ../ diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml new file mode 100644 index 0000000000..fb235bc479 --- /dev/null +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + com.baeldung.example + application + jar + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../../../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-web + + + com.baeldung.example + library + ${project.version} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/src/main/java/com/baeldung/application/EvenOddApplication.java b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/src/main/java/com/baeldung/application/EvenOddApplication.java new file mode 100644 index 0000000000..49b5b87037 --- /dev/null +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/src/main/java/com/baeldung/application/EvenOddApplication.java @@ -0,0 +1,30 @@ +package com.baeldung.application; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.library.service.EvenOddService; + +@SpringBootApplication(scanBasePackages = "com.baeldung") +@RestController +public class EvenOddApplication { + + private EvenOddService evenOddService; + + public EvenOddApplication(EvenOddService evenOddService) { + this.evenOddService = evenOddService; + } + + @GetMapping("/validate/") + public String isEvenOrOdd( + @RequestParam("number") Integer number) { + return evenOddService.isEvenOrOdd(number); + } + + public static void main(String[] args) { + SpringApplication.run(EvenOddApplication.class, args); + } +} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml new file mode 100644 index 0000000000..d979f1d9bf --- /dev/null +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + com.baeldung.example + library + jar + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../../../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter + + + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/src/main/java/com/baeldung/library/service/EvenOddService.java b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/src/main/java/com/baeldung/library/service/EvenOddService.java new file mode 100644 index 0000000000..77631943b6 --- /dev/null +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/src/main/java/com/baeldung/library/service/EvenOddService.java @@ -0,0 +1,11 @@ +package com.baeldung.library.service; + +import org.springframework.stereotype.Service; + +@Service +public class EvenOddService { + + public String isEvenOrOdd(Integer number) { + return number % 2 == 0 ? "Even" : "Odd"; + } +} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml new file mode 100644 index 0000000000..75ff927789 --- /dev/null +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.baeldung + parent-multi-module + 0.0.1-SNAPSHOT + pom + + + library + application + + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/pom.xml index 596b993f81..17f9fdc2cc 100644 --- a/spring-boot-modules/spring-boot-custom-starter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/pom.xml @@ -2,22 +2,25 @@ 4.0.0 - spring-boot-custom-starter - 0.0.1-SNAPSHOT - spring-boot-custom-starter - pom com.baeldung.spring-boot-modules spring-boot-modules 1.0.0-SNAPSHOT + ../ + spring-boot-custom-starter + 0.0.1-SNAPSHOT + pom + + spring-boot-custom-starter + greeter-library greeter-spring-boot-autoconfigure greeter-spring-boot-starter greeter-spring-boot-sample-app + parent-multi-module - \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-data/pom.xml b/spring-boot-modules/spring-boot-data/pom.xml index f25b4ee472..fe64b07379 100644 --- a/spring-boot-modules/spring-boot-data/pom.xml +++ b/spring-boot-modules/spring-boot-data/pom.xml @@ -2,18 +2,20 @@ 4.0.0 - spring-boot-data - spring-boot-data - war - Spring Boot Data Module - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-data + war + + spring-boot-data + Spring Boot Data Module + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-deployment/pom.xml b/spring-boot-modules/spring-boot-deployment/pom.xml index b3fc3eabd1..6b5e75bd62 100644 --- a/spring-boot-modules/spring-boot-deployment/pom.xml +++ b/spring-boot-modules/spring-boot-deployment/pom.xml @@ -8,14 +8,13 @@ Demo project for Spring Boot - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ - org.springframework.boot spring-boot-starter-web diff --git a/spring-boot-modules/spring-boot-di/pom.xml b/spring-boot-modules/spring-boot-di/pom.xml index b24e4a9037..87a0ad2937 100644 --- a/spring-boot-modules/spring-boot-di/pom.xml +++ b/spring-boot-modules/spring-boot-di/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-di - spring-boot-di - jar - Module For Spring Boot DI - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-di + jar + + spring-boot-di + Module For Spring Boot DI + org.aspectj diff --git a/spring-boot-modules/spring-boot-environment/pom.xml b/spring-boot-modules/spring-boot-environment/pom.xml index 138c59847d..694e17fd72 100644 --- a/spring-boot-modules/spring-boot-environment/pom.xml +++ b/spring-boot-modules/spring-boot-environment/pom.xml @@ -2,20 +2,21 @@ 4.0.0 - spring-boot-environment - spring-boot-environment - war - Demo project for Spring Boot - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ - + spring-boot-environment + war + spring-boot-environment + Demo project for Spring Boot + + org.springframework.boot spring-boot-starter-web diff --git a/spring-boot-modules/spring-boot-exceptions/pom.xml b/spring-boot-modules/spring-boot-exceptions/pom.xml index f69beccf5d..4b9d787b61 100644 --- a/spring-boot-modules/spring-boot-exceptions/pom.xml +++ b/spring-boot-modules/spring-boot-exceptions/pom.xml @@ -2,23 +2,25 @@ 4.0.0 - spring-boot-exceptions - spring-boot-exceptions - jar - Demo project for working with Spring Boot exceptions - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-exceptions + jar + + spring-boot-exceptions + Demo project for working with Spring Boot exceptions + org.springframework.boot spring-boot-starter - 2.2.3.RELEASE + ${spring-boot.version} @@ -92,5 +94,6 @@ com.baeldung.intro.App + 2.2.3.RELEASE diff --git a/spring-boot-modules/spring-boot-flowable/pom.xml b/spring-boot-modules/spring-boot-flowable/pom.xml index 7d9fb97cba..f1121ea6a0 100644 --- a/spring-boot-modules/spring-boot-flowable/pom.xml +++ b/spring-boot-modules/spring-boot-flowable/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-flowable - spring-boot-flowable - war - Spring Boot Flowable Module - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-flowable + war + + spring-boot-flowable + Spring Boot Flowable Module + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-jasypt/pom.xml b/spring-boot-modules/spring-boot-jasypt/pom.xml index e63a02729f..2f0c8a27b4 100644 --- a/spring-boot-modules/spring-boot-jasypt/pom.xml +++ b/spring-boot-modules/spring-boot-jasypt/pom.xml @@ -2,19 +2,21 @@ 4.0.0 - com.example.jasypt - spring-boot-jasypt - spring-boot-jasypt - jar - Demo project for Spring Boot - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + com.example.jasypt + spring-boot-jasypt + jar + + spring-boot-jasypt + Demo project for Spring Boot + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-keycloak/pom.xml b/spring-boot-modules/spring-boot-keycloak/pom.xml index 68d4ec4b8f..5049cc3651 100644 --- a/spring-boot-modules/spring-boot-keycloak/pom.xml +++ b/spring-boot-modules/spring-boot-keycloak/pom.xml @@ -76,7 +76,7 @@ - 10.0.1 + 10.0.2 diff --git a/spring-boot-modules/spring-boot-keycloak/src/main/resources/application.properties b/spring-boot-modules/spring-boot-keycloak/src/main/resources/application.properties index 6e7da2cb90..9dfd3ea720 100644 --- a/spring-boot-modules/spring-boot-keycloak/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-keycloak/src/main/resources/application.properties @@ -6,4 +6,6 @@ keycloak.auth-server-url=http://localhost:8180/auth keycloak.realm=SpringBootKeycloak keycloak.resource=login-app keycloak.public-client=true +#keycloak.security-constraints[0].authRoles[0]=user +#keycloak.security-constraints[0].securityCollections[0].patterns[0]=/customers/* keycloak.principal-attribute=preferred_username \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-keycloak/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-keycloak/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-modules/spring-boot-keycloak/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-keycloak/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-boot-modules/spring-boot-libraries/README.md b/spring-boot-modules/spring-boot-libraries/README.md index c02fb69e5d..8cd3db9c93 100644 --- a/spring-boot-modules/spring-boot-libraries/README.md +++ b/spring-boot-modules/spring-boot-libraries/README.md @@ -10,3 +10,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Guide to ShedLock with Spring](https://www.baeldung.com/shedlock-spring) - [A Guide to the Problem Spring Web Library](https://www.baeldung.com/problem-spring-web) - [Generating Barcodes and QR Codes in Java](https://www.baeldung.com/java-generating-barcodes-qr-codes) +- [Rate Limiting a Spring API Using Bucket4j](https://www.baeldung.com/spring-bucket4j) +- [Spring Boot and Caffeine Cache](https://www.baeldung.com/spring-boot-caffeine-cache) diff --git a/spring-boot-modules/spring-boot-libraries/pom.xml b/spring-boot-modules/spring-boot-libraries/pom.xml index 189eb4cf1a..05ab59aab7 100644 --- a/spring-boot-modules/spring-boot-libraries/pom.xml +++ b/spring-boot-modules/spring-boot-libraries/pom.xml @@ -9,10 +9,10 @@ This is simple boot application for Spring boot actuator test - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/AddressController.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/AddressController.java new file mode 100644 index 0000000000..1a48092451 --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/AddressController.java @@ -0,0 +1,24 @@ +package com.baeldung.caffeine; + +import org.springframework.beans.factory.annotation.Autowired; +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.RestController; + +@RestController +public class AddressController +{ + @Autowired + private AddressService addressService; + + @GetMapping("/address/{id}") + public ResponseEntity getAddress(@PathVariable("id") long customerId) { + return ResponseEntity.ok(addressService.getAddress(customerId)); + } + + @GetMapping("/address2/{id}") + public ResponseEntity getAddress2(@PathVariable("id") long customerId) { + return ResponseEntity.ok(addressService.getAddress2(customerId)); + } +} diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/AddressService.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/AddressService.java new file mode 100644 index 0000000000..595e7f410a --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/AddressService.java @@ -0,0 +1,41 @@ +package com.baeldung.caffeine; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +/** + * Service that uses caching. + */ +@Service +public class AddressService +{ + private final static Logger LOG = LoggerFactory.getLogger(AddressService.class); + + @Autowired + private CacheManager cacheManager; + + @Cacheable(cacheNames = "addresses") + public String getAddress(long customerId) { + LOG.info("Method getAddress is invoked for customer {}", customerId); + + return "123 Main St"; + } + + public String getAddress2(long customerId) { + if(cacheManager.getCache("addresses2").get(customerId) != null) { + return cacheManager.getCache("addresses2").get(customerId).get().toString(); + } + + LOG.info("Method getAddress2 is invoked for customer {}", customerId); + + String address = "123 Main St"; + + cacheManager.getCache("addresses2").put(customerId, address); + + return address; + } +} diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/CaffeineConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/CaffeineConfiguration.java new file mode 100644 index 0000000000..575ae4a720 --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/CaffeineConfiguration.java @@ -0,0 +1,28 @@ +package com.baeldung.caffeine; + +import com.github.benmanes.caffeine.cache.Caffeine; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.caffeine.CaffeineCacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.concurrent.TimeUnit; + +@EnableCaching +@Configuration +public class CaffeineConfiguration { + @Bean + public Caffeine caffeineConfig() { + return Caffeine.newBuilder() + .expireAfterWrite(60, TimeUnit.MINUTES); + } + + @Bean + public CacheManager cacheManager(Caffeine caffeine) { + CaffeineCacheManager caffeineCacheManager = new CaffeineCacheManager(); + caffeineCacheManager.getCache("addresses"); + caffeineCacheManager.setCaffeine(caffeine); + return caffeineCacheManager; + } +} diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/CaffieneTutorialApp.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/CaffieneTutorialApp.java new file mode 100644 index 0000000000..3828e48fee --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/CaffieneTutorialApp.java @@ -0,0 +1,11 @@ +package com.baeldung.caffeine; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; + +@SpringBootApplication +public class CaffieneTutorialApp { + public static void main(String[] args) { + new SpringApplicationBuilder(CaffieneTutorialApp.class).run(args); + } +} diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/SecurityConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/SecurityConfiguration.java new file mode 100644 index 0000000000..7f3ad7988f --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/caffeine/SecurityConfiguration.java @@ -0,0 +1,24 @@ +package com.baeldung.caffeine; + +import org.springframework.context.annotation.Configuration; +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; + +/** + * Because the POM imports Spring Security, we need a simple security + * configuration for this example application to allow all HTTP requests. + */ +@Configuration +@EnableWebSecurity +public class SecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.csrf().disable(); + + http.authorizeRequests() + .antMatchers("/**") + .permitAll(); + } +} diff --git a/spring-boot-modules/spring-boot-mvc-2/pom.xml b/spring-boot-modules/spring-boot-mvc-2/pom.xml index 45202d1e4c..73a75f020c 100644 --- a/spring-boot-modules/spring-boot-mvc-2/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-2/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-mvc-2 - spring-boot-mvc-2 - jar - Module For Spring Boot MVC Web Fn - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-mvc-2 + jar + + spring-boot-mvc-2 + Module For Spring Boot MVC Web Fn + org.springframework.boot @@ -99,8 +101,7 @@ 3.0.0-SNAPSHOT com.baeldung.swagger2boot.SpringBootSwaggerApplication - 2.2.6.RELEASE - 1.4.11.1 + 1.4.11.1 \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-3/README.md b/spring-boot-modules/spring-boot-mvc-3/README.md index c220c6c405..58a3008966 100644 --- a/spring-boot-modules/spring-boot-mvc-3/README.md +++ b/spring-boot-modules/spring-boot-mvc-3/README.md @@ -4,4 +4,5 @@ This module contains articles about Spring Web MVC in Spring Boot projects. ### Relevant Articles: -- More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) \ No newline at end of file +- [Circular View Path Error](https://www.baeldung.com/spring-circular-view-path-error) +- More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) diff --git a/spring-boot-modules/spring-boot-mvc-3/pom.xml b/spring-boot-modules/spring-boot-mvc-3/pom.xml index 64e8a99c6c..71b7383ef4 100644 --- a/spring-boot-modules/spring-boot-mvc-3/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-3/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-mvc-3 - spring-boot-mvc-3 - jar - Module For Spring Boot MVC Web - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-mvc-3 + jar + + spring-boot-mvc-3 + Module For Spring Boot MVC Web + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-mvc-birt/pom.xml b/spring-boot-modules/spring-boot-mvc-birt/pom.xml index 0e8e231a84..0ab744bb26 100644 --- a/spring-boot-modules/spring-boot-mvc-birt/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-birt/pom.xml @@ -3,19 +3,21 @@ 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 - spring-boot-mvc-birt - 0.0.1-SNAPSHOT - spring-boot-mvc-birt - jar - Module For Spring Boot Integration with BIRT - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-mvc-birt + 0.0.1-SNAPSHOT + jar + + spring-boot-mvc-birt + Module For Spring Boot Integration with BIRT + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-mvc/pom.xml b/spring-boot-modules/spring-boot-mvc/pom.xml index 6a951ace93..fd6f1b0a8a 100644 --- a/spring-boot-modules/spring-boot-mvc/pom.xml +++ b/spring-boot-modules/spring-boot-mvc/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-mvc - spring-boot-mvc - jar - Module For Spring Boot MVC - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ - + + spring-boot-mvc + jar + + spring-boot-mvc + Module For Spring Boot MVC + @@ -122,12 +124,12 @@ org.aspectj aspectjrt - 1.9.1 + ${aspectjweaver.version} org.aspectj aspectjweaver - 1.9.1 + ${aspectjweaver.version} diff --git a/spring-boot-modules/spring-boot-nashorn/pom.xml b/spring-boot-modules/spring-boot-nashorn/pom.xml index c60997005d..ca0b726a47 100644 --- a/spring-boot-modules/spring-boot-nashorn/pom.xml +++ b/spring-boot-modules/spring-boot-nashorn/pom.xml @@ -3,18 +3,20 @@ 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-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + + com.baeldung.nashorn spring-boot-nashorn 1.0 - spring-boot-nashorn jar - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - + spring-boot-nashorn diff --git a/spring-boot-modules/spring-boot-parent/pom.xml b/spring-boot-modules/spring-boot-parent/pom.xml index cf0a6702ea..ebd3cd5d36 100644 --- a/spring-boot-modules/spring-boot-parent/pom.xml +++ b/spring-boot-modules/spring-boot-parent/pom.xml @@ -3,21 +3,23 @@ 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 - spring-boot-parent - 1.0.0-SNAPSHOT - spring-boot-parent - pom - spring-boot-parent com.baeldung.spring-boot-modules spring-boot-modules 1.0.0-SNAPSHOT + ../ + spring-boot-parent + 1.0.0-SNAPSHOT + pom + + spring-boot-parent + spring-boot-parent + spring-boot-with-starter-parent spring-boot-with-custom-parent - diff --git a/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml b/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml index d08384e34c..5f5d3a9f6a 100644 --- a/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml +++ b/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml @@ -3,17 +3,19 @@ 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 - spring-boot-with-custom-parent - 1.0.0-SNAPSHOT - spring-boot-with-custom-parent - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-parent + 1.0.0-SNAPSHOT + ../ + spring-boot-with-custom-parent + 1.0.0-SNAPSHOT + + spring-boot-with-custom-parent + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml b/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml index 331a85ec5b..108e66b68e 100644 --- a/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml +++ b/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml @@ -3,17 +3,19 @@ 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-boot-modules + spring-boot-parent + 1.0.0-SNAPSHOT + ../ + + com.baeldung spring-boot-with-starter-parent 1.0.0-SNAPSHOT - spring-boot-with-starter-parent - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../../parent-boot-2 - + spring-boot-with-starter-parent @@ -39,7 +41,5 @@ 1.8 2.2.5.RELEASE - 4.11 - diff --git a/spring-boot-modules/spring-boot-performance/pom.xml b/spring-boot-modules/spring-boot-performance/pom.xml index 1f3eafd96c..053f68eea3 100644 --- a/spring-boot-modules/spring-boot-performance/pom.xml +++ b/spring-boot-modules/spring-boot-performance/pom.xml @@ -2,18 +2,20 @@ 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 - spring-boot-performance - spring-boot-performance - war - This is a simple Spring Boot application taking advantage of the latest Spring Boot improvements/features. Current version: 2.2 - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-performance + war + + spring-boot-performance + This is a simple Spring Boot application taking advantage of the latest Spring Boot improvements/features. Current version: 2.2 + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-properties-2/README.md b/spring-boot-modules/spring-boot-properties-2/README.md index 1874fa74a5..c81ad50e40 100644 --- a/spring-boot-modules/spring-boot-properties-2/README.md +++ b/spring-boot-modules/spring-boot-properties-2/README.md @@ -8,4 +8,7 @@ This module contains articles about Properties in Spring Boot. - [Using Spring @Value with Defaults](https://www.baeldung.com/spring-value-defaults) - [How to Inject a Property Value Into a Class Not Managed by Spring?](https://www.baeldung.com/inject-properties-value-non-spring-class) - [@PropertySource with YAML Files in Spring Boot](https://www.baeldung.com/spring-yaml-propertysource) +- [Inject Arrays and Lists From Spring Properties Files](https://www.baeldung.com/spring-inject-arrays-lists) +- [Inject a Map from a YAML File with Spring](https://www.baeldung.com/spring-yaml-inject-map) +- [YAML to List of Objects in Spring Boot](https://www.baeldung.com/spring-boot-yaml-list) - More articles: [[<-- prev]](../spring-boot-properties) diff --git a/spring-boot-modules/spring-boot-properties-2/pom.xml b/spring-boot-modules/spring-boot-properties-2/pom.xml index bd2a35b19d..e777b8f318 100644 --- a/spring-boot-modules/spring-boot-properties-2/pom.xml +++ b/spring-boot-modules/spring-boot-properties-2/pom.xml @@ -2,19 +2,21 @@ 4.0.0 - spring-boot-properties-2 - spring-boot-properties-2 - jar - Spring Boot Properties Module - 0.0.1-SNAPSHOT - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-properties-2 + jar + 0.0.1-SNAPSHOT + + spring-boot-properties-2 + Spring Boot Properties Module + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamllist/YamlListApplication.java b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamllist/YamlListApplication.java new file mode 100644 index 0000000000..c8fa1af22e --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamllist/YamlListApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.properties.yamllist; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class YamlListApplication { + + public static void main(String[] args) { + SpringApplication.run(YamlListApplication.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamllist/pojo/ApplicationProps.java b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamllist/pojo/ApplicationProps.java new file mode 100644 index 0000000000..f05e3cbbff --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamllist/pojo/ApplicationProps.java @@ -0,0 +1,72 @@ +package com.baeldung.properties.yamllist.pojo; + +import java.util.List; +import java.util.Map; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "application") +public class ApplicationProps { + + private List profiles; + private List> props; + private List users; + + public List getProfiles() { + return profiles; + } + + public void setProfiles(List profiles) { + this.profiles = profiles; + } + + public List> getProps() { + return props; + } + + public void setProps(List> props) { + this.props = props; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public static class User { + + private String username; + private String password; + private List roles; + + 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 List getRoles() { + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + } +} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamlmap/MapFromYaml.java b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamlmap/MapFromYaml.java new file mode 100644 index 0000000000..93526c4a9f --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamlmap/MapFromYaml.java @@ -0,0 +1,13 @@ +package com.baeldung.properties.yamlmap; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MapFromYaml { + + public static void main(String[] args) { + SpringApplication.run(MapFromYaml.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamlmap/pojo/ServerProperties.java b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamlmap/pojo/ServerProperties.java new file mode 100644 index 0000000000..9d54daf070 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/main/java/com/baeldung/properties/yamlmap/pojo/ServerProperties.java @@ -0,0 +1,62 @@ +package com.baeldung.properties.yamlmap.pojo; + +import java.util.List; +import java.util.Map; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "server") +public class ServerProperties { + + private Map application; + private Map> config; + private Map users; + + public Map getApplication() { + return application; + } + + public void setApplication(Map application) { + this.application = application; + } + + public Map> getConfig() { + return config; + } + + public void setConfig(Map> config) { + this.config = config; + } + + public Map getUsers() { + return users; + } + + public void setUsers(Map users) { + this.users = users; + } + + public static class Credential { + + private String username; + private String password; + + 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; + } + } +} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-properties-2/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties-2/src/main/resources/application.yml new file mode 100644 index 0000000000..b1ea0a859b --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/main/resources/application.yml @@ -0,0 +1,55 @@ +server: + application: + name: InjectMapFromYAML + url: http://injectmapfromyaml.dev + description: How To Inject a map from a YAML File in Spring Boot + config: + ips: + - 10.10.10.10 + - 10.10.10.11 + - 10.10.10.12 + - 10.10.10.13 + filesystem: + - /dev/root + - /dev/md2 + - /dev/md4 + users: + root: + username: root + password: rootpass + guest: + username: guest + password: guestpass +--- +application: + profiles: + - dev + - test + - prod + - 1 + - 2 + props: + - + name: YamlList + url: http://yamllist.dev + description: Mapping list in Yaml to list of objects in Spring Boot + - + ip: 10.10.10.10 + port: 8091 + - + email: support@yamllist.dev + contact: http://yamllist.dev/contact + users: + - + username: admin + password: admin@10@ + roles: + - READ + - WRITE + - VIEW + - DELETE + - + username: guest + password: guest@01 + roles: + - VIEW \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsUnitTest.java b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsUnitTest.java new file mode 100644 index 0000000000..6dc5d61d09 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsUnitTest.java @@ -0,0 +1,37 @@ +package com.baeldung.properties.yamllist; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import com.baeldung.properties.yamllist.pojo.ApplicationProps; + +@ExtendWith(SpringExtension.class) +@ContextConfiguration(initializers = ConfigFileApplicationContextInitializer.class) +@EnableConfigurationProperties(value = ApplicationProps.class) +class YamlComplexListsUnitTest { + + @Autowired + private ApplicationProps applicationProps; + + @Test + public void whenYamlNestedLists_thenLoadComplexLists() { + assertThat(applicationProps.getUsers() + .get(0) + .getPassword()).isEqualTo("admin@10@"); + assertThat(applicationProps.getProps() + .get(0) + .get("name")).isEqualTo("YamlList"); + assertThat(applicationProps.getProps() + .get(1) + .get("port") + .getClass()).isEqualTo(Integer.class); + } + +} diff --git a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListUnitTest.java b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListUnitTest.java new file mode 100644 index 0000000000..475a73c7d7 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.properties.yamllist; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import com.baeldung.properties.yamllist.pojo.ApplicationProps; + +@ExtendWith(SpringExtension.class) +@ContextConfiguration(initializers = ConfigFileApplicationContextInitializer.class) +@EnableConfigurationProperties(value = ApplicationProps.class) +class YamlSimpleListUnitTest { + + @Autowired + private ApplicationProps applicationProps; + + @Test + public void whenYamlList_thenLoadSimpleList() { + assertThat(applicationProps.getProfiles() + .get(0)).isEqualTo("dev"); + assertThat(applicationProps.getProfiles() + .get(4) + .getClass()).isEqualTo(Integer.class); + assertThat(applicationProps.getProfiles() + .size()).isEqualTo(5); + } +} diff --git a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamlmap/MapFromYamlIntegrationTest.java b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamlmap/MapFromYamlIntegrationTest.java new file mode 100644 index 0000000000..b193e30417 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamlmap/MapFromYamlIntegrationTest.java @@ -0,0 +1,43 @@ +package com.baeldung.properties.yamlmap; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.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.properties.yamlmap.pojo.ServerProperties; + +@RunWith(SpringRunner.class) +@SpringBootTest +class MapFromYamlIntegrationTest { + + @Autowired + private ServerProperties serverProperties; + + @Test + public void whenYamlFileProvidedThenInjectSimpleMap() { + + assertThat(serverProperties.getApplication()).containsOnlyKeys("name", "url", "description"); + + assertThat(serverProperties.getApplication() + .get("name")).isEqualTo("InjectMapFromYAML"); + } + + @Test + public void whenYamlFileProvidedThenInjectComplexMap() { + + assertThat(serverProperties.getConfig()).hasSize(2); + + assertThat(serverProperties.getConfig() + .get("ips") + .get(0)).isEqualTo("10.10.10.10"); + + assertThat(serverProperties.getUsers() + .get("root") + .getUsername()).isEqualTo("root"); + } + +} diff --git a/spring-boot-modules/spring-boot-properties/README.md b/spring-boot-modules/spring-boot-properties/README.md index b6685c7587..db96c63b29 100644 --- a/spring-boot-modules/spring-boot-properties/README.md +++ b/spring-boot-modules/spring-boot-properties/README.md @@ -10,4 +10,5 @@ This module contains articles about Properties in Spring Boot. - [Spring YAML Configuration](https://www.baeldung.com/spring-yaml) - [Add Build Properties to a Spring Boot Application](https://www.baeldung.com/spring-boot-build-properties) - [IntelliJ – Cannot Resolve Spring Boot Configuration Properties Error](https://www.baeldung.com/intellij-resolve-spring-boot-configuration-properties) -- More articles: [[more -->]](../spring-boot-properties-2) \ No newline at end of file +- [Spring YAML vs Properties](https://www.baeldung.com/spring-yaml-vs-properties) +- More articles: [[more -->]](../spring-boot-properties-2) diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml index 98d328bd19..a5594ee2de 100644 --- a/spring-boot-modules/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -2,19 +2,21 @@ 4.0.0 - spring-boot-properties - spring-boot-properties - jar - Spring Boot Properties Module - 0.0.1-SNAPSHOT - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-properties + jar + 0.0.1-SNAPSHOT + + spring-boot-properties + Spring Boot Properties Module + commons-configuration diff --git a/spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml index 2f1c9c2add..77629ffdd1 100644 --- a/spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml @@ -7,9 +7,10 @@ - com.baeldung + com.baeldung.spring-boot-modules spring-boot-runtime - 0.0.1-SNAPSHOT + 1.0.0-SNAPSHOT + ../ diff --git a/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml index 35f54999ec..fd57eccbbf 100644 --- a/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml @@ -7,9 +7,10 @@ - com.baeldung + com.baeldung.spring-boot-modules spring-boot-runtime - 0.0.1-SNAPSHOT + 1.0.0-SNAPSHOT + ../ diff --git a/spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml index c96dfb6a2f..8cb0e24bb7 100644 --- a/spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml @@ -7,9 +7,10 @@ disabling-console-logback - com.baeldung + com.baeldung.spring-boot-modules spring-boot-runtime - 0.0.1-SNAPSHOT + 1.0.0-SNAPSHOT + ../ diff --git a/spring-boot-modules/spring-boot-runtime/pom.xml b/spring-boot-modules/spring-boot-runtime/pom.xml index df45537940..d3966beb65 100644 --- a/spring-boot-modules/spring-boot-runtime/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/pom.xml @@ -2,18 +2,20 @@ 4.0.0 - spring-boot-runtime - spring-boot-runtime - pom - Demo project for Spring Boot - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-runtime + pom + + spring-boot-runtime + Demo project for Spring Boot + disabling-console-jul disabling-console-log4j2 @@ -42,7 +44,7 @@ commons-io commons-io - 2.6 + ${commons-io.version} diff --git a/spring-boot-modules/spring-boot-security/pom.xml b/spring-boot-modules/spring-boot-security/pom.xml index 98eceaff96..33b7cbfd74 100644 --- a/spring-boot-modules/spring-boot-security/pom.xml +++ b/spring-boot-modules/spring-boot-security/pom.xml @@ -2,18 +2,20 @@ 4.0.0 - spring-boot-security - spring-boot-security - Spring Boot Security Auto-Configuration - jar - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-security + jar + + spring-boot-security + Spring Boot Security Auto-Configuration + org.springframework.boot @@ -22,17 +24,17 @@ org.springframework.security.oauth spring-security-oauth2 - 2.4.0.RELEASE + ${spring-security-oauth2.version} commons-io commons-io - 2.6 + ${commons-io.version} org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure - 2.2.2.RELEASE + ${spring-security-oauth2-autoconfigure.version} org.springframework.boot @@ -84,6 +86,8 @@ com.baeldung.springbootsecurity.basic_auth.SpringBootSecurityApplication + 2.4.0.RELEASE + 2.2.2.RELEASE diff --git a/spring-boot-modules/spring-boot-springdoc/pom.xml b/spring-boot-modules/spring-boot-springdoc/pom.xml index 4bede8c796..3e8d5175f7 100644 --- a/spring-boot-modules/spring-boot-springdoc/pom.xml +++ b/spring-boot-modules/spring-boot-springdoc/pom.xml @@ -4,19 +4,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-springdoc - 0.0.1-SNAPSHOT - spring-boot-springdoc - jar - Project for Springdoc integration - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-springdoc + 0.0.1-SNAPSHOT + jar + + spring-boot-springdoc + Project for Springdoc integration + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-testing/pom.xml b/spring-boot-modules/spring-boot-testing/pom.xml index 8353f9de61..a3b176af88 100644 --- a/spring-boot-modules/spring-boot-testing/pom.xml +++ b/spring-boot-modules/spring-boot-testing/pom.xml @@ -3,18 +3,20 @@ 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 - spring-boot-testing - spring-boot-testing - war - This is simple boot application for demonstrating testing features. - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-testing + war + + spring-boot-testing + This is simple boot application for demonstrating testing features. + org.springframework.boot diff --git a/spring-boot-modules/spring-boot-vue/pom.xml b/spring-boot-modules/spring-boot-vue/pom.xml index 0a6307e46b..9973246115 100644 --- a/spring-boot-modules/spring-boot-vue/pom.xml +++ b/spring-boot-modules/spring-boot-vue/pom.xml @@ -2,19 +2,21 @@ 4.0.0 - spring-boot-vue - 0.0.1-SNAPSHOT - spring-boot-vue - jar - Demo project for Spring Boot Vue project - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot-vue + 0.0.1-SNAPSHOT + jar + + spring-boot-vue + Demo project for Spring Boot Vue project + org.springframework.boot @@ -43,9 +45,4 @@ - - UTF-8 - UTF-8 - - diff --git a/spring-boot-modules/spring-boot/pom.xml b/spring-boot-modules/spring-boot/pom.xml index e0ff9ae2f9..e1299a6a16 100644 --- a/spring-boot-modules/spring-boot/pom.xml +++ b/spring-boot-modules/spring-boot/pom.xml @@ -3,40 +3,22 @@ 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 - spring-boot - spring-boot - war - This is simple boot application for Spring boot actuator test - 0.0.1-SNAPSHOT - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + spring-boot + 0.0.1-SNAPSHOT + war + + spring-boot + This is simple boot application for Spring boot actuator test + - - - - 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-thymeleaf diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml index 43772505a4..f4557335d6 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml @@ -60,8 +60,6 @@ - UTF-8 - UTF-8 Hoxton.SR4 diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml index f0d18a1c4f..81f194c772 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml @@ -52,8 +52,6 @@ - UTF-8 - UTF-8 Hoxton.SR4 diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index 6fddb1693f..0e2cac1ff9 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -10,9 +10,9 @@ com.baeldung - parent-modules - 1.0.0-SNAPSHOT - .. + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 @@ -56,17 +56,15 @@ - 1.2.2.RELEASE - Brixton.SR7 - 1.2.2.RELEASE - 1.2.2.RELEASE - 2.0.2.RELEASE - 1.4.6.RELEASE - 1.2.3.RELEASE - 1.3.0.RELEASE - 1.4.2.RELEASE - 1.4.2.RELEASE - 1.2.3.RELEASE + Hoxton.SR4 + 2.2.3.RELEASE + 2.2.3.RELEASE + 1.4.7.RELEASE + 1.4.7.RELEASE + 1.4.7.RELEASE + 3.0.6.RELEASE + 2.3.1.RELEASE + 2.3.1.RELEASE diff --git a/spring-cloud/spring-cloud-bootstrap/README.md b/spring-cloud/spring-cloud-bootstrap/README.md index 01998ccf51..6923e951ff 100644 --- a/spring-cloud/spring-cloud-bootstrap/README.md +++ b/spring-cloud/spring-cloud-bootstrap/README.md @@ -3,14 +3,17 @@ This module contains articles about bootstrapping Spring Cloud applications ### Relevant Articles: + - [Spring Cloud – Bootstrapping](http://www.baeldung.com/spring-cloud-bootstrapping) - [Spring Cloud – Securing Services](http://www.baeldung.com/spring-cloud-securing-services) - [Spring Cloud – Tracing Services with Zipkin](http://www.baeldung.com/tracing-services-with-zipkin) - [Spring Cloud Series – The Gateway Pattern](http://www.baeldung.com/spring-cloud-gateway-pattern) - [Spring Cloud – Adding Angular 4](http://www.baeldung.com/spring-cloud-angular) +- [How to Share DTO Across Microservices](https://www.baeldung.com/java-microservices-share-dto) ### Running the Project +- First, you need a redis server running on the default port - To run the project: - copy the appliction-config folder to c:\Users\{username}\ on Windows or /home/{username}/ on *nix. Then open a git bash terminal in application-config and run: - git init diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml new file mode 100644 index 0000000000..8fcf4adadb --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml @@ -0,0 +1,82 @@ + + + + 4.0.0 + com.baeldung.customerservice + customer-service + 1.0.0-SNAPSHOT + customer-service + jar + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../../parent-boot-2 + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-json + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-configuration-processor + + + org.projectlombok + lombok + true + + + com.baeldung.orderservice + order-client + 1.0.0-SNAPSHOT + compile + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + exec + + + + + + + + + + 1.8 + 1.8 + + diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/Customer.java b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/Customer.java new file mode 100644 index 0000000000..7d10510cbc --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/Customer.java @@ -0,0 +1,14 @@ +package com.baeldung.customerservice; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Customer { + + private int id; + private String firstName; + private String lastName; + +} \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/CustomerApplication.java b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/CustomerApplication.java new file mode 100644 index 0000000000..489129a3d2 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/CustomerApplication.java @@ -0,0 +1,25 @@ +package com.baeldung.customerservice; + +import com.baeldung.orderservice.client.OrderClient; +import com.baeldung.orderservice.client.OrderClientImpl; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; + +/** + * Spring Boot application starter class + */ +@SpringBootApplication +public class CustomerApplication { + public static void main(String[] args) { + SpringApplication.run(CustomerApplication.class, args); + } + + @Bean + public OrderClient getOrderClient() { + + return new OrderClientImpl(new RestTemplateBuilder()); + } + +} diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/CustomerService.java b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/CustomerService.java new file mode 100644 index 0000000000..ab8872de1c --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/java/com/baeldung/customerservice/CustomerService.java @@ -0,0 +1,56 @@ +package com.baeldung.customerservice; + +import com.baeldung.orderservice.client.OrderClient; +import com.baeldung.orderservice.client.OrderDTO; +import com.baeldung.orderservice.client.OrderResponse; +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.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +@RestController +public class CustomerService { + + @Autowired + private OrderClient orderClient; + + private List customers = Arrays.asList( + + new Customer(1, "John", "Smith"), + new Customer(2, "Deny", "Dominic")); + + + @GetMapping + public List getAllCustomers() { + return customers; + } + + @GetMapping("/{id}") + public Customer getCustomerById(@PathVariable int id) { + return customers.stream() + .filter(customer -> customer.getId() == id) + .findFirst() + .orElseThrow(IllegalArgumentException::new); + } + + + @PostMapping(value = "/order") + public String sendOrder(@RequestBody Map body) { + + OrderDTO dto = new OrderDTO(); + dto.setCustomerId((Integer) body.get("customerId")); + dto.setItemId((String) body.get("itemId")); + + OrderResponse response = orderClient.order(dto); + + return response.getStatus(); + } + +} \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/resources/application.properties b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/resources/application.properties new file mode 100644 index 0000000000..d439ae9b76 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/src/main/resources/application.properties @@ -0,0 +1,4 @@ +#Spring Boot server configuration +server.servlet.context-path=/customer-service +server.port=8001 + diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/src/test/resources/application.properties b/spring-cloud/spring-cloud-bootstrap/customer-service/src/test/resources/application.properties new file mode 100644 index 0000000000..1d50559005 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/src/test/resources/application.properties @@ -0,0 +1,2 @@ +local.server.port=8001 +server.servlet.context-path=/customer-service \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml new file mode 100644 index 0000000000..4c8cf742b1 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + com.baeldung.orderservice + order-client + 1.0.0-SNAPSHOT + order-client + Order service client module + http://projects.spring.io/spring-boot/ + + + com.baeldung.orderservice + order-service + 1.0.0-SNAPSHOT + + + diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClient.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClient.java new file mode 100644 index 0000000000..2dd6b13248 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClient.java @@ -0,0 +1,6 @@ +package com.baeldung.orderservice.client; + +public interface OrderClient { + + OrderResponse order(OrderDTO orderDTO); +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClientImpl.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClientImpl.java new file mode 100644 index 0000000000..70ec77fab6 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderClientImpl.java @@ -0,0 +1,35 @@ +package com.baeldung.orderservice.client; + +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + + +@Component +public class OrderClientImpl implements OrderClient { + + private RestTemplate restTemplate; + + public OrderClientImpl(RestTemplateBuilder builder) { + + this.restTemplate = builder.build(); + } + + @Override + public OrderResponse order(OrderDTO orderDTO) { + + String serviceUrl = "http://localhost:8002/order-service"; + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + HttpEntity request = new HttpEntity<>(orderDTO, headers); + + OrderResponse orderResponse = restTemplate.postForObject(serviceUrl + "/create", request, OrderResponse.class); + + return orderResponse; + + } +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderDTO.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderDTO.java new file mode 100644 index 0000000000..c31c9f6bec --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderDTO.java @@ -0,0 +1,16 @@ +package com.baeldung.orderservice.client; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OrderDTO { + + private int customerId; + private String itemId; + +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderResponse.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderResponse.java new file mode 100644 index 0000000000..e8d2059cbb --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/java/com/baeldung/orderservice/client/OrderResponse.java @@ -0,0 +1,15 @@ +package com.baeldung.orderservice.client; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OrderResponse { + + private int orderId; + private String productId; + private String status; +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/resources/application.properties b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/resources/application.properties new file mode 100644 index 0000000000..53e503689f --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/src/main/resources/application.properties @@ -0,0 +1 @@ +server.port=8002 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml new file mode 100644 index 0000000000..d6c521c5df --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + com.baeldung.orderservice + order-server + 1.0.0-SNAPSHOT + + order-service + com.baeldung.orderservice + 1.0.0-SNAPSHOT + + + + com.baeldung.orderservice + order-client + 1.0.0-SNAPSHOT + compile + + + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/Order.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/Order.java new file mode 100644 index 0000000000..719305064f --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/Order.java @@ -0,0 +1,18 @@ +package com.baeldung.orderservice; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Order { + + private Integer id; + private Integer customerId; + private String itemId; + private String date; + +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderApplication.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderApplication.java new file mode 100644 index 0000000000..eb89959ee0 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderApplication.java @@ -0,0 +1,17 @@ +package com.baeldung.orderservice; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; + +/** + * Spring Boot application starter class + */ +@SpringBootApplication +public class OrderApplication { + public static void main(String[] args) { + SpringApplication.run(OrderApplication.class, args); + } + +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderService.java b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderService.java new file mode 100644 index 0000000000..a43bbcec65 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/java/com/baeldung/orderservice/OrderService.java @@ -0,0 +1,54 @@ +package com.baeldung.orderservice; + +import com.baeldung.orderservice.client.OrderDTO; +import com.baeldung.orderservice.client.OrderResponse; +import org.apache.commons.lang.time.DateFormatUtils; +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.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@RestController +public class OrderService { + + + private List orders = Arrays.asList( + + new Order(1, 1, "A101", "2020/02/14"), + new Order(2, 1, "A101", "2020/02/14"), + new Order(3, 2, "A150", "2020/02/17")); + + @GetMapping + public List getAllOrders() { + return orders; + } + + @GetMapping("/{id}") + public List getOrdersByCustomer(@PathVariable int id) { + return orders.stream() + .filter(order -> order.getCustomerId() == id).collect(Collectors.toList()); + } + + @PostMapping("/create") + public OrderResponse createOrder(@RequestBody OrderDTO request) { + + int lastIndex = orders.size(); + Order order = new Order(); + order.setId(lastIndex + 1); + order.setCustomerId(request.getCustomerId()); + order.setItemId(request.getItemId()); + String date = DateFormatUtils.format(new Date(), "yyyy/MM/dd"); + order.setDate(date); + + return new OrderResponse(order.getId(), order.getItemId(), "CREATED"); + } + +} diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/resources/application.properties b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/resources/application.properties new file mode 100644 index 0000000000..f4fe5e7079 --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/src/main/resources/application.properties @@ -0,0 +1,4 @@ +#Spring Boot server configuration +server.servlet.context-path=/order-service +server.port=8002 + diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml new file mode 100644 index 0000000000..a1c6c1c39f --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml @@ -0,0 +1,122 @@ + + + + 4.0.0 + com.baeldung.orderservice + order-service + 1.0.0-SNAPSHOT + order-service + pom + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../../parent-boot-2 + + + + order-client + order-server + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-web + + + commons-lang + commons-lang + ${commons-lang.version} + + + org.projectlombok + lombok + true + + + org.qunix + structure-maven-plugin + ${structure-maven.version} + + + org.springframework.boot + spring-boot-starter-json + + + org.springframework.boot + spring-boot-configuration-processor + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${orderservice.mainclass} + + + + + repackage + + + exec + + + + start-application + + com.baeldung.orderservice.OrderApplication + ../order-server/target/classes + + + start + + + + + + org.qunix + structure-maven-plugin + ${structure-maven.version} + false + + + compile + + modules + + + + + + + + + + 1.8 + 2.6 + 0.0.2 + 1.8 + 1.8 + com.baeldung.orderservice.OrderApplication + + diff --git a/spring-cloud/spring-cloud-bootstrap/pom.xml b/spring-cloud/spring-cloud-bootstrap/pom.xml index 2447b90538..eb1a55c2a9 100644 --- a/spring-cloud/spring-cloud-bootstrap/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/pom.xml @@ -20,6 +20,8 @@ svc-book svc-rating zipkin + customer-service + order-service - \ No newline at end of file + diff --git a/spring-cloud/spring-cloud-circuit-breaker/pom.xml b/spring-cloud/spring-cloud-circuit-breaker/pom.xml index 188fc4bf8e..680d835c19 100644 --- a/spring-cloud/spring-cloud-circuit-breaker/pom.xml +++ b/spring-cloud/spring-cloud-circuit-breaker/pom.xml @@ -4,7 +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 spring-cloud-circuit-breaker - spring-cloud-gateway + spring-cloud-circuit-breaker jar @@ -16,14 +16,14 @@ - spring-snapshots - Spring Snapshots - https://repo.spring.io/libs-snapshot + spring-release + Spring Release + https://repo.spring.io/release - true + false - false + true @@ -44,7 +44,7 @@ org.springframework.cloud spring-cloud-starter-circuitbreaker-resilience4j - 1.0.2.RELEASE + ${circuitbreaker-resilience4j.version} org.springframework.boot @@ -52,4 +52,8 @@ + + 1.0.2.RELEASE + + diff --git a/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/discovery/DiscoveryClientApplication.java b/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/discovery/DiscoveryClientApplication.java index d013969ad3..e01799b8d9 100644 --- a/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/discovery/DiscoveryClientApplication.java +++ b/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/discovery/DiscoveryClientApplication.java @@ -4,12 +4,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import static org.springframework.boot.WebApplicationType.NONE; + @SpringBootApplication @EnableDiscoveryClient public class DiscoveryClientApplication { public static void main(String[] args) { - new SpringApplicationBuilder(DiscoveryClientApplication.class).web(true) + new SpringApplicationBuilder(DiscoveryClientApplication.class).web(NONE) .run(args); } diff --git a/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/health/ServiceDiscoveryApplication.java b/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/health/ServiceDiscoveryApplication.java index 020d7d017c..1ef3e34e08 100644 --- a/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/health/ServiceDiscoveryApplication.java +++ b/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/health/ServiceDiscoveryApplication.java @@ -1,13 +1,16 @@ package com.baeldung.spring.cloud.consul.health; +import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; +import static org.springframework.boot.WebApplicationType.NONE; + @SpringBootApplication public class ServiceDiscoveryApplication { public static void main(String[] args) { - new SpringApplicationBuilder(ServiceDiscoveryApplication.class).web(true) + new SpringApplicationBuilder(ServiceDiscoveryApplication.class).web(NONE) .run(args); } diff --git a/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/properties/DistributedPropertiesApplication.java b/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/properties/DistributedPropertiesApplication.java index c1d2b0acc5..d854b5aaba 100644 --- a/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/properties/DistributedPropertiesApplication.java +++ b/spring-cloud/spring-cloud-consul/src/main/java/com/baeldung/spring/cloud/consul/properties/DistributedPropertiesApplication.java @@ -4,12 +4,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.web.bind.annotation.RestController; +import static org.springframework.boot.WebApplicationType.NONE; + @SpringBootApplication @RestController public class DistributedPropertiesApplication { public static void main(String[] args) { - new SpringApplicationBuilder(DistributedPropertiesApplication.class).web(true) + new SpringApplicationBuilder(DistributedPropertiesApplication.class).web(NONE) .run(args); } diff --git a/spring-cloud/spring-cloud-contract/pom.xml b/spring-cloud/spring-cloud-contract/pom.xml index 2f868980db..f26f1d7e3b 100644 --- a/spring-cloud/spring-cloud-contract/pom.xml +++ b/spring-cloud/spring-cloud-contract/pom.xml @@ -53,8 +53,6 @@ - UTF-8 - UTF-8 2.1.1.RELEASE 2.1.4.RELEASE diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 03510d0504..7e6f5dfbdc 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -82,12 +82,9 @@ - UTF-8 - UTF-8 1.0.1.RELEASE 2.0.2 1.1.0 - 2.0.4.RELEASE 1.0.10.RELEASE diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index c692eed7ec..bbacf7a8ce 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -29,7 +29,7 @@ org.junit junit-bom - 5.5.2 + ${junit-bom.version} pom import @@ -108,6 +108,7 @@ 2.2.6.RELEASE 6.0.2.Final 0.7.2 + 5.5.2 diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml index 367b7c111e..acb9993881 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml @@ -36,18 +36,22 @@ org.springframework.cloud spring-cloud-starter-hystrix + ${spring-cloud-starter-hystrix.version} org.springframework.cloud spring-cloud-starter-hystrix-dashboard + ${spring-cloud-starter-hystrix.version} org.springframework.cloud spring-cloud-starter-feign + ${spring-cloud-starter-feign.version} org.springframework.boot spring-boot-starter-web + ${spring-boot-starter-web.version} org.springframework.boot diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/GreetingClient.java b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/GreetingClient.java index 4fcfb0eeda..2a31917352 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/GreetingClient.java +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/GreetingClient.java @@ -1,7 +1,7 @@ package com.baeldung.spring.cloud.hystrix.rest.consumer; import com.baeldung.spring.cloud.hystrix.rest.producer.GreetingController; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PathVariable; diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/RestConsumerFeignApplication.java b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/RestConsumerFeignApplication.java index 2fc54216fe..044b0dbcb8 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/RestConsumerFeignApplication.java +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/src/main/java/com/baeldung/spring/cloud/hystrix/rest/consumer/RestConsumerFeignApplication.java @@ -3,8 +3,8 @@ package com.baeldung.spring.cloud.hystrix.rest.consumer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; -import org.springframework.cloud.netflix.feign.EnableFeignClients; import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; +import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableCircuitBreaker diff --git a/spring-cloud/spring-cloud-open-service-broker/pom.xml b/spring-cloud/spring-cloud-open-service-broker/pom.xml index 7acd302dc1..42e90402e5 100644 --- a/spring-cloud/spring-cloud-open-service-broker/pom.xml +++ b/spring-cloud/spring-cloud-open-service-broker/pom.xml @@ -13,12 +13,6 @@ 1.0.0-SNAPSHOT - - 3.1.1.RELEASE - 2.2.7.RELEASE - 3.3.5.RELEASE - - org.springframework.cloud @@ -38,4 +32,10 @@ + + 3.1.1.RELEASE + 2.2.7.RELEASE + 3.3.5.RELEASE + + diff --git a/spring-cloud/spring-cloud-ribbon-client/pom.xml b/spring-cloud/spring-cloud-ribbon-client/pom.xml index ac86447164..e19d3beaad 100644 --- a/spring-cloud/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-client/pom.xml @@ -9,9 +9,9 @@ com.baeldung - parent-boot-1 + parent-boot-2 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../parent-boot-2 @@ -29,7 +29,7 @@ org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon org.springframework.boot @@ -38,7 +38,7 @@ - Brixton.SR7 + Hoxton.SR4 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-ribbon-client/src/test/java/com/baeldung/spring/cloud/ribbon/client/ServerLocationAppIntegrationTest.java b/spring-cloud/spring-cloud-ribbon-client/src/test/java/com/baeldung/spring/cloud/ribbon/client/ServerLocationAppIntegrationTest.java index b971565c44..4134880fa6 100644 --- a/spring-cloud/spring-cloud-ribbon-client/src/test/java/com/baeldung/spring/cloud/ribbon/client/ServerLocationAppIntegrationTest.java +++ b/spring-cloud/spring-cloud-ribbon-client/src/test/java/com/baeldung/spring/cloud/ribbon/client/ServerLocationAppIntegrationTest.java @@ -9,9 +9,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; -import org.springframework.boot.context.embedded.LocalServerPort; 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.context.ConfigurableApplicationContext; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/spring-cloud/spring-cloud-ribbon-retry/README.md b/spring-cloud/spring-cloud-ribbon-retry/README.md new file mode 100644 index 0000000000..a11d0da526 --- /dev/null +++ b/spring-cloud/spring-cloud-ribbon-retry/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Retrying Failed Requests with Spring Cloud Netflix Ribbon](https://www.baeldung.com/spring-cloud-netflix-ribbon-retry) diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/main/resources/application.yml b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/main/resources/application.yml index 3199f38dce..29d2360793 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/main/resources/application.yml +++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/main/resources/application.yml @@ -9,7 +9,7 @@ weather-service: ribbon: eureka: enabled: false - listOfServers: http://localhost:8081, http://localhost:8082 + listOfServers: http://localhost:8021, http://localhost:8022 ServerListRefreshInterval: 5000 MaxAutoRetries: 3 MaxAutoRetriesNextServer: 1 diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java index 0e72bdbb86..0f0a1c4255 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java +++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java @@ -24,8 +24,8 @@ public class RibbonRetryFailureIntegrationTest { @BeforeAll public static void setup() { - weatherServiceInstance1 = startApp(8081); - weatherServiceInstance2 = startApp(8082); + weatherServiceInstance1 = startApp(8021); + weatherServiceInstance2 = startApp(8022); } @AfterAll diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java index 2055159117..6fdad0f2a9 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java +++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java @@ -25,8 +25,8 @@ public class RibbonRetrySuccessIntegrationTest { @BeforeAll public static void setup() { - weatherServiceInstance1 = startApp(8081); - weatherServiceInstance2 = startApp(8082); + weatherServiceInstance1 = startApp(8021); + weatherServiceInstance2 = startApp(8022); } private static ConfigurableApplicationContext startApp(int port) { diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml index 3a4cf6c56e..669499efb7 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml @@ -8,9 +8,10 @@ Simple Spring Cloud Stream - org.springframework.boot - spring-boot-starter-parent - 2.1.5.RELEASE + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../../parent-boot-2 diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml index 3817f2747a..bb515fcb36 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml @@ -7,10 +7,10 @@ spring-cloud-stream-kinesis - org.springframework.boot - spring-boot-starter-parent - 2.1.8.RELEASE - + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../../parent-boot-2 diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsServiceApplicationIntegrationTest.java b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsServiceApplicationIntegrationTest.java index 898d06897f..c8b8c9f1a9 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsServiceApplicationIntegrationTest.java +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsServiceApplicationIntegrationTest.java @@ -28,13 +28,13 @@ public class MultipleOutputsServiceApplicationIntegrationTest { @Test public void whenSendMessage_thenResponseIsInAOutput() { whenSendMessage(1); - thenPayloadInChannelIs(pipe.anOutput(), 1); + thenPayloadInChannelIs(pipe.anOutput(), "1"); } @Test public void whenSendMessage_thenResponseIsInAnotherOutput() { whenSendMessage(11); - thenPayloadInChannelIs(pipe.anotherOutput(), 11); + thenPayloadInChannelIs(pipe.anotherOutput(), "11"); } private void whenSendMessage(Integer val) { @@ -43,7 +43,7 @@ public class MultipleOutputsServiceApplicationIntegrationTest { .build()); } - private void thenPayloadInChannelIs(MessageChannel channel, Integer expectedValue) { + private void thenPayloadInChannelIs(MessageChannel channel, String expectedValue) { Object payload = messageCollector.forChannel(channel) .poll() .getPayload(); diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsWithConditionsServiceIntegrationTest.java b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsWithConditionsServiceIntegrationTest.java index c3bf5a1205..1aa8d38aa1 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsWithConditionsServiceIntegrationTest.java +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MultipleOutputsWithConditionsServiceIntegrationTest.java @@ -28,13 +28,13 @@ public class MultipleOutputsWithConditionsServiceIntegrationTest { @Test public void whenSendMessage_thenResponseIsInAOutput() { whenSendMessage(1); - thenPayloadInChannelIs(pipe.anOutput(), 1); + thenPayloadInChannelIs(pipe.anOutput(), "1"); } @Test public void whenSendMessage_thenResponseIsInAnotherOutput() { whenSendMessage(11); - thenPayloadInChannelIs(pipe.anotherOutput(), 11); + thenPayloadInChannelIs(pipe.anotherOutput(), "11"); } private void whenSendMessage(Integer val) { @@ -43,7 +43,7 @@ public class MultipleOutputsWithConditionsServiceIntegrationTest { .build()); } - private void thenPayloadInChannelIs(MessageChannel channel, Integer expectedValue) { + private void thenPayloadInChannelIs(MessageChannel channel, String expectedValue) { Object payload = messageCollector.forChannel(channel) .poll() .getPayload(); diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MyLoggerApplicationIntegrationTest.java b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MyLoggerApplicationIntegrationTest.java index 21d84e79e0..7e5f4fbec7 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MyLoggerApplicationIntegrationTest.java +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/src/test/java/com/baeldung/spring/cloud/stream/rabbit/MyLoggerApplicationIntegrationTest.java @@ -35,6 +35,6 @@ public class MyLoggerApplicationIntegrationTest { .poll() .getPayload(); - assertEquals("[1]: This is my message", payload.toString()); + assertEquals("{\"message\":\"[1]: This is my message\"}", payload.toString()); } } diff --git a/spring-cloud/spring-cloud-vault/pom.xml b/spring-cloud/spring-cloud-vault/pom.xml index dbdbcb2c50..a5a29d9024 100644 --- a/spring-cloud/spring-cloud-vault/pom.xml +++ b/spring-cloud/spring-cloud-vault/pom.xml @@ -78,8 +78,6 @@ - UTF-8 - UTF-8 Greenwich.RELEASE diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index ac469d8bc4..871218e78c 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml @@ -30,6 +30,10 @@ spring-boot-starter ${spring-boot.version} + + org.springframework.boot + spring-boot-starter-web + org.springframework spring-web @@ -56,7 +60,10 @@ spring-cloud-starter-feign ${spring-cloud-starter-feign.version} - + + org.springframework.cloud + spring-cloud-starter-openfeign + org.springframework.boot spring-boot-starter-test @@ -71,7 +78,6 @@ - 1.2.5.RELEASE 1.3 diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/HelloWorldClient.java b/spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/HelloWorldClient.java index c56cb1907a..dc90576e08 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/HelloWorldClient.java +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/HelloWorldClient.java @@ -2,8 +2,8 @@ package com.baeldung.spring.cloud.greeting; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.context.annotation.Configuration; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/spring-cloud/spring-cloud-zookeeper/pom.xml b/spring-cloud/spring-cloud-zookeeper/pom.xml index 64d30b19a6..244ccbd957 100644 --- a/spring-cloud/spring-cloud-zookeeper/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/pom.xml @@ -18,8 +18,7 @@ - 1.5.2.RELEASE - 4.3.7.RELEASE + 5.2.7.RELEASE 1.0.3.RELEASE diff --git a/spring-cloud/spring-cloud-zuul/pom.xml b/spring-cloud/spring-cloud-zuul/pom.xml index e0a63ae00b..140a1337b3 100644 --- a/spring-cloud/spring-cloud-zuul/pom.xml +++ b/spring-cloud/spring-cloud-zuul/pom.xml @@ -72,8 +72,6 @@ - UTF-8 - UTF-8 Hoxton.RELEASE 2.2.2.RELEASE diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml index 34f0e6b7ae..fd6d18fc09 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml @@ -48,8 +48,6 @@ - UTF-8 - UTF-8 Finchley.SR1 2.0.6.RELEASE 2.2.0.RELEASE diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 10d3080b45..3c6bd05876 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -6,13 +6,9 @@ This module contains articles about core Spring functionality - [Guide to Spring @Autowired](http://www.baeldung.com/spring-autowire) - [Spring Profiles](http://www.baeldung.com/spring-profiles) -- [A Spring Custom Annotation for a Better DAO](http://www.baeldung.com/spring-annotation-bean-pre-processor) - [Quick Guide to Spring Bean Scopes](http://www.baeldung.com/spring-bean-scopes) -- [Custom Scope in Spring](http://www.baeldung.com/spring-custom-scope) - [@Order in Spring](http://www.baeldung.com/spring-order) - [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) -- [Using @Autowired in Abstract Classes](https://www.baeldung.com/spring-autowired-abstract-class) -- [Running Setup Data on Startup in Spring](https://www.baeldung.com/running-setup-logic-on-startup-in-spring) - More articles: [[<-- prev]](/spring-core)[[next -->]](/spring-core-3) diff --git a/spring-core-3/README.md b/spring-core-3/README.md index 6c210b23ef..b6257cb9a4 100644 --- a/spring-core-3/README.md +++ b/spring-core-3/README.md @@ -7,8 +7,8 @@ This module contains articles about core Spring functionality - [Understanding getBean() in Spring](https://www.baeldung.com/spring-getbean) - [Guide to the Spring BeanFactory](https://www.baeldung.com/spring-beanfactory) - [How to use the Spring FactoryBean?](https://www.baeldung.com/spring-factorybean) -- [Spring – Injecting Collections](https://www.baeldung.com/spring-injecting-collections) - [Design Patterns in the Spring Framework](https://www.baeldung.com/spring-framework-design-patterns) -- [Injecting a Value in a Static Field in Spring](https://www.baeldung.com/spring-inject-static-field) - [Difference Between BeanFactory and ApplicationContext](https://www.baeldung.com/spring-beanfactory-vs-applicationcontext) +- [A Spring Custom Annotation for a Better DAO](http://www.baeldung.com/spring-annotation-bean-pre-processor) +- [Custom Scope in Spring](http://www.baeldung.com/spring-custom-scope) - More articles: [[<-- prev]](/spring-core-2) diff --git a/spring-core-2/src/main/java/com/baeldung/customannotation/CustomAnnotationConfiguration.java b/spring-core-3/src/main/java/com/baeldung/customannotation/CustomAnnotationConfiguration.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customannotation/CustomAnnotationConfiguration.java rename to spring-core-3/src/main/java/com/baeldung/customannotation/CustomAnnotationConfiguration.java diff --git a/spring-core-2/src/main/java/com/baeldung/customannotation/DataAccess.java b/spring-core-3/src/main/java/com/baeldung/customannotation/DataAccess.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customannotation/DataAccess.java rename to spring-core-3/src/main/java/com/baeldung/customannotation/DataAccess.java diff --git a/spring-core-2/src/main/java/com/baeldung/customannotation/DataAccessAnnotationProcessor.java b/spring-core-3/src/main/java/com/baeldung/customannotation/DataAccessAnnotationProcessor.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customannotation/DataAccessAnnotationProcessor.java rename to spring-core-3/src/main/java/com/baeldung/customannotation/DataAccessAnnotationProcessor.java diff --git a/spring-core-2/src/main/java/com/baeldung/customannotation/DataAccessFieldCallback.java b/spring-core-3/src/main/java/com/baeldung/customannotation/DataAccessFieldCallback.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customannotation/DataAccessFieldCallback.java rename to spring-core-3/src/main/java/com/baeldung/customannotation/DataAccessFieldCallback.java diff --git a/spring-core-2/src/main/java/com/baeldung/customannotation/GenericDAO.java b/spring-core-3/src/main/java/com/baeldung/customannotation/GenericDAO.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customannotation/GenericDAO.java rename to spring-core-3/src/main/java/com/baeldung/customannotation/GenericDAO.java diff --git a/spring-core-2/src/main/java/com/baeldung/customscope/TenantBean.java b/spring-core-3/src/main/java/com/baeldung/customscope/TenantBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customscope/TenantBean.java rename to spring-core-3/src/main/java/com/baeldung/customscope/TenantBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/customscope/TenantBeanFactoryPostProcessor.java b/spring-core-3/src/main/java/com/baeldung/customscope/TenantBeanFactoryPostProcessor.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customscope/TenantBeanFactoryPostProcessor.java rename to spring-core-3/src/main/java/com/baeldung/customscope/TenantBeanFactoryPostProcessor.java diff --git a/spring-core-2/src/main/java/com/baeldung/customscope/TenantBeansConfig.java b/spring-core-3/src/main/java/com/baeldung/customscope/TenantBeansConfig.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customscope/TenantBeansConfig.java rename to spring-core-3/src/main/java/com/baeldung/customscope/TenantBeansConfig.java diff --git a/spring-core-2/src/main/java/com/baeldung/customscope/TenantScope.java b/spring-core-3/src/main/java/com/baeldung/customscope/TenantScope.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customscope/TenantScope.java rename to spring-core-3/src/main/java/com/baeldung/customscope/TenantScope.java diff --git a/spring-core-2/src/main/java/com/baeldung/customscope/TenantScopeConfig.java b/spring-core-3/src/main/java/com/baeldung/customscope/TenantScopeConfig.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/customscope/TenantScopeConfig.java rename to spring-core-3/src/main/java/com/baeldung/customscope/TenantScopeConfig.java diff --git a/spring-core-2/src/test/java/com/baeldung/customannotation/Account.java b/spring-core-3/src/test/java/com/baeldung/customannotation/Account.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/customannotation/Account.java rename to spring-core-3/src/test/java/com/baeldung/customannotation/Account.java diff --git a/spring-core-2/src/test/java/com/baeldung/customannotation/BeanWithGenericDAO.java b/spring-core-3/src/test/java/com/baeldung/customannotation/BeanWithGenericDAO.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/customannotation/BeanWithGenericDAO.java rename to spring-core-3/src/test/java/com/baeldung/customannotation/BeanWithGenericDAO.java diff --git a/spring-core-2/src/test/java/com/baeldung/customannotation/DataAccessAnnotationIntegrationTest.java b/spring-core-3/src/test/java/com/baeldung/customannotation/DataAccessAnnotationIntegrationTest.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/customannotation/DataAccessAnnotationIntegrationTest.java rename to spring-core-3/src/test/java/com/baeldung/customannotation/DataAccessAnnotationIntegrationTest.java diff --git a/spring-core-2/src/test/java/com/baeldung/customannotation/DataAccessFieldCallbackIntegrationTest.java b/spring-core-3/src/test/java/com/baeldung/customannotation/DataAccessFieldCallbackIntegrationTest.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/customannotation/DataAccessFieldCallbackIntegrationTest.java rename to spring-core-3/src/test/java/com/baeldung/customannotation/DataAccessFieldCallbackIntegrationTest.java diff --git a/spring-core-2/src/test/java/com/baeldung/customannotation/Person.java b/spring-core-3/src/test/java/com/baeldung/customannotation/Person.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/customannotation/Person.java rename to spring-core-3/src/test/java/com/baeldung/customannotation/Person.java diff --git a/spring-core-2/src/test/java/com/baeldung/customscope/TenantScopeIntegrationTest.java b/spring-core-3/src/test/java/com/baeldung/customscope/TenantScopeIntegrationTest.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/customscope/TenantScopeIntegrationTest.java rename to spring-core-3/src/test/java/com/baeldung/customscope/TenantScopeIntegrationTest.java diff --git a/spring-core-4/README.md b/spring-core-4/README.md index 11a966f23d..83b5c4933d 100644 --- a/spring-core-4/README.md +++ b/spring-core-4/README.md @@ -7,4 +7,9 @@ This module contains articles about core Spring functionality - [Creating Spring Beans Through Factory Methods](https://www.baeldung.com/spring-beans-factory-methods) - [How to dynamically Autowire a Bean in Spring](https://www.baeldung.com/spring-dynamic-autowire) - [Spring @Import Annotation](https://www.baeldung.com/spring-import-annotation) +- [Spring BeanPostProcessor](https://www.baeldung.com/spring-beanpostprocessor) +- [Using @Autowired in Abstract Classes](https://www.baeldung.com/spring-autowired-abstract-class) +- [Running Setup Data on Startup in Spring](https://www.baeldung.com/running-setup-logic-on-startup-in-spring) +- [Constructor Injection in Spring with Lombok](https://www.baeldung.com/spring-injection-lombok) +- [The Spring ApplicationContext](https://www.baeldung.com/spring-application-context) - More articles: [[<-- prev]](/spring-core-3) diff --git a/spring-core-4/pom.xml b/spring-core-4/pom.xml index fbec5ea9eb..df0b90fef2 100644 --- a/spring-core-4/pom.xml +++ b/spring-core-4/pom.xml @@ -24,15 +24,30 @@ spring-core ${spring.version} + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + org.springframework spring-expression ${spring.version} + + org.projectlombok + lombok + ${lombok.version} + com.google.guava guava - 28.2-jre + ${guava.version} org.springframework @@ -55,15 +70,21 @@ org.awaitility awaitility - 4.0.2 + ${awaitility.version} test org.assertj assertj-core - 2.9.1 + ${assertj-core.version} test + + javax.servlet + javax.servlet-api + 4.0.0 + + @@ -80,6 +101,9 @@ 2.22.1 1.3.2 2.2.2.RELEASE + 28.2-jre + 4.0.2 + 2.9.1 diff --git a/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountConfig.java b/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountConfig.java new file mode 100644 index 0000000000..d4c960bd68 --- /dev/null +++ b/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountConfig.java @@ -0,0 +1,28 @@ +package com.baeldung.applicationcontext; + +import org.springframework.context.MessageSource; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.ResourceBundleMessageSource; + +@Configuration +public class AccountConfig { + + @Bean + public AccountService accountService() { + return new AccountService(accountRepository()); + } + + @Bean + public AccountRepository accountRepository() { + return new AccountRepository(); + } + + @Bean + public MessageSource messageSource() { + ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); + messageSource.setBasename("config/messages"); + return messageSource; + } + +} diff --git a/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountRepository.java b/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountRepository.java new file mode 100644 index 0000000000..f15475acf3 --- /dev/null +++ b/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountRepository.java @@ -0,0 +1,5 @@ +package com.baeldung.applicationcontext; + +public class AccountRepository { + +} diff --git a/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountService.java b/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountService.java new file mode 100644 index 0000000000..c8b58915a8 --- /dev/null +++ b/spring-core-4/src/main/java/com/baeldung/applicationcontext/AccountService.java @@ -0,0 +1,32 @@ +package com.baeldung.applicationcontext; + +import java.util.Locale; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.MessageSource; + +public class AccountService { + + @Autowired + private AccountRepository accountRepository; + + @Autowired + private MessageSource messageSource; + + public void setAccountRepository(AccountRepository accountRepository) { + this.accountRepository = accountRepository; + } + + public AccountRepository getAccountRepository() { + return accountRepository; + } + + public AccountService(AccountRepository accountRepository) { + this.accountRepository = accountRepository; + } + + public String getAccountName() { + return messageSource.getMessage("account.name", null, Locale.ENGLISH); + } + +} diff --git a/spring-core-4/src/main/java/com/baeldung/applicationcontext/MyWebApplicationInitializer.java b/spring-core-4/src/main/java/com/baeldung/applicationcontext/MyWebApplicationInitializer.java new file mode 100644 index 0000000000..0296910311 --- /dev/null +++ b/spring-core-4/src/main/java/com/baeldung/applicationcontext/MyWebApplicationInitializer.java @@ -0,0 +1,24 @@ +package com.baeldung.applicationcontext; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRegistration; + +import org.springframework.web.WebApplicationInitializer; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; +import org.springframework.web.servlet.DispatcherServlet; + +public class MyWebApplicationInitializer implements WebApplicationInitializer { + + public void onStartup(ServletContext container) throws ServletException { + AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); + context.register(AccountConfig.class); + context.setServletContext(container); + + ServletRegistration.Dynamic servlet = container.addServlet("dispatcher", new DispatcherServlet(context)); + servlet.setLoadOnStartup(1); + + servlet.addMapping("/"); + } + +} diff --git a/spring-core-4/src/main/java/com/baeldung/applicationcontext/MyXmlWebApplicationInitializer.java b/spring-core-4/src/main/java/com/baeldung/applicationcontext/MyXmlWebApplicationInitializer.java new file mode 100644 index 0000000000..fe681f1784 --- /dev/null +++ b/spring-core-4/src/main/java/com/baeldung/applicationcontext/MyXmlWebApplicationInitializer.java @@ -0,0 +1,24 @@ +package com.baeldung.applicationcontext; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRegistration; + +import org.springframework.web.WebApplicationInitializer; +import org.springframework.web.context.support.XmlWebApplicationContext; +import org.springframework.web.servlet.DispatcherServlet; + +public class MyXmlWebApplicationInitializer implements WebApplicationInitializer { + + public void onStartup(ServletContext container) throws ServletException { + XmlWebApplicationContext context = new XmlWebApplicationContext(); + context.setConfigLocation("/WEB-INF/spring/applicationContext.xml"); + context.setServletContext(container); + + ServletRegistration.Dynamic servlet = container.addServlet("dispatcher", new DispatcherServlet(context)); + servlet.setLoadOnStartup(1); + + servlet.addMapping("/"); + } + +} diff --git a/spring-core-4/src/main/java/com/baeldung/applicationcontext/UserService.java b/spring-core-4/src/main/java/com/baeldung/applicationcontext/UserService.java new file mode 100644 index 0000000000..b63d6828a7 --- /dev/null +++ b/spring-core-4/src/main/java/com/baeldung/applicationcontext/UserService.java @@ -0,0 +1,10 @@ +package com.baeldung.applicationcontext; + +import org.springframework.stereotype.Component; + +@Component +public class UserService { + + // user service code + +} diff --git a/spring-core/src/main/java/com/baeldung/lombok/ApologizeService.java b/spring-core-4/src/main/java/com/baeldung/lombok/ApologizeService.java similarity index 100% rename from spring-core/src/main/java/com/baeldung/lombok/ApologizeService.java rename to spring-core-4/src/main/java/com/baeldung/lombok/ApologizeService.java diff --git a/spring-core/src/main/java/com/baeldung/lombok/FarewellService.java b/spring-core-4/src/main/java/com/baeldung/lombok/FarewellService.java similarity index 100% rename from spring-core/src/main/java/com/baeldung/lombok/FarewellService.java rename to spring-core-4/src/main/java/com/baeldung/lombok/FarewellService.java diff --git a/spring-core/src/main/java/com/baeldung/lombok/GreetingService.java b/spring-core-4/src/main/java/com/baeldung/lombok/GreetingService.java similarity index 100% rename from spring-core/src/main/java/com/baeldung/lombok/GreetingService.java rename to spring-core-4/src/main/java/com/baeldung/lombok/GreetingService.java diff --git a/spring-core/src/main/java/com/baeldung/lombok/ThankingService.java b/spring-core-4/src/main/java/com/baeldung/lombok/ThankingService.java similarity index 100% rename from spring-core/src/main/java/com/baeldung/lombok/ThankingService.java rename to spring-core-4/src/main/java/com/baeldung/lombok/ThankingService.java diff --git a/spring-core/src/main/java/com/baeldung/lombok/Translator.java b/spring-core-4/src/main/java/com/baeldung/lombok/Translator.java similarity index 100% rename from spring-core/src/main/java/com/baeldung/lombok/Translator.java rename to spring-core-4/src/main/java/com/baeldung/lombok/Translator.java diff --git a/spring-core-2/src/main/java/com/baeldung/sampleabstract/BallService.java b/spring-core-4/src/main/java/com/baeldung/sampleabstract/BallService.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/sampleabstract/BallService.java rename to spring-core-4/src/main/java/com/baeldung/sampleabstract/BallService.java diff --git a/spring-core-2/src/main/java/com/baeldung/sampleabstract/BasketballService.java b/spring-core-4/src/main/java/com/baeldung/sampleabstract/BasketballService.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/sampleabstract/BasketballService.java rename to spring-core-4/src/main/java/com/baeldung/sampleabstract/BasketballService.java diff --git a/spring-core-2/src/main/java/com/baeldung/sampleabstract/DemoApp.java b/spring-core-4/src/main/java/com/baeldung/sampleabstract/DemoApp.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/sampleabstract/DemoApp.java rename to spring-core-4/src/main/java/com/baeldung/sampleabstract/DemoApp.java diff --git a/spring-core-2/src/main/java/com/baeldung/sampleabstract/LogRepository.java b/spring-core-4/src/main/java/com/baeldung/sampleabstract/LogRepository.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/sampleabstract/LogRepository.java rename to spring-core-4/src/main/java/com/baeldung/sampleabstract/LogRepository.java diff --git a/spring-core-2/src/main/java/com/baeldung/sampleabstract/RuleRepository.java b/spring-core-4/src/main/java/com/baeldung/sampleabstract/RuleRepository.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/sampleabstract/RuleRepository.java rename to spring-core-4/src/main/java/com/baeldung/sampleabstract/RuleRepository.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/AllStrategiesExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/AllStrategiesExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/AllStrategiesExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/AllStrategiesExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/EventListenerExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/EventListenerExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/EventListenerExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/EventListenerExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/InitMethodExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/InitMethodExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/InitMethodExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/InitMethodExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/InitializingBeanExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/InitializingBeanExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/InitializingBeanExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/InitializingBeanExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/InvalidInitExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/InvalidInitExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/InvalidInitExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/InvalidInitExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/LogicInConstructorExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/LogicInConstructorExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/LogicInConstructorExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/LogicInConstructorExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/PostConstructExampleBean.java b/spring-core-4/src/main/java/com/baeldung/startup/PostConstructExampleBean.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/PostConstructExampleBean.java rename to spring-core-4/src/main/java/com/baeldung/startup/PostConstructExampleBean.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/SpringStartupConfig.java b/spring-core-4/src/main/java/com/baeldung/startup/SpringStartupConfig.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/SpringStartupConfig.java rename to spring-core-4/src/main/java/com/baeldung/startup/SpringStartupConfig.java diff --git a/spring-core-2/src/main/java/com/baeldung/startup/StartupApplicationListenerExample.java b/spring-core-4/src/main/java/com/baeldung/startup/StartupApplicationListenerExample.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/startup/StartupApplicationListenerExample.java rename to spring-core-4/src/main/java/com/baeldung/startup/StartupApplicationListenerExample.java diff --git a/spring-core-2/src/main/resources/startupConfig.xml b/spring-core-4/src/main/resources/startupConfig.xml similarity index 100% rename from spring-core-2/src/main/resources/startupConfig.xml rename to spring-core-4/src/main/resources/startupConfig.xml diff --git a/spring-core-4/src/test/java/com/baeldung/applicationcontext/ApplicationContextUnitTest.java b/spring-core-4/src/test/java/com/baeldung/applicationcontext/ApplicationContextUnitTest.java new file mode 100644 index 0000000000..491d5dd9d0 --- /dev/null +++ b/spring-core-4/src/test/java/com/baeldung/applicationcontext/ApplicationContextUnitTest.java @@ -0,0 +1,71 @@ +package com.baeldung.applicationcontext; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.Ignore; +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.context.support.FileSystemXmlApplicationContext; + +public class ApplicationContextUnitTest { + + @Test + public void givenAnnotationConfigAppContext_whenSpringConfig_thenMappingSuccess() { + ApplicationContext context = new AnnotationConfigApplicationContext(AccountConfig.class); + AccountService accountService = context.getBean(AccountService.class); + + assertNotNull(accountService); + assertNotNull(accountService.getAccountRepository()); + + ((AnnotationConfigApplicationContext) context).close(); + } + + @Test + public void givenClasspathXmlAppContext_whenAnnotationConfig_thenMappingSuccess() { + ApplicationContext context = new ClassPathXmlApplicationContext("applicationcontext/user-bean-config.xml"); + UserService userService = context.getBean(UserService.class); + + assertNotNull(userService); + + ((ClassPathXmlApplicationContext) context).close(); + } + + @Test + @Ignore + public void givenFileXmlAppContext_whenXMLConfig_thenMappingSuccess() { + String path = "D:/workspaces/Baeldung/tutorials/spring-core-4/src/test/resources/applicationcontext/account-bean-config.xml"; + + ApplicationContext context = new FileSystemXmlApplicationContext(path); + AccountService accountService = context.getBean("accountService", AccountService.class); + + assertNotNull(accountService); + assertNotNull(accountService.getAccountRepository()); + + ((FileSystemXmlApplicationContext) context).close(); + } + + @Test + public void givenClasspathXmlAppContext_whenXMLConfig_thenMappingSuccess() { + ApplicationContext context = new ClassPathXmlApplicationContext("applicationcontext/account-bean-config.xml"); + AccountService accountService = context.getBean("accountService", AccountService.class); + + assertNotNull(accountService); + assertNotNull(accountService.getAccountRepository()); + + ((ClassPathXmlApplicationContext) context).close(); + } + + @Test + public void givenMessagesInFile_whenMessageResourceUsed_thenReadMessage() { + ApplicationContext context = new AnnotationConfigApplicationContext(AccountConfig.class); + AccountService accountService = context.getBean(AccountService.class); + + assertEquals("TestAccount", accountService.getAccountName()); + + ((AnnotationConfigApplicationContext) context).close(); + } + +} diff --git a/spring-core/src/test/java/com/baeldung/lombok/ApologizeServiceAutowiringIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/ApologizeServiceAutowiringIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/ApologizeServiceAutowiringIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/ApologizeServiceAutowiringIntegrationTest.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/ApologizeServiceIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/ApologizeServiceIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/ApologizeServiceIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/ApologizeServiceIntegrationTest.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/FarewellAutowiringIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/FarewellAutowiringIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/FarewellAutowiringIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/FarewellAutowiringIntegrationTest.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/FarewellServiceIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/FarewellServiceIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/FarewellServiceIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/FarewellServiceIntegrationTest.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/GreetingServiceIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/GreetingServiceIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/GreetingServiceIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/GreetingServiceIntegrationTest.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/TestConfig.java b/spring-core-4/src/test/java/com/baeldung/lombok/TestConfig.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/TestConfig.java rename to spring-core-4/src/test/java/com/baeldung/lombok/TestConfig.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/ThankingServiceAutowiringIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/ThankingServiceAutowiringIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/ThankingServiceAutowiringIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/ThankingServiceAutowiringIntegrationTest.java diff --git a/spring-core/src/test/java/com/baeldung/lombok/ThankingServiceIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/lombok/ThankingServiceIntegrationTest.java similarity index 100% rename from spring-core/src/test/java/com/baeldung/lombok/ThankingServiceIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/lombok/ThankingServiceIntegrationTest.java diff --git a/spring-core-2/src/test/java/com/baeldung/startup/SpringStartupIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/startup/SpringStartupIntegrationTest.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/startup/SpringStartupIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/startup/SpringStartupIntegrationTest.java diff --git a/spring-core-2/src/test/java/com/baeldung/startup/SpringStartupXMLConfigIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/startup/SpringStartupXMLConfigIntegrationTest.java similarity index 100% rename from spring-core-2/src/test/java/com/baeldung/startup/SpringStartupXMLConfigIntegrationTest.java rename to spring-core-4/src/test/java/com/baeldung/startup/SpringStartupXMLConfigIntegrationTest.java diff --git a/spring-core-4/src/test/resources/applicationcontext/account-bean-config.xml b/spring-core-4/src/test/resources/applicationcontext/account-bean-config.xml new file mode 100644 index 0000000000..eef434928f --- /dev/null +++ b/spring-core-4/src/test/resources/applicationcontext/account-bean-config.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/spring-core-4/src/test/resources/applicationcontext/user-bean-config.xml b/spring-core-4/src/test/resources/applicationcontext/user-bean-config.xml new file mode 100644 index 0000000000..9779d64270 --- /dev/null +++ b/spring-core-4/src/test/resources/applicationcontext/user-bean-config.xml @@ -0,0 +1,15 @@ + + + + + + + diff --git a/spring-core-4/src/test/resources/config/messages.properties b/spring-core-4/src/test/resources/config/messages.properties new file mode 100644 index 0000000000..7d5a4baa73 --- /dev/null +++ b/spring-core-4/src/test/resources/config/messages.properties @@ -0,0 +1 @@ +account.name=TestAccount diff --git a/spring-core/README.md b/spring-core/README.md index 1f3dcb783b..b8d46f6b34 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -3,10 +3,8 @@ This module contains articles about core Spring functionality ### Relevant Articles: -- [Wiring in Spring: @Autowired, @Resource and @Inject](https://www.baeldung.com/spring-annotations-resource-inject-autowire) -- [Constructor Injection in Spring with Lombok](https://www.baeldung.com/spring-injection-lombok) + - [Introduction to Spring’s StreamUtils](https://www.baeldung.com/spring-stream-utils) -- [XML-Based Injection in Spring](https://www.baeldung.com/spring-xml-injection) - [A Quick Guide to the Spring @Lazy Annotation](https://www.baeldung.com/spring-lazy-annotation) - [BeanNameAware and BeanFactoryAware Interfaces in Spring](https://www.baeldung.com/spring-bean-name-factory-aware) - [Access a File from the Classpath in a Spring Application](https://www.baeldung.com/spring-classpath-file-access) diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index bb592c08d5..741d146fbf 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -88,7 +88,6 @@ - UTF-8 com.baeldung.books.SpringDataRestApplication 1.0 diff --git a/spring-di-2/README.md b/spring-di-2/README.md new file mode 100644 index 0000000000..f41976c3f0 --- /dev/null +++ b/spring-di-2/README.md @@ -0,0 +1,12 @@ +## Spring Dependency Injection + +This module contains articles about dependency injection with Spring + +### Relevant Articles + +- [Injecting Spring Beans into Unmanaged Objects](https://www.baeldung.com/spring-inject-bean-into-unmanaged-objects) +- [Injecting a Value in a Static Field in Spring](https://www.baeldung.com/spring-inject-static-field) +- [Spring – Injecting Collections](https://www.baeldung.com/spring-injecting-collections) +- [Wiring in Spring: @Autowired, @Resource and @Inject](https://www.baeldung.com/spring-annotations-resource-inject-autowire) +- [Injecting Spring Beans into Unmanaged Objects](https://www.baeldung.com/spring-inject-bean-into-unmanaged-objects) +- More articles: [[<-- prev]](/spring-di) diff --git a/spring-di-2/pom.xml b/spring-di-2/pom.xml new file mode 100644 index 0000000000..4dd92ca18c --- /dev/null +++ b/spring-di-2/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + spring-di-2 + 1.0-SNAPSHOT + spring-di-2 + + + com.baeldung + parent-spring-5 + 0.0.1-SNAPSHOT + ../parent-spring-5 + + + + + org.springframework + spring-test + ${spring.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.version} + + + org.springframework + spring-aspects + ${spring.version} + + + org.projectlombok + lombok + ${lombok.version} + + + javax.inject + javax.inject + ${javax.inject.version} + + + + + + + org.codehaus.mojo + aspectj-maven-plugin + ${aspectj-plugin.version} + + ${java.version} + + + org.springframework + spring-aspects + + + + + + + compile + + + + + + + + + 2.3.1.RELEASE + 1.11 + 1 + + \ No newline at end of file diff --git a/spring-core-3/src/main/java/com/baeldung/collection/BaeldungBean.java b/spring-di-2/src/main/java/com/baeldung/collection/BaeldungBean.java similarity index 100% rename from spring-core-3/src/main/java/com/baeldung/collection/BaeldungBean.java rename to spring-di-2/src/main/java/com/baeldung/collection/BaeldungBean.java diff --git a/spring-core-3/src/main/java/com/baeldung/collection/CollectionConfig.java b/spring-di-2/src/main/java/com/baeldung/collection/CollectionConfig.java similarity index 100% rename from spring-core-3/src/main/java/com/baeldung/collection/CollectionConfig.java rename to spring-di-2/src/main/java/com/baeldung/collection/CollectionConfig.java diff --git a/spring-core-3/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java b/spring-di-2/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java similarity index 100% rename from spring-core-3/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java rename to spring-di-2/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java diff --git a/spring-core-3/src/main/java/com/baeldung/collection/CollectionsBean.java b/spring-di-2/src/main/java/com/baeldung/collection/CollectionsBean.java similarity index 100% rename from spring-core-3/src/main/java/com/baeldung/collection/CollectionsBean.java rename to spring-di-2/src/main/java/com/baeldung/collection/CollectionsBean.java diff --git a/spring-di/src/main/java/com/baeldung/dependency/AnotherArbitraryDependency.java b/spring-di-2/src/main/java/com/baeldung/dependency/AnotherArbitraryDependency.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/dependency/AnotherArbitraryDependency.java rename to spring-di-2/src/main/java/com/baeldung/dependency/AnotherArbitraryDependency.java diff --git a/spring-di/src/main/java/com/baeldung/dependency/ArbitraryDependency.java b/spring-di-2/src/main/java/com/baeldung/dependency/ArbitraryDependency.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/dependency/ArbitraryDependency.java rename to spring-di-2/src/main/java/com/baeldung/dependency/ArbitraryDependency.java diff --git a/spring-di/src/main/java/com/baeldung/dependency/YetAnotherArbitraryDependency.java b/spring-di-2/src/main/java/com/baeldung/dependency/YetAnotherArbitraryDependency.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/dependency/YetAnotherArbitraryDependency.java rename to spring-di-2/src/main/java/com/baeldung/dependency/YetAnotherArbitraryDependency.java diff --git a/spring-di/src/main/java/com/baeldung/di/aspectj/AspectJConfig.java b/spring-di-2/src/main/java/com/baeldung/di/aspectj/AspectJConfig.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/di/aspectj/AspectJConfig.java rename to spring-di-2/src/main/java/com/baeldung/di/aspectj/AspectJConfig.java diff --git a/spring-di/src/main/java/com/baeldung/di/aspectj/IdService.java b/spring-di-2/src/main/java/com/baeldung/di/aspectj/IdService.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/di/aspectj/IdService.java rename to spring-di-2/src/main/java/com/baeldung/di/aspectj/IdService.java diff --git a/spring-di/src/main/java/com/baeldung/di/aspectj/PersonEntity.java b/spring-di-2/src/main/java/com/baeldung/di/aspectj/PersonEntity.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/di/aspectj/PersonEntity.java rename to spring-di-2/src/main/java/com/baeldung/di/aspectj/PersonEntity.java diff --git a/spring-di/src/main/java/com/baeldung/di/aspectj/PersonObject.java b/spring-di-2/src/main/java/com/baeldung/di/aspectj/PersonObject.java similarity index 100% rename from spring-di/src/main/java/com/baeldung/di/aspectj/PersonObject.java rename to spring-di-2/src/main/java/com/baeldung/di/aspectj/PersonObject.java diff --git a/spring-core-3/src/main/java/com/baeldung/staticvalue/injection/Application.java b/spring-di-2/src/main/java/com/baeldung/staticvalue/injection/Application.java similarity index 72% rename from spring-core-3/src/main/java/com/baeldung/staticvalue/injection/Application.java rename to spring-di-2/src/main/java/com/baeldung/staticvalue/injection/Application.java index 45c47c955f..b4222ddcc9 100644 --- a/spring-core-3/src/main/java/com/baeldung/staticvalue/injection/Application.java +++ b/spring-di-2/src/main/java/com/baeldung/staticvalue/injection/Application.java @@ -2,9 +2,10 @@ package com.baeldung.staticvalue.injection; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.PropertySource; -@SpringBootApplication +@SpringBootApplication(exclude={DataSourceAutoConfiguration.class}) @PropertySource("/application.properties") public class Application { diff --git a/spring-core-3/src/main/java/com/baeldung/staticvalue/injection/PropertyController.java b/spring-di-2/src/main/java/com/baeldung/staticvalue/injection/PropertyController.java similarity index 100% rename from spring-core-3/src/main/java/com/baeldung/staticvalue/injection/PropertyController.java rename to spring-di-2/src/main/java/com/baeldung/staticvalue/injection/PropertyController.java diff --git a/spring-di-2/src/main/resources/application.properties b/spring-di-2/src/main/resources/application.properties new file mode 100644 index 0000000000..828fa9cd2a --- /dev/null +++ b/spring-di-2/src/main/resources/application.properties @@ -0,0 +1 @@ +name = Inject a value to a static field diff --git a/spring-di/src/test/java/com/baeldung/di/aspectj/PersonUnitTest.java b/spring-di-2/src/test/java/com/baeldung/di/aspectj/PersonUnitTest.java similarity index 100% rename from spring-di/src/test/java/com/baeldung/di/aspectj/PersonUnitTest.java rename to spring-di-2/src/test/java/com/baeldung/di/aspectj/PersonUnitTest.java diff --git a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredName.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredName.java similarity index 85% rename from spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredName.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredName.java index 48c4495465..3046e68829 100644 --- a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredName.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredName.java @@ -1,4 +1,4 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredQualifier.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredQualifier.java similarity index 94% rename from spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredQualifier.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredQualifier.java index ef6690ab4b..33969ea69d 100644 --- a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredQualifier.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredQualifier.java @@ -1,9 +1,10 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import com.baeldung.dependency.AnotherArbitraryDependency; import com.baeldung.dependency.ArbitraryDependency; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; @Configuration public class ApplicationContextTestAutowiredQualifier { diff --git a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredType.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredType.java similarity index 90% rename from spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredType.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredType.java index 240bc466b7..24cdd978e4 100644 --- a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestAutowiredType.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestAutowiredType.java @@ -1,9 +1,10 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; -import com.baeldung.dependency.ArbitraryDependency; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import com.baeldung.dependency.ArbitraryDependency; + @Configuration public class ApplicationContextTestAutowiredType { diff --git a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectName.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectName.java similarity index 92% rename from spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectName.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectName.java index 851aa0b8ee..cb465d0183 100644 --- a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectName.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectName.java @@ -1,9 +1,10 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import com.baeldung.dependency.ArbitraryDependency; import com.baeldung.dependency.YetAnotherArbitraryDependency; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; @Configuration public class ApplicationContextTestInjectName { diff --git a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectQualifier.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectQualifier.java similarity index 93% rename from spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectQualifier.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectQualifier.java index 59af5a91bb..c2a63dac9e 100644 --- a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectQualifier.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectQualifier.java @@ -1,9 +1,10 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import com.baeldung.dependency.AnotherArbitraryDependency; import com.baeldung.dependency.ArbitraryDependency; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; @Configuration public class ApplicationContextTestInjectQualifier { diff --git a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectType.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectType.java similarity index 90% rename from spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectType.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectType.java index 1e1f01f269..15a75b8f2d 100644 --- a/spring-di/src/test/java/com/baeldung/configuration/ApplicationContextTestInjectType.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestInjectType.java @@ -1,9 +1,10 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; -import com.baeldung.dependency.ArbitraryDependency; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import com.baeldung.dependency.ArbitraryDependency; + @Configuration public class ApplicationContextTestInjectType { diff --git a/spring-core/src/test/java/com/baeldung/configuration/ApplicationContextTestResourceNameType.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestResourceNameType.java similarity index 89% rename from spring-core/src/test/java/com/baeldung/configuration/ApplicationContextTestResourceNameType.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestResourceNameType.java index cb1b5981e8..708ade7647 100644 --- a/spring-core/src/test/java/com/baeldung/configuration/ApplicationContextTestResourceNameType.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestResourceNameType.java @@ -1,4 +1,4 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-core/src/test/java/com/baeldung/configuration/ApplicationContextTestResourceQualifier.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestResourceQualifier.java similarity index 92% rename from spring-core/src/test/java/com/baeldung/configuration/ApplicationContextTestResourceQualifier.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestResourceQualifier.java index c9aa2f4a7d..87864b183e 100644 --- a/spring-core/src/test/java/com/baeldung/configuration/ApplicationContextTestResourceQualifier.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/ApplicationContextTestResourceQualifier.java @@ -1,4 +1,4 @@ -package com.baeldung.configuration; +package com.baeldung.wiring.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-di/src/test/java/com/baeldung/autowired/FieldAutowiredIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldAutowiredIntegrationTest.java similarity index 87% rename from spring-di/src/test/java/com/baeldung/autowired/FieldAutowiredIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldAutowiredIntegrationTest.java index a78799f1d9..f3f065ed4d 100644 --- a/spring-di/src/test/java/com/baeldung/autowired/FieldAutowiredIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldAutowiredIntegrationTest.java @@ -1,7 +1,8 @@ -package com.baeldung.autowired; +package com.baeldung.wiring.configuration.autowired; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; -import com.baeldung.configuration.ApplicationContextTestAutowiredType; -import com.baeldung.dependency.ArbitraryDependency; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -9,8 +10,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.dependency.ArbitraryDependency; +import com.baeldung.wiring.configuration.ApplicationContextTestAutowiredType; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( diff --git a/spring-di/src/test/java/com/baeldung/autowired/FieldAutowiredNameIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldAutowiredNameIntegrationTest.java similarity index 88% rename from spring-di/src/test/java/com/baeldung/autowired/FieldAutowiredNameIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldAutowiredNameIntegrationTest.java index 8f09e73c33..199241c7e2 100644 --- a/spring-di/src/test/java/com/baeldung/autowired/FieldAutowiredNameIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldAutowiredNameIntegrationTest.java @@ -1,7 +1,8 @@ -package com.baeldung.autowired; +package com.baeldung.wiring.configuration.autowired; -import com.baeldung.configuration.ApplicationContextTestAutowiredName; import com.baeldung.dependency.ArbitraryDependency; +import com.baeldung.wiring.configuration.ApplicationContextTestAutowiredName; + import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-di/src/test/java/com/baeldung/autowired/FieldQualifierAutowiredIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldQualifierAutowiredIntegrationTest.java similarity index 91% rename from spring-di/src/test/java/com/baeldung/autowired/FieldQualifierAutowiredIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldQualifierAutowiredIntegrationTest.java index 01317aef6f..081fbf24ad 100644 --- a/spring-di/src/test/java/com/baeldung/autowired/FieldQualifierAutowiredIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/autowired/FieldQualifierAutowiredIntegrationTest.java @@ -1,7 +1,8 @@ -package com.baeldung.autowired; +package com.baeldung.wiring.configuration.autowired; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; -import com.baeldung.configuration.ApplicationContextTestAutowiredQualifier; -import com.baeldung.dependency.ArbitraryDependency; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -10,8 +11,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.dependency.ArbitraryDependency; +import com.baeldung.wiring.configuration.ApplicationContextTestAutowiredQualifier; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( diff --git a/spring-di/src/test/java/com/baeldung/inject/FieldByNameInjectIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldByNameInjectIntegrationTest.java similarity index 89% rename from spring-di/src/test/java/com/baeldung/inject/FieldByNameInjectIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldByNameInjectIntegrationTest.java index f5897febab..d1a75d73ea 100644 --- a/spring-di/src/test/java/com/baeldung/inject/FieldByNameInjectIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldByNameInjectIntegrationTest.java @@ -1,18 +1,19 @@ -package com.baeldung.inject; +package com.baeldung.wiring.configuration.inject; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import javax.inject.Inject; +import javax.inject.Named; -import com.baeldung.configuration.ApplicationContextTestInjectName; -import com.baeldung.dependency.ArbitraryDependency; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import javax.inject.Inject; -import javax.inject.Named; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.dependency.ArbitraryDependency; +import com.baeldung.wiring.configuration.ApplicationContextTestInjectName; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( diff --git a/spring-di/src/test/java/com/baeldung/inject/FieldInjectIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldInjectIntegrationTest.java similarity index 88% rename from spring-di/src/test/java/com/baeldung/inject/FieldInjectIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldInjectIntegrationTest.java index 45b7c8015c..995f560701 100644 --- a/spring-di/src/test/java/com/baeldung/inject/FieldInjectIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldInjectIntegrationTest.java @@ -1,17 +1,18 @@ -package com.baeldung.inject; +package com.baeldung.wiring.configuration.inject; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import javax.inject.Inject; -import com.baeldung.configuration.ApplicationContextTestInjectType; -import com.baeldung.dependency.ArbitraryDependency; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import javax.inject.Inject; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.dependency.ArbitraryDependency; +import com.baeldung.wiring.configuration.ApplicationContextTestInjectType; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( diff --git a/spring-di/src/test/java/com/baeldung/inject/FieldQualifierInjectIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldQualifierInjectIntegrationTest.java similarity index 91% rename from spring-di/src/test/java/com/baeldung/inject/FieldQualifierInjectIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldQualifierInjectIntegrationTest.java index 0fd6a0e4c1..67fa2bf3d4 100644 --- a/spring-di/src/test/java/com/baeldung/inject/FieldQualifierInjectIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/inject/FieldQualifierInjectIntegrationTest.java @@ -1,7 +1,10 @@ -package com.baeldung.inject; +package com.baeldung.wiring.configuration.inject; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import javax.inject.Inject; -import com.baeldung.configuration.ApplicationContextTestInjectQualifier; -import com.baeldung.dependency.ArbitraryDependency; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Qualifier; @@ -9,10 +12,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import javax.inject.Inject; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.dependency.ArbitraryDependency; +import com.baeldung.wiring.configuration.ApplicationContextTestInjectQualifier; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader = AnnotationConfigContextLoader.class, diff --git a/spring-core/src/test/java/com/baeldung/resource/FieldResourceInjectionIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/FieldResourceInjectionIntegrationTest.java similarity index 86% rename from spring-core/src/test/java/com/baeldung/resource/FieldResourceInjectionIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/FieldResourceInjectionIntegrationTest.java index 63a25cb499..938d557939 100644 --- a/spring-core/src/test/java/com/baeldung/resource/FieldResourceInjectionIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/FieldResourceInjectionIntegrationTest.java @@ -1,17 +1,19 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.io.File; + +import javax.annotation.Resource; -import com.baeldung.configuration.ApplicationContextTestResourceNameType; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import javax.annotation.Resource; -import java.io.File; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceNameType; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( diff --git a/spring-core/src/test/java/com/baeldung/resource/MethodByQualifierResourceIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodByQualifierResourceIntegrationTest.java similarity index 91% rename from spring-core/src/test/java/com/baeldung/resource/MethodByQualifierResourceIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodByQualifierResourceIntegrationTest.java index f5bb9f10cf..f49bf70aba 100644 --- a/spring-core/src/test/java/com/baeldung/resource/MethodByQualifierResourceIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodByQualifierResourceIntegrationTest.java @@ -1,6 +1,5 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; -import com.baeldung.configuration.ApplicationContextTestResourceQualifier; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Qualifier; @@ -8,6 +7,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceQualifier; + import javax.annotation.Resource; import java.io.File; diff --git a/spring-core/src/test/java/com/baeldung/resource/MethodByTypeResourceIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodByTypeResourceIntegrationTest.java similarity index 87% rename from spring-core/src/test/java/com/baeldung/resource/MethodByTypeResourceIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodByTypeResourceIntegrationTest.java index 171cbfea47..aecd02a1d5 100644 --- a/spring-core/src/test/java/com/baeldung/resource/MethodByTypeResourceIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodByTypeResourceIntegrationTest.java @@ -1,12 +1,13 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; -import com.baeldung.configuration.ApplicationContextTestResourceNameType; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceNameType; + import javax.annotation.Resource; import java.io.File; diff --git a/spring-core/src/test/java/com/baeldung/resource/MethodResourceInjectionIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodResourceInjectionIntegrationTest.java similarity index 88% rename from spring-core/src/test/java/com/baeldung/resource/MethodResourceInjectionIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodResourceInjectionIntegrationTest.java index 2e1c3c39a9..4ef9368c28 100644 --- a/spring-core/src/test/java/com/baeldung/resource/MethodResourceInjectionIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/MethodResourceInjectionIntegrationTest.java @@ -1,12 +1,13 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; -import com.baeldung.configuration.ApplicationContextTestResourceNameType; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceNameType; + import javax.annotation.Resource; import java.io.File; diff --git a/spring-core/src/test/java/com/baeldung/resource/NamedResourceIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/NamedResourceIntegrationTest.java similarity index 86% rename from spring-core/src/test/java/com/baeldung/resource/NamedResourceIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/NamedResourceIntegrationTest.java index d52660e9b8..4339194f63 100644 --- a/spring-core/src/test/java/com/baeldung/resource/NamedResourceIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/NamedResourceIntegrationTest.java @@ -1,12 +1,13 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; -import com.baeldung.configuration.ApplicationContextTestResourceNameType; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceNameType; + import javax.annotation.Resource; import java.io.File; diff --git a/spring-core/src/test/java/com/baeldung/resource/QualifierResourceInjectionIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/QualifierResourceInjectionIntegrationTest.java similarity index 90% rename from spring-core/src/test/java/com/baeldung/resource/QualifierResourceInjectionIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/QualifierResourceInjectionIntegrationTest.java index 3f812350c9..cc8c669757 100644 --- a/spring-core/src/test/java/com/baeldung/resource/QualifierResourceInjectionIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/QualifierResourceInjectionIntegrationTest.java @@ -1,6 +1,5 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; -import com.baeldung.configuration.ApplicationContextTestResourceQualifier; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Qualifier; @@ -8,6 +7,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceQualifier; + import javax.annotation.Resource; import java.io.File; diff --git a/spring-core/src/test/java/com/baeldung/resource/SetterResourceInjectionIntegrationTest.java b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/SetterResourceInjectionIntegrationTest.java similarity index 88% rename from spring-core/src/test/java/com/baeldung/resource/SetterResourceInjectionIntegrationTest.java rename to spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/SetterResourceInjectionIntegrationTest.java index ae13b2336a..90c8677bff 100644 --- a/spring-core/src/test/java/com/baeldung/resource/SetterResourceInjectionIntegrationTest.java +++ b/spring-di-2/src/test/java/com/baeldung/wiring/configuration/resource/SetterResourceInjectionIntegrationTest.java @@ -1,12 +1,13 @@ -package com.baeldung.resource; +package com.baeldung.wiring.configuration.resource; -import com.baeldung.configuration.ApplicationContextTestResourceNameType; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.wiring.configuration.ApplicationContextTestResourceNameType; + import javax.annotation.Resource; import java.io.File; diff --git a/spring-di/README.md b/spring-di/README.md index 7571b12916..d470768f16 100644 --- a/spring-di/README.md +++ b/spring-di/README.md @@ -13,3 +13,5 @@ This module contains articles about dependency injection with Spring - [Controlling Bean Creation Order with @DependsOn Annotation](https://www.baeldung.com/spring-depends-on) - [Unsatisfied Dependency in Spring](https://www.baeldung.com/spring-unsatisfied-dependency) - [Circular Dependencies in Spring](https://www.baeldung.com/circular-dependencies-in-spring) +- [XML-Based Injection in Spring](https://www.baeldung.com/spring-xml-injection) +- More articles: [[next -->]](/spring-di-2) diff --git a/spring-di/pom.xml b/spring-di/pom.xml index d556bcd9a4..48cdf60673 100644 --- a/spring-di/pom.xml +++ b/spring-di/pom.xml @@ -68,11 +68,6 @@ spring-boot-starter ${spring-boot.version} - - org.springframework.boot - spring-boot-starter-data-jpa - ${spring-boot.version} - org.springframework.boot spring-boot-test @@ -95,11 +90,7 @@ aspectjweaver ${aspectjweaver.version} - - org.springframework - spring-aspects - ${spring.version} - + @@ -138,27 +129,6 @@ false - - org.codehaus.mojo - aspectj-maven-plugin - ${aspectj-plugin.version} - - ${java.version} - - - org.springframework - spring-aspects - - - - - - - compile - - - - @@ -194,7 +164,6 @@ 1.10.19 3.12.2 1.9.5 - 1.11 \ No newline at end of file diff --git a/spring-dispatcher-servlet/pom.xml b/spring-dispatcher-servlet/pom.xml index 9b9f7fb4c6..46e40722f1 100644 --- a/spring-dispatcher-servlet/pom.xml +++ b/spring-dispatcher-servlet/pom.xml @@ -63,7 +63,7 @@ org.springframework.boot spring-boot-starter-test - 1.5.10.RELEASE + ${spring-boot-starter-test.version} test diff --git a/spring-ejb/ejb-beans/pom.xml b/spring-ejb/ejb-beans/pom.xml index c9edfc21f8..299de584ef 100644 --- a/spring-ejb/ejb-beans/pom.xml +++ b/spring-ejb/ejb-beans/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.baeldung.singletonsession ejb-beans - spring-ejb-beans + ejb-beans com.baeldung.spring.ejb @@ -31,7 +31,6 @@ javaee-api provided - org.apache.openejb tomee-embedded @@ -81,6 +80,62 @@ + + wildfly-managed-arquillian + + true + + + + org.wildfly + wildfly-arquillian-container-managed + ${wildfly.version} + test + + + + + + + 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} + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + always + + + + + arquillian-glassfish-embedded @@ -117,12 +172,15 @@ 1.7.5 3.1.2 1.0.0.CR4 + 8.2.1.Final 3.2 5.2.3.RELEASE 5.10.2 5.13.1 2.21.0 1.8.5 + 2.8 + 8.2.1.Final diff --git a/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java b/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java index a970ef90ae..f74d62c36a 100644 --- a/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java +++ b/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java @@ -6,6 +6,7 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,6 +18,7 @@ import javax.inject.Inject; @RunWith(Arquillian.class) +@Ignore("Will be fixed in BAEL-4422") public class StatelessEJBIntegrationTest { @Inject diff --git a/spring-ejb/ejb-beans/src/test/resources/arquillian.xml b/spring-ejb/ejb-beans/src/test/resources/arquillian.xml new file mode 100644 index 0000000000..3316f41f7c --- /dev/null +++ b/spring-ejb/ejb-beans/src/test/resources/arquillian.xml @@ -0,0 +1,23 @@ + + + + + target/wildfly-8.2.1.Final + standalone.xml + true + 9990 + -Djboss.http.port=8734 + + + + + + 127.0.0.1 + 9990 + admin + pass + true + + + + \ No newline at end of file diff --git a/spring-ejb/spring-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/EJBSetupLiveTest.java similarity index 69% rename from spring-ejb/spring-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/EJBSetupLiveTest.java index c04a649d26..e85d2f155a 100644 --- a/spring-ejb/spring-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/EJBSetupLiveTest.java @@ -6,7 +6,12 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; -public class EJBSetupIntegrationTest { +/** + * This Live Test requires: + * * run the `spring-ejb-remote` module with the following command: `mvn clean package cargo:run -Pwildfly-standalone` + * + */ +public class EJBSetupLiveTest { @Test public void EJBClientTest() { diff --git a/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java b/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationLiveTest.java similarity index 74% rename from spring-ejb/spring-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/TextApplicationLiveTest.java index 8dff116ca1..616811eae6 100644 --- a/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java +++ b/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationLiveTest.java @@ -8,7 +8,12 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import static org.junit.Assert.*; -public class TextApplicationIntegrationTest { +/** + * This Live Test requires: + * * run the `spring-ejb-remote` module with the following command: `mvn clean package cargo:run -Pwildfly-standalone` + * + */ +public class TextApplicationLiveTest { private static ByteArrayOutputStream outContent; @@ -26,6 +31,6 @@ public class TextApplicationIntegrationTest { @Test public void givenInputString_whenCompareTtoStringPrintedToConsole_thenSuccessful() throws NamingException { TextApplication.main(new String[]{}); - assertEquals("SAMPLE TEXT", outContent.toString()); + assertTrue(outContent.toString().contains("SAMPLE TEXT")); } } \ No newline at end of file diff --git a/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/springejbclient/SpringEjbClientApplicationIntegrationTest.java b/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/springejbclient/SpringEjbClientApplicationIntegrationTest.java deleted file mode 100644 index 89c88fe5a5..0000000000 --- a/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/springejbclient/SpringEjbClientApplicationIntegrationTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.springejbclient; - -import org.junit.Test; - -public class SpringEjbClientApplicationIntegrationTest { - - @Test - public void contextLoads() { - } - -} diff --git a/spring-integration/pom.xml b/spring-integration/pom.xml index a985f55d89..11b2803095 100644 --- a/spring-integration/pom.xml +++ b/spring-integration/pom.xml @@ -117,7 +117,6 @@ - UTF-8 5.0.13.RELEASE 1.1.4.RELEASE 1.4.7 diff --git a/spring-mvc-basics-2/README.md b/spring-mvc-basics-2/README.md index 5c1c671f73..cbc9f93e93 100644 --- a/spring-mvc-basics-2/README.md +++ b/spring-mvc-basics-2/README.md @@ -7,7 +7,6 @@ This module contains articles about Spring MVC - [Template Engines for Spring](https://www.baeldung.com/spring-template-engines) - [Spring 5 and Servlet 4 – The PushBuilder](https://www.baeldung.com/spring-5-push) - [Servlet Redirect vs Forward](https://www.baeldung.com/servlet-redirect-forward) -- [Apache Tiles Integration with Spring MVC](https://www.baeldung.com/spring-mvc-apache-tiles) - [Guide to Spring Email](https://www.baeldung.com/spring-email) - [Using ThymeLeaf and FreeMarker Emails Templates with Spring](https://www.baeldung.com/spring-email-templates) - [Request Method Not Supported (405) in Spring](https://www.baeldung.com/spring-request-method-not-supported-405) diff --git a/spring-mvc-basics-2/pom.xml b/spring-mvc-basics-2/pom.xml index 4c3041a209..026ddf8e72 100644 --- a/spring-mvc-basics-2/pom.xml +++ b/spring-mvc-basics-2/pom.xml @@ -99,12 +99,6 @@ ${jade.version} - - org.apache.tiles - tiles-jsp - ${apache-tiles.version} - - org.springframework @@ -178,7 +172,6 @@ 1.4.9 5.1.0 20180130 - 3.0.8 1.6.1 diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/WebInitializer.java b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/WebInitializer.java index 4d43549440..aaa2443105 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/WebInitializer.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/WebInitializer.java @@ -23,8 +23,6 @@ public class WebInitializer implements WebApplicationInitializer { ctx.register(EmailConfiguration.class); // ctx.setServletContext(container); - //ctx.register(TilesApplicationConfiguration.class); - // Manage the lifecycle of the root application context container.addListener(new ContextLoaderListener(ctx)); diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java index 0592415ab5..cbcb8f4e34 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java @@ -30,11 +30,13 @@ import freemarker.template.TemplateException; @Service("EmailService") public class EmailServiceImpl implements EmailService { + private static final String NOREPLY_ADDRESS = "noreply@baeldung.com"; + @Autowired - public JavaMailSender emailSender; - + private JavaMailSender emailSender; + @Autowired - public SimpleMailMessage template; + private SimpleMailMessage template; @Autowired private SpringTemplateEngine thymeleafTemplateEngine; @@ -43,11 +45,12 @@ public class EmailServiceImpl implements EmailService { private FreeMarkerConfigurer freemarkerConfigurer; @Value("classpath:/mail-logo.png") - Resource resourceFile; + private Resource resourceFile; public void sendSimpleMessage(String to, String subject, String text) { try { SimpleMailMessage message = new SimpleMailMessage(); + message.setFrom(NOREPLY_ADDRESS); message.setTo(to); message.setSubject(subject); message.setText(text); @@ -76,6 +79,7 @@ public class EmailServiceImpl implements EmailService { // pass 'true' to the constructor to create a multipart message MimeMessageHelper helper = new MimeMessageHelper(message, true); + helper.setFrom(NOREPLY_ADDRESS); helper.setTo(to); helper.setSubject(subject); helper.setText(text); @@ -118,12 +122,12 @@ public class EmailServiceImpl implements EmailService { MimeMessage message = emailSender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message, true, "UTF-8"); + helper.setFrom(NOREPLY_ADDRESS); helper.setTo(to); helper.setSubject(subject); helper.setText(htmlBody, true); helper.addInline("attachment.png", resourceFile); emailSender.send(message); - } } diff --git a/spring-mvc-crash/pom.xml b/spring-mvc-crash/pom.xml index d23e18361b..8a902d4937 100644 --- a/spring-mvc-crash/pom.xml +++ b/spring-mvc-crash/pom.xml @@ -5,7 +5,7 @@ 4.0.0 spring-mvc-crash 0.1-SNAPSHOT - spring-mvc-xml + spring-mvc-crash war diff --git a/spring-mvc-forms-jsp/pom.xml b/spring-mvc-forms-jsp/pom.xml index 2bab93908f..4e1c2516f6 100644 --- a/spring-mvc-forms-jsp/pom.xml +++ b/spring-mvc-forms-jsp/pom.xml @@ -64,7 +64,7 @@ org.springframework.boot spring-boot-starter-test - 1.5.10.RELEASE + ${spring-boot-starter-test.version} test diff --git a/spring-mvc-java-2/README.md b/spring-mvc-java-2/README.md index 09c8d8b294..42fa056b99 100644 --- a/spring-mvc-java-2/README.md +++ b/spring-mvc-java-2/README.md @@ -3,4 +3,6 @@ - [Cache Headers in Spring MVC](https://www.baeldung.com/spring-mvc-cache-headers) - [Working with Date Parameters in Spring](https://www.baeldung.com/spring-date-parameters) - [Spring MVC @PathVariable with a dot (.) gets truncated](https://www.baeldung.com/spring-mvc-pathvariable-dot) -- [A Quick Guide to Spring MVC Matrix Variables](https://www.baeldung.com/spring-mvc-matrix-variables) \ No newline at end of file +- [A Quick Guide to Spring MVC Matrix Variables](https://www.baeldung.com/spring-mvc-matrix-variables) +- [Converting a Spring MultipartFile to a File](https://www.baeldung.com/spring-multipartfile-to-file) +- [Testing a Spring Multipart POST Request](https://www.baeldung.com/spring-multipart-post-request-test) diff --git a/spring-mvc-java-2/pom.xml b/spring-mvc-java-2/pom.xml index af622321cb..533a24771a 100644 --- a/spring-mvc-java-2/pom.xml +++ b/spring-mvc-java-2/pom.xml @@ -31,6 +31,11 @@ jackson-databind ${jackson.version} + + commons-io + commons-io + ${commons-io.version} + @@ -49,4 +54,4 @@ - \ No newline at end of file + diff --git a/spring-mvc-java-2/src/main/java/com/baeldung/multiparttesting/MultipartPostRequestController.java b/spring-mvc-java-2/src/main/java/com/baeldung/multiparttesting/MultipartPostRequestController.java new file mode 100644 index 0000000000..d624ea368f --- /dev/null +++ b/spring-mvc-java-2/src/main/java/com/baeldung/multiparttesting/MultipartPostRequestController.java @@ -0,0 +1,17 @@ +package com.baeldung.multiparttesting; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class MultipartPostRequestController { + + @PostMapping(path = "/upload") + public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file) { + return file.isEmpty() ? new ResponseEntity(HttpStatus.NOT_FOUND) : new ResponseEntity(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/spring-mvc-java-2/src/main/resources/targetFile.tmp b/spring-mvc-java-2/src/main/resources/targetFile.tmp new file mode 100644 index 0000000000..5e1c309dae --- /dev/null +++ b/spring-mvc-java-2/src/main/resources/targetFile.tmp @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/spring-mvc-java-2/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileUnitTest.java b/spring-mvc-java-2/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileUnitTest.java new file mode 100644 index 0000000000..786f2355c1 --- /dev/null +++ b/spring-mvc-java-2/src/test/java/com/baeldung/multipart/file/ConvertMultipartFileUnitTest.java @@ -0,0 +1,73 @@ +package com.baeldung.multipart.file; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.apache.commons.io.FileUtils; +import org.junit.Test; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.web.multipart.MultipartFile; + +public class ConvertMultipartFileUnitTest { + + /** + * Example of converting a {@link MultipartFile} to a {@link File} using {@link MultipartFile#getBytes()}. + * + * @throws IOException + */ + @Test + public void whenGetBytes_thenOK() throws IOException { + MultipartFile multipartFile = new MockMultipartFile("sourceFile.tmp", "Hello World".getBytes()); + + File file = new File("src/main/resources/targetFile.tmp"); + + try (OutputStream os = new FileOutputStream(file)) { + os.write(multipartFile.getBytes()); + } + + assertThat(FileUtils.readFileToString(new File("src/main/resources/targetFile.tmp"), "UTF-8")).isEqualTo("Hello World"); + } + + /** + * Example of converting a {@link MultipartFile} to a {@link File} using {@link MultipartFile#getInputStream()}. + * + * @throws IOException + */ + @Test + public void whenGetInputStream_thenOK() throws IOException { + MultipartFile multipartFile = new MockMultipartFile("sourceFile.tmp", "Hello World".getBytes()); + + InputStream initialStream = multipartFile.getInputStream(); + byte[] buffer = new byte[initialStream.available()]; + initialStream.read(buffer); + + File targetFile = new File("src/main/resources/targetFile.tmp"); + + try (OutputStream outStream = new FileOutputStream(targetFile)) { + outStream.write(buffer); + } + + assertThat(FileUtils.readFileToString(new File("src/main/resources/targetFile.tmp"), "UTF-8")).isEqualTo("Hello World"); + } + + /** + * Example of converting a {@link MultipartFile} to a {@link File} using {@link MultipartFile#transferTo(File)}. + * + * @throws IOException + */ + @Test + public void whenTransferTo_thenOK() throws IllegalStateException, IOException { + MultipartFile multipartFile = new MockMultipartFile("sourceFile.tmp", "Hello World".getBytes()); + + File file = new File("src/main/resources/targetFile.tmp"); + + multipartFile.transferTo(file); + + assertThat(FileUtils.readFileToString(new File("src/main/resources/targetFile.tmp"), "UTF-8")).isEqualTo("Hello World"); + } +} diff --git a/spring-mvc-java-2/src/test/java/com/baeldung/multiparttesting/MultipartPostRequestControllerUnitTest.java b/spring-mvc-java-2/src/test/java/com/baeldung/multiparttesting/MultipartPostRequestControllerUnitTest.java new file mode 100644 index 0000000000..e75990e0b0 --- /dev/null +++ b/spring-mvc-java-2/src/test/java/com/baeldung/multiparttesting/MultipartPostRequestControllerUnitTest.java @@ -0,0 +1,35 @@ +package com.baeldung.multiparttesting; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.test.context.ContextConfiguration; +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.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import com.baeldung.matrix.config.MatrixWebConfig; + +@WebAppConfiguration +@ContextConfiguration(classes = { MatrixWebConfig.class, MultipartPostRequestController.class }) +@RunWith(SpringJUnit4ClassRunner.class) +public class MultipartPostRequestControllerUnitTest { + + @Autowired + private WebApplicationContext webApplicationContext; + + @Test + public void whenFileUploaded_thenVerifyStatus() throws Exception { + MockMultipartFile file = new MockMultipartFile("file", "hello.txt", MediaType.TEXT_PLAIN_VALUE, "Hello, World!".getBytes()); + + MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); + mockMvc.perform(multipart("/upload").file(file)).andExpect(status().isOk()); + } +} \ No newline at end of file diff --git a/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerRealIntegrationTest.java b/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerRealIntegrationTest.java new file mode 100644 index 0000000000..05c6313e76 --- /dev/null +++ b/spring-mvc-java/src/test/java/com/baeldung/web/controller/GreetControllerRealIntegrationTest.java @@ -0,0 +1,34 @@ +package com.baeldung.web.controller; + +import io.restassured.RestAssured; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import static io.restassured.RestAssured.given; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = RANDOM_PORT) +@TestPropertySource(properties = {"spring.main.allow-bean-definition-overriding=true", "server.servlet.context-path=/"}) +public class GreetControllerRealIntegrationTest { + + @LocalServerPort + private int port; + + @Before + public void setUp() { + RestAssured.port = port; + } + + @Test + public void givenGreetURI_whenSendingReq_thenVerifyResponse() { + given().get("/greet") + .then() + .statusCode(200); + } +} diff --git a/spring-mvc-views/README.md b/spring-mvc-views/README.md index 7aa05699f3..0323349130 100644 --- a/spring-mvc-views/README.md +++ b/spring-mvc-views/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Spring MVC Themes](https://www.baeldung.com/spring-mvc-themes) +- [Apache Tiles Integration with Spring MVC](https://www.baeldung.com/spring-mvc-apache-tiles) diff --git a/spring-mvc-views/pom.xml b/spring-mvc-views/pom.xml index b23403fe31..452805bd53 100644 --- a/spring-mvc-views/pom.xml +++ b/spring-mvc-views/pom.xml @@ -74,6 +74,12 @@ spring-security-taglibs ${spring.security.version} + + + org.apache.tiles + tiles-jsp + ${apache-tiles.version} + @@ -115,6 +121,7 @@ 2.5.0 5.4.9.Final enter-location-of-server + 3.0.8 \ No newline at end of file diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/TilesApplicationConfiguration.java b/spring-mvc-views/src/main/java/com/baeldung/themes/config/TilesApplicationConfiguration.java similarity index 93% rename from spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/TilesApplicationConfiguration.java rename to spring-mvc-views/src/main/java/com/baeldung/themes/config/TilesApplicationConfiguration.java index de2b7fe68f..886c8987e8 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/TilesApplicationConfiguration.java +++ b/spring-mvc-views/src/main/java/com/baeldung/themes/config/TilesApplicationConfiguration.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.configuration; +package com.baeldung.themes.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -12,7 +12,7 @@ import org.springframework.web.servlet.view.tiles3.TilesViewResolver; @Configuration @EnableWebMvc -@ComponentScan(basePackages = "com.baeldung.spring.controller.tiles") +@ComponentScan(basePackages = "com.baeldung.themes") public class TilesApplicationConfiguration implements WebMvcConfigurer { /** diff --git a/spring-mvc-views/src/main/java/com/baeldung/themes/config/WebInitializer.java b/spring-mvc-views/src/main/java/com/baeldung/themes/config/WebInitializer.java index 3fbe8d043d..3333d664d7 100644 --- a/spring-mvc-views/src/main/java/com/baeldung/themes/config/WebInitializer.java +++ b/spring-mvc-views/src/main/java/com/baeldung/themes/config/WebInitializer.java @@ -14,6 +14,7 @@ public class WebInitializer implements WebApplicationInitializer { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.register(DataSourceConfig.class); context.register(ThemeMVCConfig.class); + //context.register(TilesApplicationConfiguration.class); servletContext.addListener(new ContextLoaderListener(context)); diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/controller/tiles/TilesController.java b/spring-mvc-views/src/main/java/com/baeldung/themes/controllers/TilesController.java similarity index 94% rename from spring-mvc-basics-2/src/main/java/com/baeldung/spring/controller/tiles/TilesController.java rename to spring-mvc-views/src/main/java/com/baeldung/themes/controllers/TilesController.java index 319340b886..11a3d3d197 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/controller/tiles/TilesController.java +++ b/spring-mvc-views/src/main/java/com/baeldung/themes/controllers/TilesController.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.controller.tiles; +package com.baeldung.themes.controllers; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/pages/apachetiles.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/apachetiles.jsp similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/pages/apachetiles.jsp rename to spring-mvc-views/src/main/webapp/WEB-INF/views/pages/apachetiles.jsp diff --git a/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/home.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/home.jsp new file mode 100644 index 0000000000..47157a5d2a --- /dev/null +++ b/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/home.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Home + + +

    Welcome to Apache Tiles integration with Spring MVC

    + + \ No newline at end of file diff --git a/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/springmvc.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/springmvc.jsp new file mode 100644 index 0000000000..497e04901a --- /dev/null +++ b/spring-mvc-views/src/main/webapp/WEB-INF/views/pages/springmvc.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Spring MVC + + +

    Spring MVC configured to work with Apache Tiles

    + + \ No newline at end of file diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/layouts/defaultLayout.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/layouts/defaultLayout.jsp similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/layouts/defaultLayout.jsp rename to spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/layouts/defaultLayout.jsp diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/templates/defaultFooter.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/templates/defaultFooter.jsp similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/templates/defaultFooter.jsp rename to spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/templates/defaultFooter.jsp diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/templates/defaultHeader.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/templates/defaultHeader.jsp similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/templates/defaultHeader.jsp rename to spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/templates/defaultHeader.jsp diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/templates/defaultMenu.jsp b/spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/templates/defaultMenu.jsp similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/templates/defaultMenu.jsp rename to spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/templates/defaultMenu.jsp diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/tiles.xml b/spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/tiles.xml similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/tiles/tiles.xml rename to spring-mvc-views/src/main/webapp/WEB-INF/views/tiles/tiles.xml diff --git a/spring-mvc-views/src/main/webapp/static/css/app.css b/spring-mvc-views/src/main/webapp/static/css/app.css new file mode 100644 index 0000000000..9976e5406e --- /dev/null +++ b/spring-mvc-views/src/main/webapp/static/css/app.css @@ -0,0 +1,36 @@ +.flex-container { + display: -webkit-flex; + display: flex; + -webkit-flex-flow: row wrap; + flex-flow: row wrap; + text-align: center; +} + +.flex-container > * { + padding: 15px; + -webkit-flex: 1 100%; + flex: 1 100%; +} + +.article { + text-align: left; +} + +header {background: black;color:white;} +footer {background: #aaa;color:white;} +.nav {background:#eee;} + +.nav ul { + list-style-type: none; + padding: 0; +} + +.nav ul a { + text-decoration: none; +} + +@media all and (min-width: 768px) { + .nav {text-align:left;-webkit-flex: 1 auto;flex:1 auto;-webkit-order:1;order:1;} + .article {-webkit-flex:5 0px;flex:5 0px;-webkit-order:2;order:2;} + footer {-webkit-order:3;order:3;} +} \ No newline at end of file diff --git a/spring-mvc-webflow/pom.xml b/spring-mvc-webflow/pom.xml index 22ae3c913d..ab0f86394a 100644 --- a/spring-mvc-webflow/pom.xml +++ b/spring-mvc-webflow/pom.xml @@ -57,7 +57,7 @@ org.springframework.boot spring-boot-starter-test - 1.5.10.RELEASE + ${spring-boot-starter-test.version} test @@ -114,6 +114,7 @@ 2.7 1.6.1 + 1.5.10.RELEASE \ No newline at end of file diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/BurlapClient.java b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/BurlapClient.java index 477c29eb26..1079c4163f 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/BurlapClient.java +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/BurlapClient.java @@ -15,7 +15,7 @@ public class BurlapClient { @Bean public BurlapProxyFactoryBean burlapInvoker() { BurlapProxyFactoryBean invoker = new BurlapProxyFactoryBean(); - invoker.setServiceUrl("http://localhost:8080/b_booking"); + invoker.setServiceUrl("http://localhost:8032/b_booking"); invoker.setServiceInterface(CabBookingService.class); return invoker; } diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/HessianClient.java b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/HessianClient.java index b5f366094e..b2a2f4ffae 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/HessianClient.java +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/src/main/java/com/baeldung/client/HessianClient.java @@ -15,7 +15,7 @@ public class HessianClient { @Bean public HessianProxyFactoryBean hessianInvoker() { HessianProxyFactoryBean invoker = new HessianProxyFactoryBean(); - invoker.setServiceUrl("http://localhost:8080/booking"); + invoker.setServiceUrl("http://localhost:8032/booking"); invoker.setServiceInterface(CabBookingService.class); return invoker; } diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/src/main/java/com/baeldung/server/Server.java b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/src/main/java/com/baeldung/server/Server.java index 9b7e463871..9c825a2a80 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/src/main/java/com/baeldung/server/Server.java +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/src/main/java/com/baeldung/server/Server.java @@ -10,6 +10,8 @@ import org.springframework.remoting.caucho.BurlapServiceExporter; import org.springframework.remoting.caucho.HessianServiceExporter; import org.springframework.remoting.support.RemoteExporter; +import java.util.Collections; + @Configuration @ComponentScan @EnableAutoConfiguration public class Server { @Bean CabBookingService bookingService() { @@ -31,7 +33,9 @@ import org.springframework.remoting.support.RemoteExporter; } public static void main(String[] args) { - SpringApplication.run(Server.class, args); + SpringApplication app = new SpringApplication(Server.class); + app.setDefaultProperties(Collections.singletonMap("server.port", "8032")); + app.run(args); } } \ 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 d8b9701600..2f3f993b2e 100644 --- a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml @@ -30,8 +30,4 @@ - - UTF-8 - - \ No newline at end of file diff --git a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml index 5d6d63219d..53d95edcd7 100644 --- a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml @@ -30,8 +30,4 @@ - - UTF-8 - - \ No newline at end of file diff --git a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml index 94bdccd093..cb5eaa1031 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml @@ -30,8 +30,4 @@ - - UTF-8 - - \ No newline at end of file diff --git a/spring-rest-http/README.md b/spring-rest-http/README.md index f78f8784b0..bb4cfd829d 100644 --- a/spring-rest-http/README.md +++ b/spring-rest-http/README.md @@ -13,4 +13,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping) - [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result) - [Using JSON Patch in Spring REST APIs](https://www.baeldung.com/spring-rest-json-patch) -- [Using OpenAPI and JSON Request Parameters](https://www.baeldung.com/openapi-json-query-parameters) +- [OpenAPI JSON Objects as Query Parameters](https://www.baeldung.com/openapi-json-query-parameters) diff --git a/spring-rest-http/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java b/spring-rest-http/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java index cafd9a38e3..543ba76273 100644 --- a/spring-rest-http/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java +++ b/spring-rest-http/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java @@ -72,7 +72,7 @@ public class FooMappingExamplesController { @RequestMapping(value = "/foos", produces = { "application/json", "application/xml" }) @ResponseBody - public String getFoosAsJsonFromBrowser() { + public String getFoosAsJsonFromREST() { return "Get some Foos with Header New"; } diff --git a/spring-rest-testing/README.md b/spring-rest-testing/README.md index 18bfeddc7c..2a77b5dded 100644 --- a/spring-rest-testing/README.md +++ b/spring-rest-testing/README.md @@ -9,8 +9,10 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: + - [Integration Testing with the Maven Cargo plugin](https://www.baeldung.com/integration-testing-with-the-maven-cargo-plugin) - [Metrics for your Spring REST API](https://www.baeldung.com/spring-rest-api-metrics) +- [Testing Exceptions with Spring MockMvc](https://www.baeldung.com/spring-mvc-test-exceptions) ### Build the Project ``` diff --git a/spring-rest-testing/pom.xml b/spring-rest-testing/pom.xml index d807459cad..9bfe9d83a4 100644 --- a/spring-rest-testing/pom.xml +++ b/spring-rest-testing/pom.xml @@ -141,6 +141,10 @@ com.h2database h2 + + net.bytebuddy + byte-buddy + diff --git a/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/ExceptionTestingApplication.java b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/ExceptionTestingApplication.java new file mode 100644 index 0000000000..facc300dfa --- /dev/null +++ b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/ExceptionTestingApplication.java @@ -0,0 +1,25 @@ +package com.baeldung.exceptiontesting; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * Main Application Class - uses Spring Boot. Just run this as a normal Java + * class to run up a Jetty Server (on http://localhost:8082/spring-rest-full) + * + */ +@EnableScheduling +@EnableAutoConfiguration +@ComponentScan("com.baeldung.exceptiontesting") +@SpringBootApplication +public class ExceptionTestingApplication extends SpringBootServletInitializer { + + public static void main(final String[] args) { + SpringApplication.run(ExceptionTestingApplication.class, args); + } + +} \ No newline at end of file diff --git a/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/controller/ExceptionController.java b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/controller/ExceptionController.java new file mode 100644 index 0000000000..0f458b5f10 --- /dev/null +++ b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/controller/ExceptionController.java @@ -0,0 +1,31 @@ +package com.baeldung.exceptiontesting.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.exceptiontesting.exception.BadArgumentsException; +import com.baeldung.exceptiontesting.exception.InternalException; +import com.baeldung.exceptiontesting.exception.ResourceNotFoundException; + +@RestController +public class ExceptionController { + + @GetMapping("/exception/{exception_id}") + public void getSpecificException(@PathVariable("exception_id") String pException) { + if("not_found".equals(pException)) { + throw new ResourceNotFoundException("resource not found"); + } + else if("bad_arguments".equals(pException)) { + throw new BadArgumentsException("bad arguments"); + } + else { + throw new InternalException("internal error"); + } + } + + @GetMapping("/exception/throw") + public void getException() throws Exception { + throw new Exception("error"); + } +} diff --git a/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/BadArgumentsException.java b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/BadArgumentsException.java new file mode 100644 index 0000000000..1eb1e6a3c9 --- /dev/null +++ b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/BadArgumentsException.java @@ -0,0 +1,13 @@ +package com.baeldung.exceptiontesting.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@SuppressWarnings("serial") +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class BadArgumentsException extends RuntimeException { + + public BadArgumentsException(String message) { + super(message); + } +} diff --git a/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/InternalException.java b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/InternalException.java new file mode 100644 index 0000000000..8e9f0f60f3 --- /dev/null +++ b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/InternalException.java @@ -0,0 +1,13 @@ +package com.baeldung.exceptiontesting.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@SuppressWarnings("serial") +@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) +public class InternalException extends RuntimeException { + + public InternalException(String message) { + super(message); + } +} diff --git a/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/ResourceNotFoundException.java b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/ResourceNotFoundException.java new file mode 100644 index 0000000000..469d5af96f --- /dev/null +++ b/spring-rest-testing/src/main/java/com/baeldung/exceptiontesting/exception/ResourceNotFoundException.java @@ -0,0 +1,13 @@ +package com.baeldung.exceptiontesting.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@SuppressWarnings("serial") +@ResponseStatus(HttpStatus.NOT_FOUND) +public class ResourceNotFoundException extends RuntimeException { + + public ResourceNotFoundException(String message) { + super(message); + } +} diff --git a/spring-rest-testing/src/test/java/com/baeldung/exceptiontesting/controller/ExceptionControllerUnitTest.java b/spring-rest-testing/src/test/java/com/baeldung/exceptiontesting/controller/ExceptionControllerUnitTest.java new file mode 100644 index 0000000000..d624efcdd0 --- /dev/null +++ b/spring-rest-testing/src/test/java/com/baeldung/exceptiontesting/controller/ExceptionControllerUnitTest.java @@ -0,0 +1,65 @@ +package com.baeldung.exceptiontesting.controller; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; + +import com.baeldung.exceptiontesting.controller.ExceptionController; +import com.baeldung.exceptiontesting.exception.BadArgumentsException; +import com.baeldung.exceptiontesting.exception.InternalException; +import com.baeldung.exceptiontesting.exception.ResourceNotFoundException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +@RunWith(SpringRunner.class) +@WebMvcTest(ExceptionController.class) +public class ExceptionControllerUnitTest{ + + @Autowired + private MockMvc mvc; + + @Test + public void givenNotFound_whenGetSpecificException_thenNotFoundCode() throws Exception { + String exceptionParam = "not_found"; + + mvc.perform(get("/exception/{exception_id}", exceptionParam) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isNotFound()) + .andExpect(result -> assertTrue(result.getResolvedException() instanceof ResourceNotFoundException)) + .andExpect(result -> assertEquals("resource not found", result.getResolvedException().getMessage())); + } + + @Test + public void givenBadArguments_whenGetSpecificException_thenBadRequest() throws Exception { + String exceptionParam = "bad_arguments"; + + mvc.perform(get("/exception/{exception_id}", exceptionParam) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andExpect(result -> assertTrue(result.getResolvedException() instanceof BadArgumentsException)) + .andExpect(result -> assertEquals("bad arguments", result.getResolvedException().getMessage())); + } + + @Test + public void givenOther_whenGetSpecificException_thenInternalServerError() throws Exception { + String exceptionParam = "dummy"; + + mvc.perform(get("/exception/{exception_id}", exceptionParam) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isInternalServerError()) + .andExpect(result -> assertTrue(result.getResolvedException() instanceof InternalException)) + .andExpect(result -> assertEquals("internal error", result.getResolvedException().getMessage())); + } + + @Test(expected = Exception.class) + public void whenGetException_thenInternalServerError() throws Exception { + mvc.perform(get("/exception/throw") + .contentType(MediaType.APPLICATION_JSON)); + } +} diff --git a/spring-resttemplate-2/README.md b/spring-resttemplate-2/README.md index e0a394c642..d7a8a8633a 100644 --- a/spring-resttemplate-2/README.md +++ b/spring-resttemplate-2/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring RestTemplate ### Relevant Articles: - +- [Spring RestTemplate Request/Response Logging](https://www.baeldung.com/spring-resttemplate-logging) diff --git a/spring-resttemplate-2/pom.xml b/spring-resttemplate-2/pom.xml index 1a594fd21e..b1d6f60c53 100644 --- a/spring-resttemplate-2/pom.xml +++ b/spring-resttemplate-2/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - spring-resttemplate + spring-resttemplate-2 0.1-SNAPSHOT spring-resttemplate-2 war diff --git a/spring-resttemplate/README.md b/spring-resttemplate/README.md index eef85792ce..bbfda4f6b8 100644 --- a/spring-resttemplate/README.md +++ b/spring-resttemplate/README.md @@ -20,6 +20,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [HTTP PUT vs HTTP PATCH in a REST API](https://www.baeldung.com/http-put-patch-difference-spring) - [A Custom Media Type for a Spring REST API](https://www.baeldung.com/spring-rest-custom-media-type) - [Download an Image or a File with Spring MVC](https://www.baeldung.com/spring-controller-return-image-file) +- [Proxies With RestTemplate](https://www.baeldung.com/java-resttemplate-proxy) ### NOTE: diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index 448574ed19..a3680ade70 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/pom.xml @@ -605,11 +605,9 @@ 2.0.0.RELEASE 8 - UTF-8 1.8 1.5.4 2.1.7.RELEASE - 1.8 1.2.0.RELEASE 1.1.2 3.0.0.RELEASE diff --git a/spring-security-modules/pom.xml b/spring-security-modules/pom.xml index e78b7fe80c..472c6b6e0d 100644 --- a/spring-security-modules/pom.xml +++ b/spring-security-modules/pom.xml @@ -17,9 +17,8 @@ spring-security-acl spring-security-auth0 spring-security-angular/server - spring-security-cache-control + spring-security-config spring-security-core - spring-security-cors spring-security-mvc spring-security-mvc-boot-1 spring-security-mvc-boot-2 diff --git a/spring-security-modules/spring-security-auth0/README.md b/spring-security-modules/spring-security-auth0/README.md new file mode 100644 index 0000000000..57dd12a364 --- /dev/null +++ b/spring-security-modules/spring-security-auth0/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Spring Security With Auth0](https://www.baeldung.com/spring-security-auth0) diff --git a/spring-security-modules/spring-security-cache-control/src/main/resources/logback.xml b/spring-security-modules/spring-security-cache-control/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-modules/spring-security-cache-control/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-security-modules/spring-security-cache-control/README.md b/spring-security-modules/spring-security-config/cache-control/README.md similarity index 100% rename from spring-security-modules/spring-security-cache-control/README.md rename to spring-security-modules/spring-security-config/cache-control/README.md diff --git a/spring-security-modules/spring-security-cache-control/pom.xml b/spring-security-modules/spring-security-config/cache-control/pom.xml similarity index 88% rename from spring-security-modules/spring-security-cache-control/pom.xml rename to spring-security-modules/spring-security-config/cache-control/pom.xml index 743b3c291d..753307493d 100644 --- a/spring-security-modules/spring-security-cache-control/pom.xml +++ b/spring-security-modules/spring-security-config/cache-control/pom.xml @@ -2,15 +2,15 @@ 4.0.0 - spring-security-cache-control + cache-control 1.0-SNAPSHOT - spring-security-cache-control + cache-control com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../../parent-boot-2 + ../../../parent-boot-2 diff --git a/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java b/spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java rename to spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java diff --git a/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java b/spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java rename to spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java diff --git a/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java b/spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java rename to spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java diff --git a/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java b/spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java rename to spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java diff --git a/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java b/spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java rename to spring-security-modules/spring-security-config/cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java diff --git a/apache-meecrowave/src/main/resources/logback.xml b/spring-security-modules/spring-security-config/cache-control/src/main/resources/logback.xml similarity index 100% rename from apache-meecrowave/src/main/resources/logback.xml rename to spring-security-modules/spring-security-config/cache-control/src/main/resources/logback.xml diff --git a/spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-config/cache-control/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-config/cache-control/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java b/spring-security-modules/spring-security-config/cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java similarity index 100% rename from spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java rename to spring-security-modules/spring-security-config/cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java diff --git a/spring-security-modules/spring-security-cors/README.md b/spring-security-modules/spring-security-config/cors/README.md similarity index 100% rename from spring-security-modules/spring-security-cors/README.md rename to spring-security-modules/spring-security-config/cors/README.md diff --git a/spring-security-modules/spring-security-cors/pom.xml b/spring-security-modules/spring-security-config/cors/pom.xml similarity index 87% rename from spring-security-modules/spring-security-cors/pom.xml rename to spring-security-modules/spring-security-config/cors/pom.xml index 2acb99368f..19ca7f5ccc 100644 --- a/spring-security-modules/spring-security-cors/pom.xml +++ b/spring-security-modules/spring-security-config/cors/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - spring-security-cors - spring-security-cors + cors + cors jar Spring Security CORS @@ -56,9 +56,4 @@
    - - UTF-8 - UTF-8 - - diff --git a/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java b/spring-security-modules/spring-security-config/cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java similarity index 100% rename from spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java rename to spring-security-modules/spring-security-config/cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java diff --git a/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java b/spring-security-modules/spring-security-config/cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java similarity index 100% rename from spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-config/cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java diff --git a/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java b/spring-security-modules/spring-security-config/cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java similarity index 100% rename from spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java rename to spring-security-modules/spring-security-config/cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java diff --git a/spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerUnitTest.java b/spring-security-modules/spring-security-config/cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerUnitTest.java similarity index 100% rename from spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerUnitTest.java rename to spring-security-modules/spring-security-config/cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerUnitTest.java diff --git a/spring-security-modules/spring-security-config/pom.xml b/spring-security-modules/spring-security-config/pom.xml new file mode 100644 index 0000000000..b3796d1cc6 --- /dev/null +++ b/spring-security-modules/spring-security-config/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + spring-security-config + 0.0.1-SNAPSHOT + spring-security-conf + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + cache-control + cors + + + diff --git a/spring-security-modules/spring-security-kotlin-dsl/README.md b/spring-security-modules/spring-security-kotlin-dsl/README.md new file mode 100644 index 0000000000..39e521d84e --- /dev/null +++ b/spring-security-modules/spring-security-kotlin-dsl/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Spring Security with Kotlin DSL](https://www.baeldung.com/kotlin/spring-security-dsl) diff --git a/spring-security-modules/spring-security-kotlin-dsl/pom.xml b/spring-security-modules/spring-security-kotlin-dsl/pom.xml index 2c53d19c2c..24e99decfb 100644 --- a/spring-security-modules/spring-security-kotlin-dsl/pom.xml +++ b/spring-security-modules/spring-security-kotlin-dsl/pom.xml @@ -15,11 +15,6 @@ spring-security-kotlin-dsl Spring Security Kotlin DSL - - 11 - 1.3.72 - - org.springframework.boot @@ -83,4 +78,10 @@ + + + 11 + 1.3.72 + + diff --git a/spring-security-modules/spring-security-mvc-boot-2/README.md b/spring-security-modules/spring-security-mvc-boot-2/README.md index 7c53d03698..bbbf514c90 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/README.md +++ b/spring-security-modules/spring-security-mvc-boot-2/README.md @@ -6,9 +6,11 @@ This module contains articles about Spring Security with Spring MVC in Boot appl The "REST With Spring" Classes: http://github.learnspringsecurity.com ### Relevant Articles: + - [Multiple Entry Points in Spring Security](https://www.baeldung.com/spring-security-multiple-entry-points) - [Multiple Authentication Providers in Spring Security](https://www.baeldung.com/spring-security-multiple-auth-providers) - [Two Login Pages with Spring Security](https://www.baeldung.com/spring-security-two-login-pages) - [HTTPS using Self-Signed Certificate in Spring Boot](https://www.baeldung.com/spring-boot-https-self-signed-certificate) - [Spring Security: Exploring JDBC Authentication](https://www.baeldung.com/spring-security-jdbc-authentication) - [Spring Security Custom Logout Handler](https://www.baeldung.com/spring-security-custom-logout-handler) +- [Redirecting Logged-in Users with Spring Security](https://www.baeldung.com/spring-security-redirect-logged-in) diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginPageFilter.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginPageFilter.java new file mode 100644 index 0000000000..3c6d076756 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginPageFilter.java @@ -0,0 +1,43 @@ +package com.baeldung.loginredirect; + +import org.apache.http.HttpStatus; +import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +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.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +class LoginPageFilter extends GenericFilterBean { + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + HttpServletRequest servletRequest = (HttpServletRequest) request; + HttpServletResponse servletResponse = (HttpServletResponse) response; + + if (isAuthenticated() && "/loginUser".equals(servletRequest.getRequestURI())) { + + String encodedRedirectURL = ((HttpServletResponse) response).encodeRedirectURL( + servletRequest.getContextPath() + "/userMainPage"); + + servletResponse.setStatus(HttpStatus.SC_TEMPORARY_REDIRECT); + servletResponse.setHeader("Location", encodedRedirectURL); + } + + chain.doFilter(servletRequest, servletResponse); + } + + private boolean isAuthenticated() { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication == null || AnonymousAuthenticationToken.class.isAssignableFrom(authentication.getClass())) { + return false; + } + return authentication.isAuthenticated(); + } +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginPageInterceptor.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginPageInterceptor.java new file mode 100644 index 0000000000..aa93201f37 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginPageInterceptor.java @@ -0,0 +1,39 @@ +package com.baeldung.loginredirect; + +import org.apache.http.HttpStatus; +import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; +import org.springframework.web.util.UrlPathHelper; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +class LoginPageInterceptor extends HandlerInterceptorAdapter { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + + UrlPathHelper urlPathHelper = new UrlPathHelper(); + if ("/loginUser".equals(urlPathHelper.getLookupPathForRequest(request)) && isAuthenticated()) { + + String encodedRedirectURL = response.encodeRedirectURL( + request.getContextPath() + "/userMainPage"); + response.setStatus(HttpStatus.SC_TEMPORARY_REDIRECT); + response.setHeader("Location", encodedRedirectURL); + + return false; + } else { + return true; + } + } + + private boolean isAuthenticated() { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication == null || AnonymousAuthenticationToken.class.isAssignableFrom(authentication.getClass())) { + return false; + } + return authentication.isAuthenticated(); + } +} diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectApplication.java new file mode 100644 index 0000000000..1e44240449 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.loginredirect; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ImportResource; + +@SpringBootApplication +@ImportResource({"classpath*:spring-security-login-redirect.xml"}) +class LoginRedirectApplication { + public static void main(String[] args) { + SpringApplication.run(LoginRedirectApplication.class, args); + } +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectMvcConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectMvcConfig.java new file mode 100644 index 0000000000..ca2ddcb020 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectMvcConfig.java @@ -0,0 +1,14 @@ +package com.baeldung.loginredirect; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +class LoginRedirectMvcConfig implements WebMvcConfigurer { + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new LoginPageInterceptor()); + } +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectSecurityConfig.java new file mode 100644 index 0000000000..8bd3200608 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/LoginRedirectSecurityConfig.java @@ -0,0 +1,43 @@ +package com.baeldung.loginredirect; + +import org.springframework.context.annotation.Bean; +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; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +@Configuration +@EnableWebSecurity +class LoginRedirectSecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.inMemoryAuthentication().withUser("user").password(encoder().encode("user")).roles("USER"); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + + http + .addFilterAfter(new LoginPageFilter(), UsernamePasswordAuthenticationFilter.class) + + .authorizeRequests() + .antMatchers("/loginUser").permitAll() + .antMatchers("/user*").hasRole("USER") + + .and().formLogin().loginPage("/loginUser").loginProcessingUrl("/user_login") + .failureUrl("/loginUser?error=loginError").defaultSuccessUrl("/userMainPage").permitAll() + + .and().logout().logoutUrl("/user_logout").logoutSuccessUrl("/loginUser").deleteCookies("JSESSIONID") + .and().csrf().disable(); + } + + @Bean + public static PasswordEncoder encoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/UsersController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/UsersController.java new file mode 100644 index 0000000000..308495d2ab --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/loginredirect/UsersController.java @@ -0,0 +1,32 @@ +package com.baeldung.loginredirect; + +import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +class UsersController { + + @GetMapping("/userMainPage") + public String getUserPage() { + return "userMainPage"; + } + + @GetMapping("/loginUser") + public String getUserLoginPage() { + if (isAuthenticated()) { + return "redirect:userMainPage"; + } + return "loginUser"; + } + + private boolean isAuthenticated() { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication == null || AnonymousAuthenticationToken.class.isAssignableFrom(authentication.getClass())) { + return false; + } + return authentication.isAuthenticated(); + } +} diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/resources/spring-security-login-redirect.xml b/spring-security-modules/spring-security-mvc-boot-2/src/main/resources/spring-security-login-redirect.xml new file mode 100644 index 0000000000..e711abce1f --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/resources/spring-security-login-redirect.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/resources/templates/userMainPage.html b/spring-security-modules/spring-security-mvc-boot-2/src/main/resources/templates/userMainPage.html new file mode 100644 index 0000000000..501d019790 --- /dev/null +++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/resources/templates/userMainPage.html @@ -0,0 +1,10 @@ + + + + +Baeldung Login Redirect + + +Welcome user! Logout + + \ No newline at end of file diff --git a/spring-security-modules/spring-security-mvc-socket/pom.xml b/spring-security-modules/spring-security-mvc-socket/pom.xml index ff8cc708e3..6515121f9f 100644 --- a/spring-security-modules/spring-security-mvc-socket/pom.xml +++ b/spring-security-modules/spring-security-mvc-socket/pom.xml @@ -152,7 +152,7 @@ org.springframework.boot spring-boot-starter-test - 1.5.10.RELEASE + ${spring-boot-starter-test.version} test @@ -185,6 +185,7 @@ 4.2.3.RELEASE 1.11.3.RELEASE 1.2.3 + 1.5.10.RELEASE \ No newline at end of file diff --git a/spring-security-modules/spring-security-mvc/pom.xml b/spring-security-modules/spring-security-mvc/pom.xml index 517aa83270..d97825975f 100644 --- a/spring-security-modules/spring-security-mvc/pom.xml +++ b/spring-security-modules/spring-security-mvc/pom.xml @@ -89,11 +89,6 @@ - - 5.2.2.RELEASE - 4.0.1 - - @@ -108,4 +103,9 @@ + + 5.2.2.RELEASE + 4.0.1 + + diff --git a/spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml index 2c0a0bc774..b20151b8f4 100644 --- a/spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml +++ b/spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml @@ -33,6 +33,8 @@ class="com.baeldung.security.MySavedRequestAwareAuthenticationSuccessHandler" /> + diff --git a/spring-security-modules/spring-security-sso/README.md b/spring-security-modules/spring-security-sso/README.md index 23b53521be..4ff5f57a2d 100644 --- a/spring-security-modules/spring-security-sso/README.md +++ b/spring-security-modules/spring-security-sso/README.md @@ -3,5 +3,6 @@ This module contains modules about single-sign-on with Spring Security ### Relevant Articles: -- [Simple Single Sign-On with Spring Security OAuth2](https://www.baeldung.com/sso-spring-security-oauth2) + - [Spring Security Kerberos Integration](https://www.baeldung.com/spring-security-kerberos-integration) +- [Simple Single Sign-On with Spring Security OAuth2 (legacy stack)](https://www.baeldung.com/sso-spring-security-oauth2-legacy) diff --git a/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md index 4bb0eea16c..a6244ec0ad 100644 --- a/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md +++ b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md @@ -1,4 +1,4 @@ ## Relevant articles: -- [Spring Security Kerberos Integration](https://www.baeldung.com/spring-security-kerberos-integration) +- [Spring Security Kerberos Integration With MiniKdc](https://www.baeldung.com/spring-security-kerberos-integration) - [Introduction to SPNEGO/Kerberos Authentication in Spring](https://www.baeldung.com/spring-security-kerberos) diff --git a/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml index 0864ead1c4..a67cc4af83 100644 --- a/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml +++ b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml @@ -11,31 +11,6 @@ 1.0.0-SNAPSHOT
    - - - - ${basedir}/src/main/resources - true - - **/* - - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - - - @ - - false - - - - - org.springframework.boot @@ -92,4 +67,29 @@ + + + + ${basedir}/src/main/resources + true + + **/* + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + @ + + false + + + + + \ No newline at end of file diff --git a/spring-soap/pom.xml b/spring-soap/pom.xml index d0987329c0..137ff03c31 100644 --- a/spring-soap/pom.xml +++ b/spring-soap/pom.xml @@ -83,8 +83,4 @@ - - 2.1.2.RELEASE - - diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml index cc70a9f654..7c6de543ae 100644 --- a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml +++ b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml @@ -31,6 +31,97 @@ + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + + + + junit + junit + ${junit-version} + test + + + @@ -170,98 +261,7 @@ - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - - - org.springframework - spring-web - ${spring-web-version} - - - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - - - - junit - junit - ${junit-version} - test - - - UTF-8 1.5.22 4.3.9.RELEASE 2.10.1 diff --git a/spring-thymeleaf-3/README.md b/spring-thymeleaf-3/README.md index de18771c1e..34bd1b4b35 100644 --- a/spring-thymeleaf-3/README.md +++ b/spring-thymeleaf-3/README.md @@ -3,5 +3,8 @@ This module contains articles about Spring with Thymeleaf ## Relevant Articles: + - [Add CSS and JS to Thymeleaf](https://www.baeldung.com/spring-thymeleaf-css-js) - [Formatting Currencies in Spring Using Thymeleaf](https://www.baeldung.com/spring-thymeleaf-currencies) +- [Working with Select and Option in Thymeleaf](https://www.baeldung.com/thymeleaf-select-option) +- [Conditional CSS Classes in Thymeleaf](https://www.baeldung.com/spring-mvc-thymeleaf-conditional-css-classes) diff --git a/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/option/Student.java b/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/option/Student.java new file mode 100644 index 0000000000..3bb6576096 --- /dev/null +++ b/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/option/Student.java @@ -0,0 +1,60 @@ +package com.baeldung.thymeleaf.option; + +import java.io.Serializable; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + +/** + * + * Simple student POJO with few fields + * + */ +public class Student implements Serializable { + + private static final long serialVersionUID = -8582553475226281591L; + + @NotNull(message = "Student ID is required.") + @Min(value = 1000, message = "Student ID must be at least 4 digits.") + private Integer id; + + @NotNull(message = "Student name is required.") + private String name; + + @NotNull(message = "Student gender is required.") + private Character gender; + + private Float percentage; + + 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; + } + + public Character getGender() { + return gender; + } + + public void setGender(Character gender) { + this.gender = gender; + } + + public Float getPercentage() { + return percentage; + } + + public void setPercentage(Float percentage) { + this.percentage = percentage; + } +} diff --git a/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/option/StudentController.java b/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/option/StudentController.java new file mode 100644 index 0000000000..ac75c8ff3a --- /dev/null +++ b/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/option/StudentController.java @@ -0,0 +1,24 @@ +package com.baeldung.thymeleaf.option; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + + +/** + * Handles requests for the student model. + * + */ +@Controller +public class StudentController { + + + @RequestMapping(value = "/student", method = RequestMethod.GET) + public String addStudent(Model model) { + model.addAttribute("student", new Student()); + return "option/studentForm.html"; + } + + +} diff --git a/spring-thymeleaf-3/src/main/resources/templates/option/studentForm.html b/spring-thymeleaf-3/src/main/resources/templates/option/studentForm.html new file mode 100644 index 0000000000..050ac55fc1 --- /dev/null +++ b/spring-thymeleaf-3/src/main/resources/templates/option/studentForm.html @@ -0,0 +1,42 @@ + + + +Student Form + + +

    Student Form

    +
    +
      +
    • +
    • +
    • +
    • +
    + + + + + + + + + + + + + + + + + +
    +
    + + diff --git a/spring-thymeleaf/README.md b/spring-thymeleaf/README.md index a5c6791609..7c3d4cafa3 100644 --- a/spring-thymeleaf/README.md +++ b/spring-thymeleaf/README.md @@ -13,7 +13,6 @@ This module contains articles about Spring with Thymeleaf - [Conditionals in Thymeleaf](https://www.baeldung.com/spring-thymeleaf-conditionals) - [Iteration in Thymeleaf](https://www.baeldung.com/thymeleaf-iteration) - [Spring with Thymeleaf Pagination for a List](https://www.baeldung.com/spring-thymeleaf-pagination) -- [Working with Select and Option in Thymeleaf](https://www.baeldung.com/thymeleaf-select-option) - [[next -->]](/spring-thymeleaf-2) ### Build the Project diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/model/Page.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/model/Page.java deleted file mode 100644 index e9dd0a8135..0000000000 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/model/Page.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.baeldung.thymeleaf.model; - -import java.util.Collections; -import java.util.List; - -public class Page { - - private List list; - - private int pageSize = 0; - - private int currentPage = 0; - - private int totalPages = 0; - - public Page(List list, int pageSize, int currentPage) { - - if (list.isEmpty()) { - this.list = list; - } - - if (pageSize <= 0 || pageSize > list.size() || currentPage <= 0) { - throw new IllegalArgumentException("invalid page size or current page!"); - } - - this.pageSize = pageSize; - - this.currentPage = currentPage; - - if (list.size() % pageSize == 0) { - this.totalPages = list.size() / pageSize; - } else { - this.totalPages = list.size() / pageSize + 1; - } - - int startItem = (currentPage - 1) * pageSize; - if (list.size() < startItem) { - this.list = Collections.emptyList(); - } - - int toIndex = Math.min(startItem + pageSize, list.size()); - this.list = list.subList(startItem, toIndex); - } - - public List getList() { - return list; - } - - public int getPageSize() { - return pageSize; - } - - public int getCurrentPage() { - return currentPage; - } - - public int getTotalPages() { - return totalPages; - } - -} diff --git a/spring-vault/pom.xml b/spring-vault/pom.xml index 40967e2894..a39c5575a9 100644 --- a/spring-vault/pom.xml +++ b/spring-vault/pom.xml @@ -38,7 +38,6 @@ - UTF-8 2.1.1.RELEASE diff --git a/structurizr/pom.xml b/structurizr/pom.xml index f1b4355dcf..b8efba0937 100644 --- a/structurizr/pom.xml +++ b/structurizr/pom.xml @@ -42,7 +42,7 @@ 1.8 1.8 - 1.0.0-RC5 + 1.0.0 \ No newline at end of file diff --git a/structurizr/src/main/java/com/baeldung/structurizr/StructurizrSimple.java b/structurizr/src/main/java/com/baeldung/structurizr/StructurizrSimple.java index b33a1d9a77..3f52ea657f 100644 --- a/structurizr/src/main/java/com/baeldung/structurizr/StructurizrSimple.java +++ b/structurizr/src/main/java/com/baeldung/structurizr/StructurizrSimple.java @@ -2,6 +2,8 @@ package com.baeldung.structurizr; import java.io.File; import java.io.StringWriter; +import java.util.HashSet; +import java.util.Set; import com.structurizr.Workspace; import com.structurizr.analysis.ComponentFinder; @@ -40,15 +42,31 @@ public class StructurizrSimple { addContainers(workspace); addComponents(workspace); addSpringComponents(workspace); - exportToPlantUml(workspace.getViews().getViewWithKey(SOFTWARE_SYSTEM_VIEW)); - exportToPlantUml(workspace.getViews().getViewWithKey(CONTAINER_VIEW)); - exportToPlantUml(workspace.getViews().getViewWithKey(COMPONENT_VIEW)); + exportToPlantUml(findViewWithKey(workspace.getViews(), SOFTWARE_SYSTEM_VIEW)); + exportToPlantUml(findViewWithKey(workspace.getViews(), CONTAINER_VIEW)); + exportToPlantUml(findViewWithKey(workspace.getViews(), COMPONENT_VIEW)); - exportToPlantUml(workspace.getViews().getViewWithKey(JVM2_COMPONENT_VIEW)); + exportToPlantUml(findViewWithKey(workspace.getViews(), JVM2_COMPONENT_VIEW)); addStyles(workspace.getViews()); //uploadToExternal(workspace); } + + private static View findViewWithKey(ViewSet viewSet, String key) { + if (key == null) { + throw new IllegalArgumentException("A key must be specified."); + } + + Set views = new HashSet<>(); + views.addAll(viewSet.getSystemLandscapeViews()); + views.addAll(viewSet.getSystemContextViews()); + views.addAll(viewSet.getContainerViews()); + views.addAll(viewSet.getComponentViews()); + views.addAll(viewSet.getDynamicViews()); + views.addAll(viewSet.getDeploymentViews()); + + return views.stream().filter(v -> key.equals(v.getKey())).findFirst().orElse(null); + } private static void addSpringComponents(Workspace workspace) throws Exception { Container jvm2 = workspace.getModel().getSoftwareSystemWithName(PAYMENT_TERMINAL).getContainerWithName("JVM-2"); diff --git a/testing-modules/assertion-libraries/README.md b/testing-modules/assertion-libraries/README.md index ca4cc86f7e..5be5c7e004 100644 --- a/testing-modules/assertion-libraries/README.md +++ b/testing-modules/assertion-libraries/README.md @@ -10,4 +10,3 @@ - [Custom Assertions with AssertJ](http://www.baeldung.com/assertj-custom-assertion) - [Using Conditions with AssertJ Assertions](http://www.baeldung.com/assertj-conditions) - [AssertJ Exception Assertions](http://www.baeldung.com/assertj-exception-assertion) -- [Asserting Log Messages With JUnit](https://www.baeldung.com/junit-asserting-logs) diff --git a/testing-modules/easymock/pom.xml b/testing-modules/easymock/pom.xml index 4146ae6df4..98458b724d 100644 --- a/testing-modules/easymock/pom.xml +++ b/testing-modules/easymock/pom.xml @@ -23,7 +23,6 @@ - UTF-8 4.0.2 diff --git a/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java b/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java new file mode 100644 index 0000000000..0aa184f2e1 --- /dev/null +++ b/testing-modules/junit-4/src/test/java/com/baeldung/assume/ConditionallyIgnoreTestsUnitTest.java @@ -0,0 +1,41 @@ +package com.baeldung.assume; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assume.assumeFalse; +import static org.junit.Assume.assumeThat; +import static org.junit.Assume.assumeTrue; + +import org.junit.Test; + +public class ConditionallyIgnoreTestsUnitTest { + + + @Test + public void whenAssumeThatCodeVersionIsNot2_thenIgnore() { + final int codeVersion = 1; + assumeThat(codeVersion, is(2)); + + assertEquals("hello", "HELLO".toLowerCase()); + } + + @Test + public void whenAssumeTrueOnCondition_thenIgnore() { + final int codeVersion = 1; + assumeTrue(isCodeVersion2(codeVersion)); + + assertEquals("hello", "HELLO".toLowerCase()); + } + + @Test + public void whenAssumeFalseOnCondition_thenIgnore() { + final int codeVersion = 2; + assumeFalse(isCodeVersion2(codeVersion)); + + assertEquals("hello", "HELLO".toLowerCase()); + } + + private boolean isCodeVersion2(final int codeVersion) { + return codeVersion == 2; + } +} diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index 33fd0bbce8..831fa97e12 100644 --- a/testing-modules/junit-5/pom.xml +++ b/testing-modules/junit-5/pom.xml @@ -138,7 +138,7 @@ 1.4.2 5.4.2 2.8.2 - 2.0.0-RC.1 + 2.0.0 2.22.0 1.6.0 5.0.1.RELEASE diff --git a/testing-modules/parallel-tests-junit/math-test-functions/pom.xml b/testing-modules/parallel-tests-junit/math-test-functions/pom.xml index ba645d00ff..fb12803333 100644 --- a/testing-modules/parallel-tests-junit/math-test-functions/pom.xml +++ b/testing-modules/parallel-tests-junit/math-test-functions/pom.xml @@ -45,8 +45,4 @@ - - UTF-8 - - diff --git a/testing-modules/parallel-tests-junit/string-test-functions/pom.xml b/testing-modules/parallel-tests-junit/string-test-functions/pom.xml index 984dd64ce4..313d82c23f 100644 --- a/testing-modules/parallel-tests-junit/string-test-functions/pom.xml +++ b/testing-modules/parallel-tests-junit/string-test-functions/pom.xml @@ -37,8 +37,4 @@ - - UTF-8 - - diff --git a/testing-modules/powermock/pom.xml b/testing-modules/powermock/pom.xml index 21b2e98af0..39d5f96d0a 100644 --- a/testing-modules/powermock/pom.xml +++ b/testing-modules/powermock/pom.xml @@ -28,6 +28,6 @@ 2.21.0 - 2.0.2 + 2.0.7 \ No newline at end of file diff --git a/testing-modules/selenium-junit-testng/README.md b/testing-modules/selenium-junit-testng/README.md index 8baddd3449..aa3f0e8005 100644 --- a/testing-modules/selenium-junit-testng/README.md +++ b/testing-modules/selenium-junit-testng/README.md @@ -4,3 +4,4 @@ - [Testing with Selenium/WebDriver and the Page Object Pattern](http://www.baeldung.com/selenium-webdriver-page-object) - [Using Cookies With Selenium WebDriver in Java](https://www.baeldung.com/java-selenium-webdriver-cookies) - [Clicking Elements in Selenium using JavaScript](https://www.baeldung.com/java-selenium-javascript) +- [Taking Screenshots With Selenium WebDriver](https://www.baeldung.com/java-selenium-screenshots) diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index 3734bf72c9..8d661997f8 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 selenium-junit-testng 0.0.1-SNAPSHOT @@ -40,35 +41,30 @@ hamcrest-all ${hamcrest-all.version} + + ru.yandex.qatools.ashot + ashot + ${ashot.version} + - src + + + src/main/resources + true + + + src/test/resources + true + + - - - live - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - **/*LiveTest.java - - - - - - - - 6.10 3.4.0 + 1.5.4 diff --git a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/SeleniumExample.java b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/SeleniumExample.java index c5ad5182ff..b32e51d250 100644 --- a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/SeleniumExample.java +++ b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/SeleniumExample.java @@ -1,14 +1,12 @@ -package main.java.com.baeldung.selenium; - -import main.java.com.baeldung.selenium.config.SeleniumConfig; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.interactions.Actions; +package com.baeldung.selenium; import java.util.List; -import java.util.concurrent.TimeUnit; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.baeldung.selenium.config.SeleniumConfig; public class SeleniumExample { @@ -17,15 +15,18 @@ public class SeleniumExample { public SeleniumExample() { config = new SeleniumConfig(); - config.getDriver().get(url); + config.getDriver() + .get(url); } public void closeWindow() { - this.config.getDriver().close(); + this.config.getDriver() + .close(); } public String getTitle() { - return this.config.getDriver().getTitle(); + return this.config.getDriver() + .getTitle(); } public void getAboutBaeldungPage() { @@ -35,29 +36,35 @@ public class SeleniumExample { } private void closeOverlay() { - List webElementList = this.config.getDriver().findElements(By.tagName("a")); + List webElementList = this.config.getDriver() + .findElements(By.tagName("a")); if (webElementList != null) { webElementList.stream() - .filter(webElement -> "Close".equalsIgnoreCase(webElement.getAttribute("title"))) - .filter(WebElement::isDisplayed) - .findAny() - .ifPresent(WebElement::click); + .filter(webElement -> "Close".equalsIgnoreCase(webElement.getAttribute("title"))) + .filter(WebElement::isDisplayed) + .findAny() + .ifPresent(WebElement::click); } } private void clickAboutLink() { - this.config.getDriver().findElement(By.partialLinkText("About")).click(); + Actions actions = new Actions(config.getDriver()); + WebElement aboutElement = this.config.getDriver() + .findElement(By.id("menu-item-6138")); + + actions.moveToElement(aboutElement).perform(); } private void clickAboutUsLink() { - Actions builder = new Actions(config.getDriver()); - WebElement element = this.config.getDriver().findElement(By.partialLinkText("About Baeldung.")); - builder.moveToElement(element).build().perform(); + WebElement element = this.config.getDriver() + .findElement(By.partialLinkText("About Baeldung.")); + element.click(); } public boolean isAuthorInformationAvailable() { return this.config.getDriver() - .findElement(By.cssSelector("article > .row > div")) - .isDisplayed(); + .getPageSource() + .contains("Hey ! I'm Eugen"); } + } diff --git a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/config/SeleniumConfig.java b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/config/SeleniumConfig.java index c84283b76b..b1b7754648 100644 --- a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/config/SeleniumConfig.java +++ b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/config/SeleniumConfig.java @@ -1,17 +1,14 @@ -package main.java.com.baeldung.selenium.config; +package com.baeldung.selenium.config; + +import java.io.File; +import java.util.concurrent.TimeUnit; import org.openqa.selenium.Capabilities; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.remote.DesiredCapabilities; -import java.io.File; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - public class SeleniumConfig { private WebDriver driver; @@ -19,15 +16,17 @@ public class SeleniumConfig { public SeleniumConfig() { Capabilities capabilities = DesiredCapabilities.firefox(); driver = new FirefoxDriver(capabilities); - driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); + driver.manage() + .timeouts() + .implicitlyWait(5, TimeUnit.SECONDS); } static { System.setProperty("webdriver.gecko.driver", findFile("geckodriver.mac")); } - static private String findFile(String filename) { - String paths[] = {"", "bin/", "target/classes"}; // if you have chromedriver somewhere else on the path, then put it here. + private static String findFile(String filename) { + String[] paths = { "", "bin/", "target/classes" }; // if you have chromedriver somewhere else on the path, then put it here. for (String path : paths) { if (new File(path + filename).exists()) return path + filename; @@ -40,7 +39,8 @@ public class SeleniumConfig { } public void navigateTo(String url) { - driver.navigate().to(url); + driver.navigate() + .to(url); } public void clickElement(WebElement element) { diff --git a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/models/BaeldungAbout.java b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/models/BaeldungAbout.java index 838beb5326..580cbd1f2b 100644 --- a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/models/BaeldungAbout.java +++ b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/models/BaeldungAbout.java @@ -1,7 +1,7 @@ -package main.java.com.baeldung.selenium.models; +package com.baeldung.selenium.models; -import main.java.com.baeldung.selenium.config.SeleniumConfig; -import main.java.com.baeldung.selenium.pages.BaeldungAboutPage; +import com.baeldung.selenium.config.SeleniumConfig; +import com.baeldung.selenium.pages.BaeldungAboutPage; import org.openqa.selenium.support.PageFactory; public class BaeldungAbout { diff --git a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungAboutPage.java b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungAboutPage.java index d33cb76398..064462fc10 100644 --- a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungAboutPage.java +++ b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungAboutPage.java @@ -1,4 +1,4 @@ -package main.java.com.baeldung.selenium.pages; +package com.baeldung.selenium.pages; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungHomePage.java b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungHomePage.java index 55a8044375..d901bf3c34 100644 --- a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungHomePage.java +++ b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/BaeldungHomePage.java @@ -1,6 +1,6 @@ -package main.java.com.baeldung.selenium.pages; +package com.baeldung.selenium.pages; -import main.java.com.baeldung.selenium.config.SeleniumConfig; +import com.baeldung.selenium.config.SeleniumConfig; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; @@ -8,7 +8,7 @@ import org.openqa.selenium.support.PageFactory; public class BaeldungHomePage { private SeleniumConfig config; - @FindBy(css=".header--menu > a") + @FindBy(css = ".nav--logo_mobile") private WebElement title; @FindBy(css = ".menu-start-here > a") private WebElement startHere; diff --git a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/StartHerePage.java b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/StartHerePage.java index 4f0ee9edcd..ccc166c351 100644 --- a/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/StartHerePage.java +++ b/testing-modules/selenium-junit-testng/src/main/java/com/baeldung/selenium/pages/StartHerePage.java @@ -1,6 +1,6 @@ -package main.java.com.baeldung.selenium.pages; +package com.baeldung.selenium.pages; -import main.java.com.baeldung.selenium.config.SeleniumConfig; +import com.baeldung.selenium.config.SeleniumConfig; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/clickusingjavascript/SeleniumJavaScriptClickTest.java b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/clickusingjavascript/SeleniumJavaScriptClickLiveTest.java similarity index 74% rename from testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/clickusingjavascript/SeleniumJavaScriptClickTest.java rename to testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/clickusingjavascript/SeleniumJavaScriptClickLiveTest.java index 6d2ab8ef1f..de519a44fc 100644 --- a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/clickusingjavascript/SeleniumJavaScriptClickTest.java +++ b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/clickusingjavascript/SeleniumJavaScriptClickLiveTest.java @@ -1,4 +1,4 @@ -package java.com.baeldung.selenium.clickusingjavascript; +package com.baeldung.selenium.clickusingjavascript; import org.junit.After; import org.junit.Before; @@ -14,16 +14,18 @@ import org.openqa.selenium.support.ui.WebDriverWait; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -public class SeleniumJavaScriptClickTest { +import java.io.File; + +public class SeleniumJavaScriptClickLiveTest { private WebDriver driver; private WebDriverWait wait; @Before public void setUp() { - System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); + System.setProperty("webdriver.chrome.driver", new File("src/main/resources/chromedriver.mac").getAbsolutePath()); driver = new ChromeDriver(); - wait = new WebDriverWait(driver, 5000); + wait = new WebDriverWait(driver, 20); } @After @@ -37,19 +39,21 @@ public class SeleniumJavaScriptClickTest { String title = driver.getTitle(); assertEquals("Baeldung | Java, Spring and Web Development tutorials", title); - wait.until(ExpectedConditions.elementToBeClickable(By.className("menu-search"))); - WebElement searchButton = driver.findElement(By.className("menu-search")); + wait.until(ExpectedConditions.elementToBeClickable(By.className("nav--menu_item_anchor"))); + WebElement searchButton = driver.findElement(By.className("nav--menu_item_anchor")); clickElement(searchButton); wait.until(ExpectedConditions.elementToBeClickable(By.id("search"))); WebElement searchInput = driver.findElement(By.id("search")); searchInput.sendKeys("Selenium"); - wait.until(ExpectedConditions.elementToBeClickable(By.className("btn-search"))); - WebElement seeSearchResultsButton = driver.findElement(By.className("btn-search")); + wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector(".btn-search"))); + WebElement seeSearchResultsButton = driver.findElement(By.cssSelector(".btn-search")); clickElement(seeSearchResultsButton); - int seleniumPostsCount = driver.findElements(By.className("post")).size(); + wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.className("post"))); + int seleniumPostsCount = driver.findElements(By.className("post")) + .size(); assertTrue(seleniumPostsCount > 0); } diff --git a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumCookiesJUnitLiveTest.java b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/cookies/SeleniumCookiesJUnitLiveTest.java similarity index 80% rename from testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumCookiesJUnitLiveTest.java rename to testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/cookies/SeleniumCookiesJUnitLiveTest.java index 0cbbf52454..337e3b85fb 100644 --- a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumCookiesJUnitLiveTest.java +++ b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/cookies/SeleniumCookiesJUnitLiveTest.java @@ -1,4 +1,16 @@ -package test.java.com.baeldung.selenium.junit; +package com.baeldung.selenium.cookies; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; + +import java.io.File; +import java.util.Set; +import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; @@ -9,12 +21,6 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.remote.DesiredCapabilities; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - public class SeleniumCookiesJUnitLiveTest { private WebDriver driver; @@ -22,11 +28,21 @@ public class SeleniumCookiesJUnitLiveTest { @Before public void setUp() { + System.setProperty("webdriver.gecko.driver", findFile("geckodriver.mac")); + Capabilities capabilities = DesiredCapabilities.firefox(); driver = new FirefoxDriver(capabilities); navUrl = "https://baeldung.com"; driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); - System.setProperty("webdriver.gecko.driver", "geckodriver.exe"); + } + + private static String findFile(String filename) { + String[] paths = { "", "bin/", "target/classes" }; // if you have chromedriver somewhere else on the path, then put it here. + for (String path : paths) { + if (new File(path + filename).exists()) + return path + filename; + } + return ""; } @After diff --git a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumWithJUnitLiveTest.java b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumWithJUnitLiveTest.java index b1a4149358..1b1035cc6c 100644 --- a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumWithJUnitLiveTest.java +++ b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumWithJUnitLiveTest.java @@ -1,16 +1,21 @@ -package test.java.com.baeldung.selenium.junit; +package com.baeldung.selenium.junit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; -import main.java.com.baeldung.selenium.SeleniumExample; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import static org.testng.Assert.*; +import com.baeldung.selenium.SeleniumExample; public class SeleniumWithJUnitLiveTest { private static SeleniumExample seleniumExample; - private String expectedTitle = "Baeldung | Java, Spring and Web Development tutorials"; + private String expectedTitle = "About Baeldung | Baeldung"; @BeforeClass public static void setUp() { @@ -18,17 +23,17 @@ public class SeleniumWithJUnitLiveTest { } @AfterClass - public static void tearDown() { + public static void tearDown() throws IOException { seleniumExample.closeWindow(); } @Test public void whenAboutBaeldungIsLoaded_thenAboutEugenIsMentionedOnPage() { - seleniumExample.getAboutBaeldungPage(); - String actualTitle = seleniumExample.getTitle(); - assertNotNull(actualTitle); - assertEquals(expectedTitle, actualTitle); - assertTrue(seleniumExample.isAuthorInformationAvailable()); + seleniumExample.getAboutBaeldungPage(); + String actualTitle = seleniumExample.getTitle(); + assertNotNull(actualTitle); + assertEquals(expectedTitle, actualTitle); + assertTrue(seleniumExample.isAuthorInformationAvailable()); } } diff --git a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumPageObjectLiveTest.java b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/pages/SeleniumPageObjectLiveTest.java similarity index 79% rename from testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumPageObjectLiveTest.java rename to testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/pages/SeleniumPageObjectLiveTest.java index 8493122414..96772821a9 100644 --- a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/junit/SeleniumPageObjectLiveTest.java +++ b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/pages/SeleniumPageObjectLiveTest.java @@ -1,9 +1,9 @@ -package test.java.com.baeldung.selenium.junit; +package com.baeldung.selenium.pages; -import main.java.com.baeldung.selenium.config.SeleniumConfig; -import main.java.com.baeldung.selenium.models.BaeldungAbout; -import main.java.com.baeldung.selenium.pages.BaeldungHomePage; -import main.java.com.baeldung.selenium.pages.StartHerePage; +import com.baeldung.selenium.config.SeleniumConfig; +import com.baeldung.selenium.models.BaeldungAbout; +import com.baeldung.selenium.pages.BaeldungHomePage; +import com.baeldung.selenium.pages.StartHerePage; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/screenshot/TakeScreenShotSeleniumLiveTest.java b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/screenshot/TakeScreenShotSeleniumLiveTest.java new file mode 100644 index 0000000000..cf705bb81f --- /dev/null +++ b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/screenshot/TakeScreenShotSeleniumLiveTest.java @@ -0,0 +1,85 @@ +package com.baeldung.selenium.screenshot; + +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +import javax.imageio.ImageIO; + +import org.apache.commons.io.FileUtils; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Capabilities; +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.remote.DesiredCapabilities; + +import ru.yandex.qatools.ashot.AShot; +import ru.yandex.qatools.ashot.Screenshot; +import ru.yandex.qatools.ashot.coordinates.WebDriverCoordsProvider; +import ru.yandex.qatools.ashot.shooting.ShootingStrategies; + +public class TakeScreenShotSeleniumLiveTest { + + private static ChromeDriver driver; + + @BeforeClass + public static void setUp() { + System.setProperty("webdriver.chrome.driver", resolveResourcePath("chromedriver.mac")); + + Capabilities capabilities = DesiredCapabilities.chrome(); + driver = new ChromeDriver(capabilities); + driver.manage() + .timeouts() + .implicitlyWait(5, TimeUnit.SECONDS); + + driver.get("http://www.google.com/"); + } + + @AfterClass + public static void tearDown() throws IOException { + driver.close(); + + System.clearProperty("webdriver.chrome.driver"); + } + + @Test + public void whenGoogleIsLoaded_thenCaptureScreenshot() throws IOException { + takeScreenshot(resolveTestResourcePath("google-home.png")); + + assertTrue(new File(resolveTestResourcePath("google-home.png")).exists()); + } + + @Test + public void whenGoogleIsLoaded_thenCaptureLogo() throws IOException { + WebElement logo = driver.findElement(By.id("hplogo")); + + Screenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)) + .coordsProvider(new WebDriverCoordsProvider()) + .takeScreenshot(driver, logo); + + ImageIO.write(screenshot.getImage(), "jpg", new File(resolveTestResourcePath("google-logo.png"))); + assertTrue(new File(resolveTestResourcePath("google-logo.png")).exists()); + } + + public void takeScreenshot(String pathname) throws IOException { + File src = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(src, new File(pathname)); + } + + private static String resolveResourcePath(String filename) { + File file = new File("src/main/resources/" + filename); + return file.getAbsolutePath(); + } + + private static String resolveTestResourcePath(String filename) { + File file = new File("src/test/resources/" + filename); + return file.getAbsolutePath(); + } +} diff --git a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/testng/SeleniumWithTestNGLiveTest.java b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/testng/SeleniumWithTestNGLiveTest.java index 94426edc6d..85fa00c0ab 100644 --- a/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/testng/SeleniumWithTestNGLiveTest.java +++ b/testing-modules/selenium-junit-testng/src/test/java/com/baeldung/selenium/testng/SeleniumWithTestNGLiveTest.java @@ -1,16 +1,19 @@ -package test.java.com.baeldung.selenium.testng; +package com.baeldung.selenium.testng; + +import com.baeldung.selenium.SeleniumExample; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; -import main.java.com.baeldung.selenium.SeleniumExample; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; -import static org.testng.Assert.*; - public class SeleniumWithTestNGLiveTest { private SeleniumExample seleniumExample; - private String expectedTitle = "Baeldung | Java, Spring and Web Development tutorials"; + private String expectedTitle = "About Baeldung | Baeldung"; @BeforeSuite public void setUp() { diff --git a/testing-modules/testing-libraries/README.md b/testing-modules/testing-libraries/README.md index b1e1575e63..4db7fb8e7a 100644 --- a/testing-modules/testing-libraries/README.md +++ b/testing-modules/testing-libraries/README.md @@ -10,3 +10,4 @@ - [Cucumber Data Tables](https://www.baeldung.com/cucumber-data-tables) - [Cucumber Background](https://www.baeldung.com/java-cucumber-background) - [Cucumber Hooks](https://www.baeldung.com/java-cucumber-hooks) +- [Unit Testing of System.out.println() with JUnit](https://www.baeldung.com/java-testing-system-out-println) diff --git a/testing-modules/testing-libraries/pom.xml b/testing-modules/testing-libraries/pom.xml index 53b58cee17..aa22a5253e 100644 --- a/testing-modules/testing-libraries/pom.xml +++ b/testing-modules/testing-libraries/pom.xml @@ -42,7 +42,18 @@ spring-boot-starter-web 2.2.0.RELEASE - + + com.github.stefanbirkner + system-rules + ${system-rules.version} + test + + + com.github.stefanbirkner + system-lambda + ${system-lambda.version} + test + @@ -90,6 +101,8 @@ 0.4 4.8.0 3.0.0 + 1.19.0 + 1.0.0
    diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/systemout/SystemOutPrintlnUnitTest.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/systemout/SystemOutPrintlnUnitTest.java new file mode 100644 index 0000000000..3ffc508fa5 --- /dev/null +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/systemout/SystemOutPrintlnUnitTest.java @@ -0,0 +1,49 @@ +package com.baeldung.systemout; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import org.junit.Assert; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static com.github.stefanbirkner.systemlambda.SystemLambda.tapSystemOut; + +class SystemOutPrintlnUnitTest { + + private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream(); + private final PrintStream standardOut = System.out; + + @BeforeEach + public void setUp() { + System.setOut(new PrintStream(outputStreamCaptor)); + } + + @BeforeEach + public void tearDown() { + System.setOut(standardOut); + } + + @Test + void givenSystemOutRedirection_whenInvokePrintln_thenOutputCaptorSuccess() { + print("Hello Baeldung Readers!!"); + + Assert.assertEquals("Hello Baeldung Readers!!", outputStreamCaptor.toString() + .trim()); + } + + @Test + void givenTapSystemOut_whenInvokePrintln_thenOutputIsReturnedSuccessfully() throws Exception { + + String text = tapSystemOut(() -> { + print("Hello Baeldung Readers!!"); + }); + + Assert.assertEquals("Hello Baeldung Readers!!", text.trim()); + } + + private void print(String output) { + System.out.println(output); + } + +} diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/systemout/SystemOutPrintlnWithRuleUnitTest.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/systemout/SystemOutPrintlnWithRuleUnitTest.java new file mode 100644 index 0000000000..f15b71999e --- /dev/null +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/systemout/SystemOutPrintlnWithRuleUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.systemout; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.SystemOutRule; + +public class SystemOutPrintlnWithRuleUnitTest { + + @Rule + public final SystemOutRule systemOutRule = new SystemOutRule().enableLog(); + + @Test + public void givenSystemOutRule_whenInvokePrintln_thenLogSuccess() { + print("Hello Baeldung Readers!!"); + + Assert.assertEquals("Hello Baeldung Readers!!", systemOutRule.getLog() + .trim()); + + Assert.assertEquals("Hello Baeldung Readers!!\n", systemOutRule.getLogWithNormalizedLineSeparator()); + } + + private void print(String output) { + System.out.println(output); + } + +} diff --git a/twitter4j/pom.xml b/twitter4j/pom.xml index 0c36e72892..e2579bf73e 100644 --- a/twitter4j/pom.xml +++ b/twitter4j/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 twitter4j - twitter4J + twitter4j jar diff --git a/vaadin/pom.xml b/vaadin/pom.xml index 9de1bec6e2..4814e70ae3 100644 --- a/vaadin/pom.xml +++ b/vaadin/pom.xml @@ -126,7 +126,7 @@ vaadin-addons - http://maven.vaadin.com/vaadin-addons + https://maven.vaadin.com/vaadin-addons @@ -141,7 +141,7 @@ vaadin-prereleases - http://maven.vaadin.com/vaadin-prereleases + https://maven.vaadin.com/vaadin-prereleases vaadin-snapshots @@ -157,7 +157,7 @@ vaadin-prereleases - http://maven.vaadin.com/vaadin-prereleases + https://maven.vaadin.com/vaadin-prereleases vaadin-snapshots @@ -182,7 +182,6 @@ 8.8.5 8.8.5 9.3.9.v20160517 - UTF-8 1.8 1.8 local diff --git a/webrtc/pom.xml b/webrtc/pom.xml index 6dc98afb1c..f302ae97a2 100644 --- a/webrtc/pom.xml +++ b/webrtc/pom.xml @@ -22,10 +22,6 @@ - - 1.8 - - @@ -35,4 +31,8 @@ + + 1.8 + +