Merge branch 'master' of https://github.com/eugenp/tutorials
This commit is contained in:
		
						commit
						98751f99a7
					
				| @ -1,97 +0,0 @@ | |||||||
| package com.baeldung.streamordering; |  | ||||||
| 
 |  | ||||||
| import org.junit.Test; |  | ||||||
| import org.openjdk.jmh.annotations.*; |  | ||||||
| import org.openjdk.jmh.infra.Blackhole; |  | ||||||
| import org.openjdk.jmh.runner.Runner; |  | ||||||
| import org.openjdk.jmh.runner.options.Options; |  | ||||||
| import org.openjdk.jmh.runner.options.OptionsBuilder; |  | ||||||
| import org.openjdk.jmh.runner.options.TimeValue; |  | ||||||
| 
 |  | ||||||
| import java.util.ArrayList; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.Random; |  | ||||||
| import java.util.concurrent.TimeUnit; |  | ||||||
| import java.util.stream.IntStream; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| public class BenchmarkUnitTest |  | ||||||
| { |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void |  | ||||||
|   launchBenchmark() throws Exception { |  | ||||||
| 
 |  | ||||||
|     Options opt = new OptionsBuilder() |  | ||||||
|       // Specify which benchmarks to run. |  | ||||||
|       // You can be more specific if you'd like to run only one benchmark per test. |  | ||||||
|       .include(this.getClass().getName() + ".*") |  | ||||||
|       // Set the following options as needed |  | ||||||
|       .mode (Mode.AverageTime) |  | ||||||
|       .timeUnit(TimeUnit.MICROSECONDS) |  | ||||||
|       .warmupTime(TimeValue.seconds(1)) |  | ||||||
|       .warmupIterations(2) |  | ||||||
|       .measurementTime(TimeValue.seconds(1)) |  | ||||||
|       .measurementIterations(2) |  | ||||||
|       .threads(2) |  | ||||||
|       .forks(1) |  | ||||||
|       .shouldFailOnError(true) |  | ||||||
|       .shouldDoGC(true) |  | ||||||
|       //.jvmArgs("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining") |  | ||||||
|       //.addProfiler(WinPerfAsmProfiler.class) |  | ||||||
|       .build(); |  | ||||||
| 
 |  | ||||||
|     new Runner(opt).run(); |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Benchmark |  | ||||||
|   public void givenOrderedStreamInput_whenStreamFiltered_showOpsPerMS(){ |  | ||||||
|     IntStream.range(1, 100_000_000).parallel().filter(i -> i % 10 == 0).toArray(); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Benchmark |  | ||||||
|   public void givenUnorderedStreamInput_whenStreamFiltered_showOpsPerMS(){ |  | ||||||
|     IntStream.range(1,100_000_000).unordered().parallel().filter(i -> i % 10 == 0).toArray(); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Benchmark |  | ||||||
|   public void givenUnorderedStreamInput_whenStreamDistinct_showOpsPerMS(){ |  | ||||||
|     IntStream.range(1, 1_000_000).unordered().parallel().distinct().toArray(); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Benchmark |  | ||||||
|   public void givenOrderedStreamInput_whenStreamDistinct_showOpsPerMS() { |  | ||||||
|     //section 5.1. |  | ||||||
|     IntStream.range(1, 1_000_000).parallel().distinct().toArray(); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   // The JMH samples are the best documentation for how to use it |  | ||||||
|   // http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/ |  | ||||||
|   @State(Scope.Thread) |  | ||||||
|   public static class BenchmarkState |  | ||||||
|   { |  | ||||||
|     List<Integer> list; |  | ||||||
| 
 |  | ||||||
|     @Setup(Level.Trial) public void |  | ||||||
|     initialize() { |  | ||||||
| 
 |  | ||||||
|       Random rand = new Random(); |  | ||||||
| 
 |  | ||||||
|       list = new ArrayList<>(); |  | ||||||
|       for (int i = 0; i < 1000; i++) |  | ||||||
|         list.add (rand.nextInt()); |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Benchmark public void |  | ||||||
|   benchmark1 (BenchmarkState state, Blackhole bh) { |  | ||||||
| 
 |  | ||||||
|     List<Integer> list = state.list; |  | ||||||
| 
 |  | ||||||
|     for (int i = 0; i < 1000; i++) |  | ||||||
|       bh.consume (list.get (i)); |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @ -1,149 +0,0 @@ | |||||||
| package com.baeldung.streamordering; |  | ||||||
| 
 |  | ||||||
| import org.junit.Before; |  | ||||||
| import org.junit.Test; |  | ||||||
| 
 |  | ||||||
| import java.util.*; |  | ||||||
| import java.util.function.Function; |  | ||||||
| import java.util.logging.Level; |  | ||||||
| import java.util.logging.Logger; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| import java.util.stream.IntStream; |  | ||||||
| 
 |  | ||||||
| import static org.junit.Assert.assertEquals; |  | ||||||
| 
 |  | ||||||
| public class StreamsOrderingUnitTest { |  | ||||||
| 
 |  | ||||||
|   Logger logger = Logger.getLogger( StreamsOrderingUnitTest.class.getName()); |  | ||||||
| 
 |  | ||||||
|   @Before |  | ||||||
|   public void setUp() throws Exception { |  | ||||||
|     logger.setLevel(Level.ALL); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenTwoCollections_whenStreamed_thenCheckOutputDifferent(){ |  | ||||||
| 
 |  | ||||||
|     List<String> list = Arrays.asList("B", "A", "C", "D", "F"); |  | ||||||
|     Set<String> set = new TreeSet<>(Arrays.asList("B", "A", "C", "D", "F")); |  | ||||||
| 
 |  | ||||||
|     Object[] listOutput = list.stream().toArray(); |  | ||||||
|     Object[] setOutput = set.stream().toArray(); |  | ||||||
| 
 |  | ||||||
|     assertEquals("[B, A, C, D, F]", Arrays.toString(listOutput)); |  | ||||||
|     assertEquals("[A, B, C, D, F]", Arrays.toString(setOutput)); |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenTwoCollections_whenStreamedInParallel_thenCheckOutputDifferent(){ |  | ||||||
| 
 |  | ||||||
|     List<String> list = Arrays.asList("B", "A", "C", "D", "F"); |  | ||||||
|     Set<String> set = new TreeSet<>(Arrays.asList("B", "A", "C", "D", "F")); |  | ||||||
| 
 |  | ||||||
|     Object[] listOutput = list.stream().parallel().toArray(); |  | ||||||
|     Object[] setOutput = set.stream().parallel().toArray(); |  | ||||||
| 
 |  | ||||||
|     assertEquals("[B, A, C, D, F]", Arrays.toString(listOutput)); |  | ||||||
|     assertEquals("[A, B, C, D, F]", Arrays.toString(setOutput)); |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenOrderedInput_whenUnorderedAndOrderedCompared_thenCheckUnorderedOutputChanges(){ |  | ||||||
|     Set<Integer> set = new TreeSet<>( |  | ||||||
|       Arrays.asList(-9, -5, -4, -2, 1, 2, 4, 5, 7, 9, 12, 13, 16, 29, 23, 34, 57, 68, 90, 102, 230)); |  | ||||||
| 
 |  | ||||||
|       Object[] orderedArray = set.stream() |  | ||||||
|         .parallel() |  | ||||||
|         .limit(5) |  | ||||||
|         .toArray(); |  | ||||||
|       Object[] unorderedArray = set.stream() |  | ||||||
|         .unordered() |  | ||||||
|         .parallel() |  | ||||||
|         .limit(5) |  | ||||||
|         .toArray(); |  | ||||||
| 
 |  | ||||||
|      logger.info(Arrays.toString(orderedArray)); |  | ||||||
|      logger.info(Arrays.toString(unorderedArray)); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenUnsortedStreamInput_whenStreamSorted_thenCheckOrderChanged(){ |  | ||||||
| 
 |  | ||||||
|     List<Integer> list = Arrays.asList(-3,10,-4,1,3); |  | ||||||
| 
 |  | ||||||
|     Object[] listOutput = list.stream().toArray(); |  | ||||||
|     Object[] listOutputSorted = list.stream().sorted().toArray(); |  | ||||||
| 
 |  | ||||||
|     assertEquals("[-3, 10, -4, 1, 3]", Arrays.toString(listOutput)); |  | ||||||
|     assertEquals("[-4, -3, 1, 3, 10]", Arrays.toString(listOutputSorted)); |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenUnsortedStreamInput_whenStreamDistinct_thenShowTimeTaken(){ |  | ||||||
|     long start, end; |  | ||||||
|     start = System.currentTimeMillis(); |  | ||||||
|     IntStream.range(1,1_000_000).unordered().parallel().distinct().toArray(); |  | ||||||
|     end = System.currentTimeMillis(); |  | ||||||
|     System.out.println(String.format("Time taken when unordered: %d ms", (end - start))); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenSameCollection_whenStreamTerminated_thenCheckEachVsEachOrdered(){ |  | ||||||
| 
 |  | ||||||
|     List<String> list = Arrays.asList("B", "A", "C", "D", "F"); |  | ||||||
| 
 |  | ||||||
|     list.stream().parallel().forEach(e -> logger.log(Level.INFO, e)); |  | ||||||
|     list.stream().parallel().forEachOrdered(e -> logger.log(Level.INFO, e)); |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenSameCollection_whenStreamCollected_thenCheckOutput(){ |  | ||||||
| 
 |  | ||||||
|     List<String> list = Arrays.asList("B", "A", "C", "D", "F"); |  | ||||||
| 
 |  | ||||||
|     List<String> collectionList = list.stream().parallel().collect(Collectors.toList()); |  | ||||||
|     Set<String> collectionSet = list.stream().parallel().collect(Collectors.toCollection(TreeSet::new)); |  | ||||||
| 
 |  | ||||||
|     assertEquals("[B, A, C, D, F]", collectionList.toString()); |  | ||||||
|     assertEquals("[A, B, C, D, F]", collectionSet.toString()); |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenListIterationOrder_whenStreamCollectedToMap_thenCeckOrderChanged() { |  | ||||||
|     List<String> list = Arrays.asList("A", "BB", "CCC"); |  | ||||||
| 
 |  | ||||||
|     Map<String, Integer> hashMap = list.stream().collect(Collectors.toMap(Function.identity(), String::length)); |  | ||||||
| 
 |  | ||||||
|     Object[] keySet = hashMap.keySet().toArray(); |  | ||||||
| 
 |  | ||||||
|     assertEquals("[BB, A, CCC]", Arrays.toString(keySet)); |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   @Test |  | ||||||
|   public void givenListIteration_whenStreamCollectedtoHashMap_thenCheckOrderMaintained() { |  | ||||||
|     List<String> list = Arrays.asList("A", "BB", "CCC", "CCC"); |  | ||||||
| 
 |  | ||||||
|     Map<String, Integer> linkedHashMap = list.stream().collect(Collectors.toMap( |  | ||||||
|       Function.identity(), |  | ||||||
|       String::length, |  | ||||||
|       (u, v) -> u, |  | ||||||
|       LinkedHashMap::new |  | ||||||
|     )); |  | ||||||
| 
 |  | ||||||
|     Object[] keySet = linkedHashMap.keySet().toArray(); |  | ||||||
| 
 |  | ||||||
|     assertEquals("[A, BB, CCC]", Arrays.toString(keySet)); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| @ -0,0 +1,45 @@ | |||||||
|  | /** | ||||||
|  |  *  | ||||||
|  |  */ | ||||||
|  | package com.baeldung.string; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author swpraman | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | public class AppendCharAtPositionX { | ||||||
|  |      | ||||||
|  |     public String addCharUsingCharArray(String str, char ch, int position) { | ||||||
|  |         validate(str, position); | ||||||
|  |         int len = str.length(); | ||||||
|  |         char[] updatedArr = new char[len + 1]; | ||||||
|  |         str.getChars(0, position, updatedArr, 0); | ||||||
|  |         updatedArr[position] = ch; | ||||||
|  |         str.getChars(position, len, updatedArr, position + 1); | ||||||
|  |         return new String(updatedArr); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public String addCharUsingSubstring(String str, char ch, int position) { | ||||||
|  |         validate(str, position); | ||||||
|  |         return str.substring(0, position) + ch + str.substring(position); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public String addCharUsingStringBuilder(String str, char ch, int position) { | ||||||
|  |         validate(str, position); | ||||||
|  |         StringBuilder sb = new StringBuilder(str); | ||||||
|  |         sb.insert(position, ch); | ||||||
|  |         return sb.toString(); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     private void validate(String str, int position) { | ||||||
|  |         if (str == null) { | ||||||
|  |             throw new IllegalArgumentException("Str should not be null"); | ||||||
|  |         } | ||||||
|  |         int len = str.length(); | ||||||
|  |         if (position < 0 || position > len) { | ||||||
|  |             throw new IllegalArgumentException("position[" + position + "] should be "  | ||||||
|  |                             + "in the range 0.." + len + " for string " + str); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -23,7 +23,7 @@ public class LinesIntersectionServiceUnitTest { | |||||||
| 
 | 
 | ||||||
|         assertTrue(point.isPresent()); |         assertTrue(point.isPresent()); | ||||||
|         assertEquals(point.get().getX(), 1, 0.001); |         assertEquals(point.get().getX(), 1, 0.001); | ||||||
|         assertEquals(point.get().getX(), 1, 0.001); |         assertEquals(point.get().getY(), 0, 0.001); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -0,0 +1,110 @@ | |||||||
|  | /** | ||||||
|  |  *  | ||||||
|  |  */ | ||||||
|  | package com.baeldung.string; | ||||||
|  | 
 | ||||||
|  | import static org.junit.Assert.assertEquals; | ||||||
|  | 
 | ||||||
|  | import org.junit.Test; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author swpraman | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | public class AppendCharAtPositionXUnitTest { | ||||||
|  |      | ||||||
|  |     private AppendCharAtPositionX appendCharAtPosition = new AppendCharAtPositionX(); | ||||||
|  |     private String word = "Titanc"; | ||||||
|  |     private char letter = 'i'; | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingCharacterArrayAndCharacterAddedAtBeginning_shouldAddCharacter() { | ||||||
|  |         assertEquals("iTitanc", appendCharAtPosition.addCharUsingCharArray(word, letter, 0)); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingSubstringAndCharacterAddedAtBeginning_shouldAddCharacter() { | ||||||
|  |         assertEquals("iTitanc", appendCharAtPosition.addCharUsingSubstring(word, letter, 0)); | ||||||
|  |     }   | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingStringBuilderAndCharacterAddedAtBeginning_shouldAddCharacter() { | ||||||
|  |         assertEquals("iTitanc", appendCharAtPosition.addCharUsingStringBuilder(word, letter, 0)); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingCharacterArrayAndCharacterAddedAtMiddle_shouldAddCharacter() { | ||||||
|  |         assertEquals("Titianc", appendCharAtPosition.addCharUsingCharArray(word, letter, 3)); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingSubstringAndCharacterAddedAtMiddle_shouldAddCharacter() { | ||||||
|  |         assertEquals("Titianc", appendCharAtPosition.addCharUsingSubstring(word, letter, 3)); | ||||||
|  |     }   | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingStringBuilderAndCharacterAddedAtMiddle_shouldAddCharacter() { | ||||||
|  |         assertEquals("Titianc", appendCharAtPosition.addCharUsingStringBuilder(word, letter, 3)); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingCharacterArrayAndCharacterAddedAtEnd_shouldAddCharacter() { | ||||||
|  |         assertEquals("Titanci", appendCharAtPosition.addCharUsingCharArray(word, letter, word.length())); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingSubstringAndCharacterAddedAtEnd_shouldAddCharacter() { | ||||||
|  |         assertEquals("Titanci", appendCharAtPosition.addCharUsingSubstring(word, letter, word.length())); | ||||||
|  |     }   | ||||||
|  |      | ||||||
|  |     @Test | ||||||
|  |     public void whenUsingStringBuilderAndCharacterAddedAtEnd_shouldAddCharacter() { | ||||||
|  |         assertEquals("Titanci", appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length())); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingCharacterArrayAndCharacterAddedAtNegativePosition_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(word, letter, -1); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingSubstringAndCharacterAddedAtNegativePosition_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(word, letter, -1); | ||||||
|  |     }   | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingStringBuilderAndCharacterAddedAtNegativePosition_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(word, letter, -1); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingCharacterArrayAndCharacterAddedAtInvalidPosition_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length() + 2); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingSubstringAndCharacterAddedAtInvalidPosition_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length() + 2); | ||||||
|  |     }   | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingStringBuilderAndCharacterAddedAtInvalidPosition_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length() + 2); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingCharacterArrayAndCharacterAddedAtPositionXAndStringIsNull_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(null, letter, 3); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingSubstringAndCharacterAddedAtPositionXAndStringIsNull_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(null, letter, 3); | ||||||
|  |     }   | ||||||
|  |      | ||||||
|  |     @Test(expected=IllegalArgumentException.class) | ||||||
|  |     public void whenUsingStringBuilderAndCharacterAddedAtPositionXAndStringIsNull_shouldThrowException() { | ||||||
|  |         appendCharAtPosition.addCharUsingStringBuilder(null, letter, 3); | ||||||
|  |     } | ||||||
|  |   | ||||||
|  | } | ||||||
| @ -18,7 +18,6 @@ import java.util.stream.IntStream; | |||||||
| public class BenchmarkUnitTest | public class BenchmarkUnitTest | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
|   @Test |  | ||||||
|   public void |   public void | ||||||
|   launchBenchmark() throws Exception { |   launchBenchmark() throws Exception { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -0,0 +1,67 @@ | |||||||
|  | package com.baeldung.string.formatter; | ||||||
|  | 
 | ||||||
|  | import org.junit.BeforeClass; | ||||||
|  | import org.junit.Test; | ||||||
|  | 
 | ||||||
|  | import java.text.DateFormat; | ||||||
|  | import java.text.SimpleDateFormat; | ||||||
|  | import java.time.Instant; | ||||||
|  | import java.time.LocalDateTime; | ||||||
|  | import java.time.ZoneId; | ||||||
|  | import java.time.format.DateTimeFormatter; | ||||||
|  | import java.util.Calendar; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.TimeZone; | ||||||
|  | 
 | ||||||
|  | import static org.junit.Assert.assertEquals; | ||||||
|  | 
 | ||||||
|  | public class DateToStringFormatterUnitTest { | ||||||
|  | 
 | ||||||
|  |     private static final String DATE_FORMAT = "MMM d, yyyy HH:mm a"; | ||||||
|  |     private static final String EXPECTED_STRING_DATE = "Aug 1, 2018 12:00 PM"; | ||||||
|  |     private static Date date; | ||||||
|  | 
 | ||||||
|  |     @BeforeClass | ||||||
|  |     public static void setUp() { | ||||||
|  |         TimeZone.setDefault(TimeZone.getTimeZone("CET")); | ||||||
|  |         Calendar calendar = Calendar.getInstance(); | ||||||
|  |         calendar.set(2018, Calendar.AUGUST, 1, 12, 0); | ||||||
|  |         date = calendar.getTime(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Test | ||||||
|  |     public void whenDateConvertedUsingSimpleDateFormatToString_thenCorrect() { | ||||||
|  |         DateFormat formatter = new SimpleDateFormat(DATE_FORMAT); | ||||||
|  |         String formattedDate = formatter.format(date); | ||||||
|  | 
 | ||||||
|  |         assertEquals(EXPECTED_STRING_DATE, formattedDate); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Test | ||||||
|  |     public void whenDateConvertedUsingDateFormatToString_thenCorrect() { | ||||||
|  |         String formattedDate = DateFormat | ||||||
|  |           .getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT) | ||||||
|  |           .format(date); | ||||||
|  | 
 | ||||||
|  |         assertEquals(EXPECTED_STRING_DATE, formattedDate); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Test | ||||||
|  |     public void whenDateConvertedUsingFormatterToString_thenCorrect() { | ||||||
|  |         String formattedDate = String.format("%1$tb %1$te, %1$tY %1$tI:%1$tM %1$Tp", date); | ||||||
|  | 
 | ||||||
|  |         assertEquals(EXPECTED_STRING_DATE, formattedDate); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Test | ||||||
|  |     public void whenDateConvertedUsingDateTimeApiToString_thenCorrect() { | ||||||
|  |         DateTimeFormatter fmt = DateTimeFormatter.ofPattern(DATE_FORMAT); | ||||||
|  |         Instant instant = date.toInstant(); | ||||||
|  |         LocalDateTime ldt = instant | ||||||
|  |           .atZone(ZoneId.of("CET")) | ||||||
|  |           .toLocalDateTime(); | ||||||
|  |         String formattedDate = ldt.format(fmt); | ||||||
|  | 
 | ||||||
|  |         assertEquals(EXPECTED_STRING_DATE, formattedDate); | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										102
									
								
								jersey/src/main/java/com/baeldung/jersey/server/Responder.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								jersey/src/main/java/com/baeldung/jersey/server/Responder.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,102 @@ | |||||||
|  | package com.baeldung.jersey.server; | ||||||
|  | 
 | ||||||
|  | import com.baeldung.jersey.server.model.Person; | ||||||
|  | 
 | ||||||
|  | import javax.ws.rs.GET; | ||||||
|  | import javax.ws.rs.Path; | ||||||
|  | import javax.ws.rs.Produces; | ||||||
|  | import javax.ws.rs.core.MediaType; | ||||||
|  | import javax.ws.rs.core.Response; | ||||||
|  | 
 | ||||||
|  | @Path("/response") | ||||||
|  | public class Responder { | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/ok") | ||||||
|  |     public Response getOkResponse() { | ||||||
|  | 
 | ||||||
|  |         String message = "This is a text response"; | ||||||
|  | 
 | ||||||
|  |         return Response | ||||||
|  |           .status(Response.Status.OK) | ||||||
|  |           .entity(message) | ||||||
|  |           .build(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/not_ok") | ||||||
|  |     public Response getNOkTextResponse() { | ||||||
|  | 
 | ||||||
|  |         String message = "There was an internal server error"; | ||||||
|  | 
 | ||||||
|  |         return Response | ||||||
|  |           .status(Response.Status.INTERNAL_SERVER_ERROR) | ||||||
|  |           .entity(message) | ||||||
|  |           .build(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/text_plain") | ||||||
|  |     public Response getTextResponseTypeDefined() { | ||||||
|  | 
 | ||||||
|  |         String message = "This is a plain text response"; | ||||||
|  | 
 | ||||||
|  |         return Response | ||||||
|  |           .status(Response.Status.OK) | ||||||
|  |           .entity(message) | ||||||
|  |           .type(MediaType.TEXT_PLAIN) | ||||||
|  |           .build(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/text_plain_annotation") | ||||||
|  |     @Produces({ MediaType.TEXT_PLAIN }) | ||||||
|  |     public Response getTextResponseTypeAnnotated() { | ||||||
|  | 
 | ||||||
|  |         String message = "This is a plain text response via annotation"; | ||||||
|  | 
 | ||||||
|  |         return Response | ||||||
|  |           .status(Response.Status.OK) | ||||||
|  |           .entity(message) | ||||||
|  |           .build(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/pojo") | ||||||
|  |     public Response getPojoResponse() { | ||||||
|  | 
 | ||||||
|  |         Person person = new Person("Abh", "Nepal"); | ||||||
|  | 
 | ||||||
|  |         return Response | ||||||
|  |           .status(Response.Status.OK) | ||||||
|  |           .entity(person) | ||||||
|  |           .build(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/json") | ||||||
|  |     public Response getJsonResponse() { | ||||||
|  | 
 | ||||||
|  |         String message = "{\"hello\": \"This is a JSON response\"}"; | ||||||
|  | 
 | ||||||
|  |         return Response | ||||||
|  |           .status(Response.Status.OK) | ||||||
|  |           .entity(message) | ||||||
|  |           .type(MediaType.APPLICATION_JSON) | ||||||
|  |           .build(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/xml") | ||||||
|  |     @Produces(MediaType.TEXT_XML) | ||||||
|  |     public String sayXMLHello() { | ||||||
|  |         return "<?xml version=\"1.0\"?>" + "<hello> This is a xml response </hello>"; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GET | ||||||
|  |     @Path("/html") | ||||||
|  |     @Produces(MediaType.TEXT_HTML) | ||||||
|  |     public String sayHtmlHello() { | ||||||
|  |         return "<html> " + "<title>" + " This is a html title  </title>" + "<body><h1>" + " This is a html response body " + "</body></h1>" + "</html> "; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.baeldung.jersey.server.model; | ||||||
|  | 
 | ||||||
|  | public class Person { | ||||||
|  |     String name; | ||||||
|  |     String address; | ||||||
|  | 
 | ||||||
|  |     public Person(String name, String address) { | ||||||
|  |         this.name = name; | ||||||
|  |         this.address = address; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public String getName() { | ||||||
|  |         return name; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void setName(String name) { | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public String getAddress() { | ||||||
|  |         return address; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void setAddress(String address) { | ||||||
|  |         this.address = address; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public String toString() { | ||||||
|  |         return "Person [name: " + getName() + " address: " + getAddress() + "]"; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -1,2 +0,0 @@ | |||||||
| ### Relevant Articles: |  | ||||||
| - [A Guide to Stored Procedures with JPA](http://www.baeldung.com/jpa-stored-procedures) |  | ||||||
| @ -1,65 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" 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"> |  | ||||||
|     <modelVersion>4.0.0</modelVersion> |  | ||||||
|     <groupId>com.baeldung</groupId> |  | ||||||
|     <artifactId>jpa-storedprocedure</artifactId> |  | ||||||
|     <version>1.0</version> |  | ||||||
|     <packaging>jar</packaging> |  | ||||||
| 
 |  | ||||||
|     <parent> |  | ||||||
|         <groupId>com.baeldung</groupId> |  | ||||||
|         <artifactId>parent-modules</artifactId> |  | ||||||
|         <version>1.0.0-SNAPSHOT</version> |  | ||||||
|     </parent> |  | ||||||
| 
 |  | ||||||
|     <dependencies> |  | ||||||
|         <!-- core library --> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>javax</groupId> |  | ||||||
|             <artifactId>javaee-api</artifactId> |  | ||||||
|             <version>${jee.version}</version> |  | ||||||
|             <scope>provided</scope> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.hibernate</groupId> |  | ||||||
|             <artifactId>hibernate-entitymanager</artifactId> |  | ||||||
|             <version>${hibernate.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <!-- MySql JDBC --> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>mysql</groupId> |  | ||||||
|             <artifactId>mysql-connector-java</artifactId> |  | ||||||
|             <version>${mysql.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>commons-io</groupId> |  | ||||||
|             <artifactId>commons-io</artifactId> |  | ||||||
|             <version>${commons-io.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|     </dependencies> |  | ||||||
| 
 |  | ||||||
|     <build> |  | ||||||
|         <finalName>JpaStoredProcedure</finalName> |  | ||||||
|         <plugins> |  | ||||||
|             <plugin> |  | ||||||
|                 <artifactId>maven-assembly-plugin</artifactId> |  | ||||||
|                 <configuration> |  | ||||||
|                     <archiveBaseDirectory>${project.basedir}</archiveBaseDirectory> |  | ||||||
|                     <!--archive> <manifest> <mainClass>fully.qualified.MainClass</mainClass> </manifest> </archive --> |  | ||||||
|                     <descriptorRefs> |  | ||||||
|                         <descriptorRef>jar-with-dependencies</descriptorRef> |  | ||||||
|                     </descriptorRefs> |  | ||||||
|                 </configuration> |  | ||||||
|             </plugin> |  | ||||||
|         </plugins> |  | ||||||
|     </build> |  | ||||||
| 
 |  | ||||||
|     <properties> |  | ||||||
|         <jee.version>7.0</jee.version> |  | ||||||
|         <hibernate.version>5.2.5.Final</hibernate.version> |  | ||||||
|         <mysql.version>6.0.5</mysql.version> |  | ||||||
|         <commons-io.version>2.5</commons-io.version> |  | ||||||
|     </properties> |  | ||||||
| 
 |  | ||||||
| </project> |  | ||||||
| @ -1,20 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" |  | ||||||
| 			 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |  | ||||||
| 			 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence |  | ||||||
|              http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" |  | ||||||
| 			 version="2.1"> |  | ||||||
| 
 |  | ||||||
| 	<persistence-unit name="jpa-db"> |  | ||||||
| 		<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> |  | ||||||
| 		<class>com.baeldung.jpa.model.Car</class> |  | ||||||
| 		<properties> |  | ||||||
| 			<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> |  | ||||||
| 			<property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/baeldung" /> |  | ||||||
| 			<property name="javax.persistence.jdbc.user" value="baeldung" /> |  | ||||||
| 			<property name="javax.persistence.jdbc.password" value="YourPassword" /> |  | ||||||
| 			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> |  | ||||||
| 			<property name="hibernate.show_sql" value="true" /> |  | ||||||
| 		</properties> |  | ||||||
| 	</persistence-unit> |  | ||||||
| </persistence> |  | ||||||
| @ -1,13 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <configuration> |  | ||||||
|     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |  | ||||||
|         <encoder> |  | ||||||
|             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n |  | ||||||
|             </pattern> |  | ||||||
|         </encoder> |  | ||||||
|     </appender> |  | ||||||
| 
 |  | ||||||
|     <root level="INFO"> |  | ||||||
|         <appender-ref ref="STDOUT" /> |  | ||||||
|     </root> |  | ||||||
| </configuration> |  | ||||||
							
								
								
									
										9
									
								
								libraries-server/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								libraries-server/README.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | ### Relevant articles | ||||||
|  | 
 | ||||||
|  | - [Embedded Jetty Server in Java](http://www.baeldung.com/jetty-embedded) | ||||||
|  | - [Introduction to Netty](http://www.baeldung.com/netty) | ||||||
|  | - [Exceptions in Netty](http://www.baeldung.com/netty-exception-handling) | ||||||
|  | - [Programatically Create, Configure, and Run a Tomcat Server](http://www.baeldung.com/tomcat-programmatic-setup) | ||||||
|  | - [Creating and Configuring Jetty 9 Server in Java](http://www.baeldung.com/jetty-java-programmatic) | ||||||
|  | - [Testing Netty with EmbeddedChannel](http://www.baeldung.com/testing-netty-embedded-channel) | ||||||
|  | 
 | ||||||
| @ -15,5 +15,72 @@ | |||||||
|             <artifactId>org.eclipse.paho.client.mqttv3</artifactId> |             <artifactId>org.eclipse.paho.client.mqttv3</artifactId> | ||||||
|             <version>1.2.0</version> |             <version>1.2.0</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|  |         <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.assertj</groupId> | ||||||
|  |             <artifactId>assertj-core</artifactId> | ||||||
|  |             <version>${assertj.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.eclipse.jetty</groupId> | ||||||
|  |             <artifactId>jetty-server</artifactId> | ||||||
|  |             <version>${jetty.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.eclipse.jetty</groupId> | ||||||
|  |             <artifactId>jetty-servlet</artifactId> | ||||||
|  |             <version>${jetty.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.eclipse.jetty</groupId> | ||||||
|  |             <artifactId>jetty-webapp</artifactId> | ||||||
|  |             <version>${jetty.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.apache.httpcomponents</groupId> | ||||||
|  |             <artifactId>httpclient</artifactId> | ||||||
|  |             <version>${httpclient.version}</version> | ||||||
|  |             <exclusions> | ||||||
|  |                 <exclusion> | ||||||
|  |                     <artifactId>commons-logging</artifactId> | ||||||
|  |                     <groupId>commons-logging</groupId> | ||||||
|  |                 </exclusion> | ||||||
|  |             </exclusions> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>commons-io</groupId> | ||||||
|  |             <artifactId>commons-io</artifactId> | ||||||
|  |             <version>${commons.io.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>io.netty</groupId> | ||||||
|  |             <artifactId>netty-all</artifactId> | ||||||
|  |             <version>${netty.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>junit</groupId> | ||||||
|  |             <artifactId>junit</artifactId> | ||||||
|  |             <version>${junit.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  | 		 | ||||||
|  |         <!-- tomcat --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.apache.tomcat</groupId> | ||||||
|  |             <artifactId>tomcat-catalina</artifactId> | ||||||
|  |             <version>${tomcat.version}</version> | ||||||
|  |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
|  </project> | 
 | ||||||
|  |     <properties> | ||||||
|  |         <assertj.version>3.6.2</assertj.version> | ||||||
|  |         <httpclient.version>4.5.3</httpclient.version> | ||||||
|  |         <commons.io.version>2.5</commons.io.version> | ||||||
|  |         <jetty.version>9.4.8.v20171121</jetty.version> | ||||||
|  |         <netty.version>4.1.20.Final</netty.version> | ||||||
|  |         <commons.collections.version>4.1</commons.collections.version> | ||||||
|  |         <junit.version>4.12</junit.version> | ||||||
|  |         <tomcat.version>8.5.24</tomcat.version> | ||||||
|  |     </properties> | ||||||
|  | 
 | ||||||
|  | </project> | ||||||
| @ -5,13 +5,11 @@ | |||||||
| - [String Processing with Apache Commons Lang 3](http://www.baeldung.com/string-processing-commons-lang) | - [String Processing with Apache Commons Lang 3](http://www.baeldung.com/string-processing-commons-lang) | ||||||
| - [Introduction to Javatuples](http://www.baeldung.com/java-tuples) | - [Introduction to Javatuples](http://www.baeldung.com/java-tuples) | ||||||
| - [Introduction to Javassist](http://www.baeldung.com/javassist) | - [Introduction to Javassist](http://www.baeldung.com/javassist) | ||||||
| - [Embedded Jetty Server in Java](http://www.baeldung.com/jetty-embedded) |  | ||||||
| - [Introduction to Apache Flink with Java](http://www.baeldung.com/apache-flink) | - [Introduction to Apache Flink with Java](http://www.baeldung.com/apache-flink) | ||||||
| - [Introduction to JSONassert](http://www.baeldung.com/jsonassert) | - [Introduction to JSONassert](http://www.baeldung.com/jsonassert) | ||||||
| - [Intro to JaVers](http://www.baeldung.com/javers) | - [Intro to JaVers](http://www.baeldung.com/javers) | ||||||
| - [Introduction to Apache Commons Math](http://www.baeldung.com/apache-commons-math) | - [Introduction to Apache Commons Math](http://www.baeldung.com/apache-commons-math) | ||||||
| - [Intro to Serenity BDD](http://www.baeldung.com/serenity-bdd) | - [Intro to Serenity BDD](http://www.baeldung.com/serenity-bdd) | ||||||
| - [Introduction to Netty](http://www.baeldung.com/netty) |  | ||||||
| - [Merging Streams in Java](http://www.baeldung.com/java-merge-streams) | - [Merging Streams in Java](http://www.baeldung.com/java-merge-streams) | ||||||
| - [Serenity BDD and Screenplay](http://www.baeldung.com/serenity-screenplay) | - [Serenity BDD and Screenplay](http://www.baeldung.com/serenity-screenplay) | ||||||
| - [Introduction to Quartz](http://www.baeldung.com/quartz) | - [Introduction to Quartz](http://www.baeldung.com/quartz) | ||||||
| @ -54,10 +52,7 @@ | |||||||
| - [Introduction to BouncyCastle with Java](http://www.baeldung.com/java-bouncy-castle) | - [Introduction to BouncyCastle with Java](http://www.baeldung.com/java-bouncy-castle) | ||||||
| - [Guide to google-http-client](http://www.baeldung.com/google-http-client) | - [Guide to google-http-client](http://www.baeldung.com/google-http-client) | ||||||
| - [Interact with Google Sheets from Java](http://www.baeldung.com/google-sheets-java-client) | - [Interact with Google Sheets from Java](http://www.baeldung.com/google-sheets-java-client) | ||||||
| - [Programatically Create, Configure, and Run a Tomcat Server](http://www.baeldung.com/tomcat-programmatic-setup) |  | ||||||
| - [A Docker Guide for Java](http://www.baeldung.com/docker-java-api) | - [A Docker Guide for Java](http://www.baeldung.com/docker-java-api) | ||||||
| - [Exceptions in Netty](http://www.baeldung.com/netty-exception-handling) |  | ||||||
| - [Creating and Configuring Jetty 9 Server in Java](http://www.baeldung.com/jetty-java-programmatic) |  | ||||||
| - [Introduction To OpenCSV](http://www.baeldung.com/opencsv) | - [Introduction To OpenCSV](http://www.baeldung.com/opencsv) | ||||||
| - [Introduction to Akka Actors in Java](http://www.baeldung.com/akka-actors-java) | - [Introduction to Akka Actors in Java](http://www.baeldung.com/akka-actors-java) | ||||||
| - [Asynchronous HTTP with async-http-client in Java](http://www.baeldung.com/async-http-client) | - [Asynchronous HTTP with async-http-client in Java](http://www.baeldung.com/async-http-client) | ||||||
| @ -77,7 +72,6 @@ | |||||||
| - [Publish and Receive Messages with Nats Java Client](http://www.baeldung.com/nats-java-client) | - [Publish and Receive Messages with Nats Java Client](http://www.baeldung.com/nats-java-client) | ||||||
| - [Java Concurrency Utility with JCTools](http://www.baeldung.com/java-concurrency-jc-tools) | - [Java Concurrency Utility with JCTools](http://www.baeldung.com/java-concurrency-jc-tools) | ||||||
| - [Apache Commons Collections MapUtils](http://www.baeldung.com/apache-commons-map-utils) | - [Apache Commons Collections MapUtils](http://www.baeldung.com/apache-commons-map-utils) | ||||||
| - [Testing Netty with EmbeddedChannel](http://www.baeldung.com/testing-netty-embedded-channel) |  | ||||||
| - [Creating REST Microservices with Javalin](http://www.baeldung.com/javalin-rest-microservices) | - [Creating REST Microservices with Javalin](http://www.baeldung.com/javalin-rest-microservices) | ||||||
| - [Introduction to JavaPoet](http://www.baeldung.com/java-poet) | - [Introduction to JavaPoet](http://www.baeldung.com/java-poet) | ||||||
| - [Introduction to Joda-Time](http://www.baeldung.com/joda-time) | - [Introduction to Joda-Time](http://www.baeldung.com/joda-time) | ||||||
|  | |||||||
| @ -106,21 +106,6 @@ | |||||||
|             <artifactId>javers-core</artifactId> |             <artifactId>javers-core</artifactId> | ||||||
|             <version>${javers.version}</version> |             <version>${javers.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.eclipse.jetty</groupId> |  | ||||||
|             <artifactId>jetty-server</artifactId> |  | ||||||
|             <version>${jetty.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.eclipse.jetty</groupId> |  | ||||||
|             <artifactId>jetty-servlet</artifactId> |  | ||||||
|             <version>${jetty.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.eclipse.jetty</groupId> |  | ||||||
|             <artifactId>jetty-webapp</artifactId> |  | ||||||
|             <version>${jetty.version}</version> |  | ||||||
|         </dependency> |  | ||||||
| 
 | 
 | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>io.nats</groupId> |             <groupId>io.nats</groupId> | ||||||
| @ -379,11 +364,6 @@ | |||||||
|             <artifactId>jmh-generator-annprocess</artifactId> |             <artifactId>jmh-generator-annprocess</artifactId> | ||||||
|             <version>${jmh.version}</version> |             <version>${jmh.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|         <dependency> |  | ||||||
|             <groupId>io.netty</groupId> |  | ||||||
|             <artifactId>netty-all</artifactId> |  | ||||||
|             <version>${netty.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>junit</groupId> |             <groupId>junit</groupId> | ||||||
|             <artifactId>junit</artifactId> |             <artifactId>junit</artifactId> | ||||||
| @ -659,12 +639,6 @@ | |||||||
|             <scope>test</scope> |             <scope>test</scope> | ||||||
|         </dependency> |         </dependency> | ||||||
| 		 | 		 | ||||||
|         <!-- tomcat --> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.apache.tomcat</groupId> |  | ||||||
|             <artifactId>tomcat-catalina</artifactId> |  | ||||||
|             <version>${tomcat.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.milyn</groupId> |             <groupId>org.milyn</groupId> | ||||||
|             <artifactId>milyn-smooks-all</artifactId> |             <artifactId>milyn-smooks-all</artifactId> | ||||||
| @ -924,7 +898,6 @@ | |||||||
|         <commons.io.version>2.5</commons.io.version> |         <commons.io.version>2.5</commons.io.version> | ||||||
|         <commons.dbutils.version>1.6</commons.dbutils.version> |         <commons.dbutils.version>1.6</commons.dbutils.version> | ||||||
|         <h2.version>1.4.196</h2.version> |         <h2.version>1.4.196</h2.version> | ||||||
|         <jetty.version>9.4.8.v20171121</jetty.version> |  | ||||||
|         <jnats.version>1.0</jnats.version> |         <jnats.version>1.0</jnats.version> | ||||||
| 
 | 
 | ||||||
|         <httpclient.version>4.5.3</httpclient.version> |         <httpclient.version>4.5.3</httpclient.version> | ||||||
| @ -937,7 +910,6 @@ | |||||||
|         <serenity.jira.version>1.9.0</serenity.jira.version> |         <serenity.jira.version>1.9.0</serenity.jira.version> | ||||||
|         <serenity.plugin.version>1.9.27</serenity.plugin.version> |         <serenity.plugin.version>1.9.27</serenity.plugin.version> | ||||||
|         <jUnitParams.version>1.1.0</jUnitParams.version> |         <jUnitParams.version>1.1.0</jUnitParams.version> | ||||||
|         <netty.version>4.1.20.Final</netty.version> |  | ||||||
|         <commons.collections.version>4.1</commons.collections.version> |         <commons.collections.version>4.1</commons.collections.version> | ||||||
|         <junit.version>4.12</junit.version> |         <junit.version>4.12</junit.version> | ||||||
|         <java-lsh.version>0.10</java-lsh.version> |         <java-lsh.version>0.10</java-lsh.version> | ||||||
| @ -966,7 +938,6 @@ | |||||||
|         <kafka.version>1.0.0</kafka.version> |         <kafka.version>1.0.0</kafka.version> | ||||||
|         <smooks.version>1.7.0</smooks.version> |         <smooks.version>1.7.0</smooks.version> | ||||||
|         <docker.version>3.0.14</docker.version> |         <docker.version>3.0.14</docker.version> | ||||||
|         <tomcat.version>8.5.24</tomcat.version> |  | ||||||
|         <async.http.client.version>2.2.0</async.http.client.version> |         <async.http.client.version>2.2.0</async.http.client.version> | ||||||
|         <infinispan.version>9.1.5.Final</infinispan.version> |         <infinispan.version>9.1.5.Final</infinispan.version> | ||||||
|         <opencsv.version>4.1</opencsv.version> |         <opencsv.version>4.1</opencsv.version> | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
| # Relevant Articles | # Relevant Articles | ||||||
| 
 | 
 | ||||||
| * [A Guide to SqlResultSetMapping](http://www.baeldung.com/jpa-sql-resultset-mapping) | - [A Guide to SqlResultSetMapping](http://www.baeldung.com/jpa-sql-resultset-mapping) | ||||||
|  | - [A Guide to Stored Procedures with JPA](http://www.baeldung.com/jpa-stored-procedures) | ||||||
| @ -20,4 +20,18 @@ | |||||||
|             <property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/> |             <property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/> | ||||||
|         </properties> |         </properties> | ||||||
|     </persistence-unit> |     </persistence-unit> | ||||||
|  |      | ||||||
|  |     <persistence-unit name="jpa-db"> | ||||||
|  |         <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | ||||||
|  |         <class>com.baeldung.jpa.model.Car</class> | ||||||
|  |         <properties> | ||||||
|  |             <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> | ||||||
|  |             <property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/baeldung" /> | ||||||
|  |             <property name="javax.persistence.jdbc.user" value="baeldung" /> | ||||||
|  |             <property name="javax.persistence.jdbc.password" value="YourPassword" /> | ||||||
|  |             <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> | ||||||
|  |             <property name="hibernate.show_sql" value="true" /> | ||||||
|  |         </properties> | ||||||
|  |     </persistence-unit> | ||||||
|  | 	 | ||||||
| </persistence> | </persistence> | ||||||
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @ -398,7 +398,6 @@ | |||||||
| 				<module>jee-7</module> | 				<module>jee-7</module> | ||||||
| 				<module>jhipster/jhipster-monolithic</module> | 				<module>jhipster/jhipster-monolithic</module> | ||||||
| 				<module>jjwt</module> | 				<module>jjwt</module> | ||||||
| 				<module>jpa-storedprocedure</module> |  | ||||||
| 				<module>jsf</module> | 				<module>jsf</module> | ||||||
| 				<module>json-path</module> | 				<module>json-path</module> | ||||||
| 				<module>json</module> | 				<module>json</module> | ||||||
| @ -949,7 +948,6 @@ | |||||||
| 				<module>jgroups</module> | 				<module>jgroups</module> | ||||||
| 				<module>jee-7</module> | 				<module>jee-7</module> | ||||||
| 				<module>jjwt</module> | 				<module>jjwt</module> | ||||||
| 				<module>jpa-storedprocedure</module> |  | ||||||
| 				<module>jsf</module> | 				<module>jsf</module> | ||||||
| 				<module>json-path</module> | 				<module>json-path</module> | ||||||
| 				<module>json</module> | 				<module>json</module> | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter | |||||||
| 
 | 
 | ||||||
| @Controller | @Controller | ||||||
| public class ResponseBodyEmitterController { | public class ResponseBodyEmitterController { | ||||||
|     private ExecutorService nonBlockingService = Executors.newSingleThreadExecutor(); |     private ExecutorService nonBlockingService = Executors.newCachedThreadPool(); | ||||||
| 
 | 
 | ||||||
|     @GetMapping(Constants.API_RBE) |     @GetMapping(Constants.API_RBE) | ||||||
|     public ResponseEntity<ResponseBodyEmitter> handleRbe() { |     public ResponseEntity<ResponseBodyEmitter> handleRbe() { | ||||||
|  | |||||||
| @ -1,344 +1,344 @@ | |||||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | <project xmlns="http://maven.apache.org/POM/4.0.0" 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"> |     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
| 	<modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
| 	<groupId>com.baeldung</groupId> |     <groupId>com.baeldung</groupId> | ||||||
| 	<artifactId>spring-rest-full</artifactId> |     <artifactId>spring-rest-full</artifactId> | ||||||
| 	<version>0.1-SNAPSHOT</version> |     <version>0.1-SNAPSHOT</version> | ||||||
| 	<name>spring-rest-full</name> |     <name>spring-rest-full</name> | ||||||
| 	<packaging>war</packaging> |     <packaging>war</packaging> | ||||||
| 
 | 
 | ||||||
| 	<parent> |     <parent> | ||||||
| 		<artifactId>parent-boot-1</artifactId> |         <artifactId>parent-boot-1</artifactId> | ||||||
| 		<groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
| 		<version>0.0.1-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
| 		<relativePath>../parent-boot-1</relativePath> |         <relativePath>../parent-boot-1</relativePath> | ||||||
| 	</parent> |     </parent> | ||||||
| 
 | 
 | ||||||
| 	<dependencies> |     <dependencies> | ||||||
| 
 | 
 | ||||||
| 		<!-- Spring Boot Dependencies --> |         <!-- Spring Boot Dependencies --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-web</artifactId> |             <artifactId>spring-boot-starter-web</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-actuator</artifactId> |             <artifactId>spring-boot-starter-actuator</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.aspectj</groupId> |             <groupId>org.aspectj</groupId> | ||||||
| 			<artifactId>aspectjweaver</artifactId> |             <artifactId>aspectjweaver</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.apache.tomcat.embed</groupId> |             <groupId>org.apache.tomcat.embed</groupId> | ||||||
| 			<artifactId>tomcat-embed-jasper</artifactId> |             <artifactId>tomcat-embed-jasper</artifactId> | ||||||
| 			<scope>provided</scope> |             <scope>provided</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- Spring --> |         <!-- Spring --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-core</artifactId> |             <artifactId>spring-core</artifactId> | ||||||
| 			<exclusions> |             <exclusions> | ||||||
| 				<exclusion> |                 <exclusion> | ||||||
| 					<artifactId>commons-logging</artifactId> |                     <artifactId>commons-logging</artifactId> | ||||||
| 					<groupId>commons-logging</groupId> |                     <groupId>commons-logging</groupId> | ||||||
| 				</exclusion> |                 </exclusion> | ||||||
| 			</exclusions> |             </exclusions> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-context</artifactId> |             <artifactId>spring-context</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-jdbc</artifactId> |             <artifactId>spring-jdbc</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-beans</artifactId> |             <artifactId>spring-beans</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-aop</artifactId> |             <artifactId>spring-aop</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-tx</artifactId> |             <artifactId>spring-tx</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-expression</artifactId> |             <artifactId>spring-expression</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-web</artifactId> |             <artifactId>spring-web</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-webmvc</artifactId> |             <artifactId>spring-webmvc</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.data</groupId> |             <groupId>org.springframework.data</groupId> | ||||||
| 			<artifactId>spring-data-commons</artifactId> |             <artifactId>spring-data-commons</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- deployment --> |         <!-- deployment --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-tomcat</artifactId> |             <artifactId>spring-boot-starter-tomcat</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- web --> |         <!-- web --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.apache.httpcomponents</groupId> |             <groupId>org.apache.httpcomponents</groupId> | ||||||
| 			<artifactId>httpclient</artifactId> |             <artifactId>httpclient</artifactId> | ||||||
| 			<exclusions> |             <exclusions> | ||||||
| 				<exclusion> |                 <exclusion> | ||||||
| 					<artifactId>commons-logging</artifactId> |                     <artifactId>commons-logging</artifactId> | ||||||
| 					<groupId>commons-logging</groupId> |                     <groupId>commons-logging</groupId> | ||||||
| 				</exclusion> |                 </exclusion> | ||||||
| 			</exclusions> |             </exclusions> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.apache.httpcomponents</groupId> |             <groupId>org.apache.httpcomponents</groupId> | ||||||
| 			<artifactId>httpcore</artifactId> |             <artifactId>httpcore</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- persistence --> |         <!-- persistence --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-orm</artifactId> |             <artifactId>spring-orm</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.data</groupId> |             <groupId>org.springframework.data</groupId> | ||||||
| 			<artifactId>spring-data-jpa</artifactId> |             <artifactId>spring-data-jpa</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.hibernate</groupId> |             <groupId>org.hibernate</groupId> | ||||||
| 			<artifactId>hibernate-entitymanager</artifactId> |             <artifactId>hibernate-entitymanager</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>xml-apis</groupId> |             <groupId>xml-apis</groupId> | ||||||
| 			<artifactId>xml-apis</artifactId> |             <artifactId>xml-apis</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.javassist</groupId> |             <groupId>org.javassist</groupId> | ||||||
| 			<artifactId>javassist</artifactId> |             <artifactId>javassist</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>mysql</groupId> |             <groupId>mysql</groupId> | ||||||
| 			<artifactId>mysql-connector-java</artifactId> |             <artifactId>mysql-connector-java</artifactId> | ||||||
| 			<scope>runtime</scope> |             <scope>runtime</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.h2database</groupId> |             <groupId>com.h2database</groupId> | ||||||
| 			<artifactId>h2</artifactId> |             <artifactId>h2</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- web --> |         <!-- web --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>javax.servlet</groupId> |             <groupId>javax.servlet</groupId> | ||||||
| 			<artifactId>javax.servlet-api</artifactId> |             <artifactId>javax.servlet-api</artifactId> | ||||||
| 			<scope>provided</scope> |             <scope>provided</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>javax.servlet</groupId> |             <groupId>javax.servlet</groupId> | ||||||
| 			<artifactId>jstl</artifactId> |             <artifactId>jstl</artifactId> | ||||||
| 			<scope>runtime</scope> |             <scope>runtime</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- marshalling --> |         <!-- marshalling --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.fasterxml.jackson.core</groupId> |             <groupId>com.fasterxml.jackson.core</groupId> | ||||||
| 			<artifactId>jackson-databind</artifactId> |             <artifactId>jackson-databind</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.thoughtworks.xstream</groupId> |             <groupId>com.thoughtworks.xstream</groupId> | ||||||
| 			<artifactId>xstream</artifactId> |             <artifactId>xstream</artifactId> | ||||||
| 			<version>${xstream.version}</version> |             <version>${xstream.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- util --> |         <!-- util --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.google.guava</groupId> |             <groupId>com.google.guava</groupId> | ||||||
| 			<artifactId>guava</artifactId> |             <artifactId>guava</artifactId> | ||||||
| 			<version>${guava.version}</version> |             <version>${guava.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- test scoped --> |         <!-- test scoped --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-test</artifactId> |             <artifactId>spring-test</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- <dependency> --> |         <!-- <dependency> --> | ||||||
| 		<!-- <groupId>org.hamcrest</groupId> --> |         <!-- <groupId>org.hamcrest</groupId> --> | ||||||
| 		<!-- <artifactId>hamcrest-core</artifactId> --> |         <!-- <artifactId>hamcrest-core</artifactId> --> | ||||||
| 		<!-- <scope>test</scope> --> |         <!-- <scope>test</scope> --> | ||||||
| 		<!-- </dependency> --> |         <!-- </dependency> --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.hamcrest</groupId> |             <groupId>org.hamcrest</groupId> | ||||||
| 			<artifactId>hamcrest-library</artifactId> |             <artifactId>hamcrest-library</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.mockito</groupId> |             <groupId>org.mockito</groupId> | ||||||
| 			<artifactId>mockito-core</artifactId> |             <artifactId>mockito-core</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 	</dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
| 	<build> |     <build> | ||||||
| 		<finalName>spring-rest-full</finalName> |         <finalName>spring-rest-full</finalName> | ||||||
| 		<resources> |         <resources> | ||||||
| 			<resource> |             <resource> | ||||||
| 				<directory>src/main/resources</directory> |                 <directory>src/main/resources</directory> | ||||||
| 				<filtering>true</filtering> |                 <filtering>true</filtering> | ||||||
| 			</resource> |             </resource> | ||||||
| 		</resources> |         </resources> | ||||||
| 		<plugins> |         <plugins> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.apache.maven.plugins</groupId> |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
| 				<artifactId>maven-war-plugin</artifactId> |                 <artifactId>maven-war-plugin</artifactId> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 			<!-- Because we are using custom surefire configs in live profile hence need to disable all other in default profile --> |             <!-- Because we are using custom surefire configs in live profile hence need to disable all other in default profile --> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.apache.maven.plugins</groupId> |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
| 				<artifactId>maven-surefire-plugin</artifactId> |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
| 				<configuration> |                 <configuration> | ||||||
| 					<forkCount>3</forkCount> |                     <forkCount>3</forkCount> | ||||||
| 					<reuseForks>true</reuseForks> |                     <reuseForks>true</reuseForks> | ||||||
| 					<excludes> |                     <excludes> | ||||||
| 						<exclude>**/*IntegrationTest.java</exclude> |                         <exclude>**/*IntegrationTest.java</exclude> | ||||||
| 						<exclude>**/*IntTest.java</exclude> |                         <exclude>**/*IntTest.java</exclude> | ||||||
| 						<exclude>**/*LongRunningUnitTest.java</exclude> |                         <exclude>**/*LongRunningUnitTest.java</exclude> | ||||||
| 						<exclude>**/*ManualTest.java</exclude> |                         <exclude>**/*ManualTest.java</exclude> | ||||||
| 						<exclude>**/*LiveTest.java</exclude> |                         <exclude>**/*LiveTest.java</exclude> | ||||||
| 						<exclude>**/*TestSuite.java</exclude> |                         <exclude>**/*TestSuite.java</exclude> | ||||||
| 					</excludes> |                     </excludes> | ||||||
| 				</configuration> |                 </configuration> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.codehaus.cargo</groupId> |                 <groupId>org.codehaus.cargo</groupId> | ||||||
| 				<artifactId>cargo-maven2-plugin</artifactId> |                 <artifactId>cargo-maven2-plugin</artifactId> | ||||||
| 				<version>${cargo-maven2-plugin.version}</version> |                 <version>${cargo-maven2-plugin.version}</version> | ||||||
| 				<configuration> |                 <configuration> | ||||||
| 					<wait>true</wait> |                     <wait>true</wait> | ||||||
| 					<container> |                     <container> | ||||||
| 						<containerId>jetty8x</containerId> |                         <containerId>jetty8x</containerId> | ||||||
| 						<type>embedded</type> |                         <type>embedded</type> | ||||||
| 						<systemProperties> |                         <systemProperties> | ||||||
| 							<!-- <provPersistenceTarget>cargo</provPersistenceTarget> --> |                             <!-- <provPersistenceTarget>cargo</provPersistenceTarget> --> | ||||||
| 						</systemProperties> |                         </systemProperties> | ||||||
| 					</container> |                     </container> | ||||||
| 					<configuration> |                     <configuration> | ||||||
| 						<properties> |                         <properties> | ||||||
| 							<cargo.servlet.port>8082</cargo.servlet.port> |                             <cargo.servlet.port>8082</cargo.servlet.port> | ||||||
| 						</properties> |                         </properties> | ||||||
| 					</configuration> |                     </configuration> | ||||||
| 				</configuration> |                 </configuration> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 			<!-- Querydsl and Specifications --> |             <!-- Querydsl and Specifications --> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>com.mysema.maven</groupId> |                 <groupId>com.mysema.maven</groupId> | ||||||
| 				<artifactId>apt-maven-plugin</artifactId> |                 <artifactId>apt-maven-plugin</artifactId> | ||||||
| 				<version>${apt-maven-plugin.version}</version> |                 <version>${apt-maven-plugin.version}</version> | ||||||
| 				<executions> |                 <executions> | ||||||
| 					<execution> |                     <execution> | ||||||
| 						<goals> |                         <goals> | ||||||
| 							<goal>process</goal> |                             <goal>process</goal> | ||||||
| 						</goals> |                         </goals> | ||||||
| 						<configuration> |                         <configuration> | ||||||
| 							<outputDirectory>target/generated-sources/java</outputDirectory> |                             <outputDirectory>target/generated-sources/java</outputDirectory> | ||||||
| 							<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> |                             <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> | ||||||
| 						</configuration> |                         </configuration> | ||||||
| 					</execution> |                     </execution> | ||||||
| 				</executions> |                 </executions> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 		</plugins> |         </plugins> | ||||||
| 	</build> |     </build> | ||||||
| 
 | 
 | ||||||
| 	<profiles> |     <profiles> | ||||||
| 		<profile> |         <profile> | ||||||
| 			<id>live</id> |             <id>live</id> | ||||||
| 			<build> |             <build> | ||||||
| 				<plugins> |                 <plugins> | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.apache.maven.plugins</groupId> |                         <groupId>org.apache.maven.plugins</groupId> | ||||||
| 						<artifactId>maven-surefire-plugin</artifactId> |                         <artifactId>maven-surefire-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<phase>integration-test</phase> |                                 <phase>integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>test</goal> |                                     <goal>test</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 								<configuration> |                                 <configuration> | ||||||
| 									<excludes> |                                     <excludes> | ||||||
| 										<exclude>**/*IntegrationTest.java</exclude> |                                         <exclude>**/*IntegrationTest.java</exclude> | ||||||
| 										<exclude>**/*IntTest.java</exclude> |                                         <exclude>**/*IntTest.java</exclude> | ||||||
| 									</excludes> |                                     </excludes> | ||||||
| 									<includes> |                                     <includes> | ||||||
| 										<include>**/*LiveTest.java</include> |                                         <include>**/*LiveTest.java</include> | ||||||
| 									</includes> |                                     </includes> | ||||||
| 								</configuration> |                                 </configuration> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 						<configuration> |                         <configuration> | ||||||
| 							<systemPropertyVariables> |                             <systemPropertyVariables> | ||||||
| 								<test.mime>json</test.mime> |                                 <test.mime>json</test.mime> | ||||||
| 							</systemPropertyVariables> |                             </systemPropertyVariables> | ||||||
| 						</configuration> |                         </configuration> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.codehaus.cargo</groupId> |                         <groupId>org.codehaus.cargo</groupId> | ||||||
| 						<artifactId>cargo-maven2-plugin</artifactId> |                         <artifactId>cargo-maven2-plugin</artifactId> | ||||||
| 						<configuration> |                         <configuration> | ||||||
| 							<wait>false</wait> |                             <wait>false</wait> | ||||||
| 						</configuration> |                         </configuration> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>start-server</id> |                                 <id>start-server</id> | ||||||
| 								<phase>pre-integration-test</phase> |                                 <phase>pre-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>start</goal> |                                     <goal>start</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>stop-server</id> |                                 <id>stop-server</id> | ||||||
| 								<phase>post-integration-test</phase> |                                 <phase>post-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>stop</goal> |                                     <goal>stop</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 				</plugins> |                 </plugins> | ||||||
| 			</build> |             </build> | ||||||
| 		</profile> |         </profile> | ||||||
| 	</profiles> |     </profiles> | ||||||
| 
 | 
 | ||||||
| 	<properties> |     <properties> | ||||||
| 		<!-- various --> |         <!-- various --> | ||||||
| 		<xstream.version>1.4.9</xstream.version> |         <xstream.version>1.4.9</xstream.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- util --> |         <!-- util --> | ||||||
| 		<guava.version>19.0</guava.version> |         <guava.version>19.0</guava.version> | ||||||
| 		<commons-lang3.version>3.5</commons-lang3.version> |         <commons-lang3.version>3.5</commons-lang3.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- Maven plugins --> |         <!-- Maven plugins --> | ||||||
| 		<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version> |         <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version> | ||||||
| 		<apt-maven-plugin.version>1.1.3</apt-maven-plugin.version> |         <apt-maven-plugin.version>1.1.3</apt-maven-plugin.version> | ||||||
| 	</properties> |     </properties> | ||||||
| 
 | 
 | ||||||
| </project> | </project> | ||||||
| @ -1,339 +1,339 @@ | |||||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | <project xmlns="http://maven.apache.org/POM/4.0.0" 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"> |     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
| 	<modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
| 	<groupId>com.baeldung</groupId> |     <groupId>com.baeldung</groupId> | ||||||
| 	<artifactId>spring-rest-simple</artifactId> |     <artifactId>spring-rest-simple</artifactId> | ||||||
| 	<version>0.1-SNAPSHOT</version> |     <version>0.1-SNAPSHOT</version> | ||||||
| 	<name>spring-rest-simple</name> |     <name>spring-rest-simple</name> | ||||||
| 	<packaging>war</packaging> |     <packaging>war</packaging> | ||||||
| 
 | 
 | ||||||
| 	<parent> |     <parent> | ||||||
| 		<artifactId>parent-boot-1</artifactId> |         <artifactId>parent-boot-1</artifactId> | ||||||
| 		<groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
| 		<version>0.0.1-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
| 		<relativePath>../parent-boot-1</relativePath> |         <relativePath>../parent-boot-1</relativePath> | ||||||
| 	</parent> |     </parent> | ||||||
| 
 | 
 | ||||||
| 	<dependencies> |     <dependencies> | ||||||
| 
 | 
 | ||||||
| 		<!-- Spring Boot Dependencies --> |         <!-- Spring Boot Dependencies --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-thymeleaf</artifactId> |             <artifactId>spring-boot-starter-thymeleaf</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-actuator</artifactId> |             <artifactId>spring-boot-starter-actuator</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-devtools</artifactId> |             <artifactId>spring-boot-devtools</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-test</artifactId> |             <artifactId>spring-boot-starter-test</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- Spring --> |         <!-- Spring --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-web</artifactId> |             <artifactId>spring-web</artifactId> | ||||||
| 			<exclusions> |             <exclusions> | ||||||
| 				<exclusion> |                 <exclusion> | ||||||
| 					<artifactId>commons-logging</artifactId> |                     <artifactId>commons-logging</artifactId> | ||||||
| 					<groupId>commons-logging</groupId> |                     <groupId>commons-logging</groupId> | ||||||
| 				</exclusion> |                 </exclusion> | ||||||
| 			</exclusions> |             </exclusions> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-webmvc</artifactId> |             <artifactId>spring-webmvc</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-oxm</artifactId> |             <artifactId>spring-oxm</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>commons-fileupload</groupId> |             <groupId>commons-fileupload</groupId> | ||||||
| 			<artifactId>commons-fileupload</artifactId> |             <artifactId>commons-fileupload</artifactId> | ||||||
| 			<version>${commons-fileupload.version}</version> |             <version>${commons-fileupload.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<!-- web --> |         <!-- web --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>javax.servlet</groupId> |             <groupId>javax.servlet</groupId> | ||||||
| 			<artifactId>javax.servlet-api</artifactId> |             <artifactId>javax.servlet-api</artifactId> | ||||||
| 			<scope>provided</scope> |             <scope>provided</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>javax.servlet</groupId> |             <groupId>javax.servlet</groupId> | ||||||
| 			<artifactId>jstl</artifactId> |             <artifactId>jstl</artifactId> | ||||||
| 			<scope>runtime</scope> |             <scope>runtime</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- marshalling --> |         <!-- marshalling --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.fasterxml.jackson.core</groupId> |             <groupId>com.fasterxml.jackson.core</groupId> | ||||||
| 			<artifactId>jackson-databind</artifactId> |             <artifactId>jackson-databind</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.fasterxml.jackson.dataformat</groupId> |             <groupId>com.fasterxml.jackson.dataformat</groupId> | ||||||
| 			<artifactId>jackson-dataformat-xml</artifactId> |             <artifactId>jackson-dataformat-xml</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.thoughtworks.xstream</groupId> |             <groupId>com.thoughtworks.xstream</groupId> | ||||||
| 			<artifactId>xstream</artifactId> |             <artifactId>xstream</artifactId> | ||||||
| 			<version>${xstream.version}</version> |             <version>${xstream.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- util --> |         <!-- util --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.google.guava</groupId> |             <groupId>com.google.guava</groupId> | ||||||
| 			<artifactId>guava</artifactId> |             <artifactId>guava</artifactId> | ||||||
| 			<version>${guava.version}</version> |             <version>${guava.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.apache.commons</groupId> |             <groupId>org.apache.commons</groupId> | ||||||
| 			<artifactId>commons-lang3</artifactId> |             <artifactId>commons-lang3</artifactId> | ||||||
| 			<version>${commons-lang3.version}</version> |             <version>${commons-lang3.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- logging --> |         <!-- logging --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.slf4j</groupId> |             <groupId>org.slf4j</groupId> | ||||||
| 			<artifactId>slf4j-api</artifactId> |             <artifactId>slf4j-api</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>ch.qos.logback</groupId> |             <groupId>ch.qos.logback</groupId> | ||||||
| 			<artifactId>logback-classic</artifactId> |             <artifactId>logback-classic</artifactId> | ||||||
| 			<!-- <scope>runtime</scope> --> |             <!-- <scope>runtime</scope> --> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.slf4j</groupId> |             <groupId>org.slf4j</groupId> | ||||||
| 			<artifactId>jcl-over-slf4j</artifactId> |             <artifactId>jcl-over-slf4j</artifactId> | ||||||
| 			<!-- <scope>runtime</scope> --> <!-- some spring dependencies need to compile against jcl --> |             <!-- <scope>runtime</scope> --> <!-- some spring dependencies need to compile against jcl --> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- okhttp --> |         <!-- okhttp --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.squareup.okhttp3</groupId> |             <groupId>com.squareup.okhttp3</groupId> | ||||||
| 			<artifactId>okhttp</artifactId> |             <artifactId>okhttp</artifactId> | ||||||
| 			<version>${com.squareup.okhttp3.version}</version> |             <version>${com.squareup.okhttp3.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- test scoped --> |         <!-- test scoped --> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>junit</groupId> |             <groupId>junit</groupId> | ||||||
| 			<artifactId>junit</artifactId> |             <artifactId>junit</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.hamcrest</groupId> |             <groupId>org.hamcrest</groupId> | ||||||
| 			<artifactId>hamcrest-core</artifactId> |             <artifactId>hamcrest-core</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.hamcrest</groupId> |             <groupId>org.hamcrest</groupId> | ||||||
| 			<artifactId>hamcrest-library</artifactId> |             <artifactId>hamcrest-library</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.mockito</groupId> |             <groupId>org.mockito</groupId> | ||||||
| 			<artifactId>mockito-core</artifactId> |             <artifactId>mockito-core</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-test</artifactId> |             <artifactId>spring-test</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.jayway.restassured</groupId> |             <groupId>com.jayway.restassured</groupId> | ||||||
| 			<artifactId>rest-assured</artifactId> |             <artifactId>rest-assured</artifactId> | ||||||
| 			<version>${jayway-rest-assured.version}</version> |             <version>${jayway-rest-assured.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.google.protobuf</groupId> |             <groupId>com.google.protobuf</groupId> | ||||||
| 			<artifactId>protobuf-java</artifactId> |             <artifactId>protobuf-java</artifactId> | ||||||
| 			<version>${protobuf-java.version}</version> |             <version>${protobuf-java.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.googlecode.protobuf-java-format</groupId> |             <groupId>com.googlecode.protobuf-java-format</groupId> | ||||||
| 			<artifactId>protobuf-java-format</artifactId> |             <artifactId>protobuf-java-format</artifactId> | ||||||
| 			<version>${protobuf-java-format.version}</version> |             <version>${protobuf-java-format.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.esotericsoftware</groupId> |             <groupId>com.esotericsoftware</groupId> | ||||||
| 			<artifactId>kryo</artifactId> |             <artifactId>kryo</artifactId> | ||||||
| 			<version>${kryo.version}</version> |             <version>${kryo.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.jayway.jsonpath</groupId> |             <groupId>com.jayway.jsonpath</groupId> | ||||||
| 			<artifactId>json-path</artifactId> |             <artifactId>json-path</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 	</dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
| 	<build> |     <build> | ||||||
| 		<finalName>spring-rest</finalName> |         <finalName>spring-rest</finalName> | ||||||
| 		<resources> |         <resources> | ||||||
| 			<resource> |             <resource> | ||||||
| 				<directory>src/main/resources</directory> |                 <directory>src/main/resources</directory> | ||||||
| 				<filtering>true</filtering> |                 <filtering>true</filtering> | ||||||
| 			</resource> |             </resource> | ||||||
| 		</resources> |         </resources> | ||||||
| 		<plugins> |         <plugins> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.codehaus.cargo</groupId> |                 <groupId>org.codehaus.cargo</groupId> | ||||||
| 				<artifactId>cargo-maven2-plugin</artifactId> |                 <artifactId>cargo-maven2-plugin</artifactId> | ||||||
| 				<version>${cargo-maven2-plugin.version}</version> |                 <version>${cargo-maven2-plugin.version}</version> | ||||||
| 				<configuration> |                 <configuration> | ||||||
| 					<!--<wait>true</wait> caused errors on commit --> |                     <!--<wait>true</wait> caused errors on commit --> | ||||||
| 					<container> |                     <container> | ||||||
| 						<containerId>tomcat8x</containerId> |                         <containerId>tomcat8x</containerId> | ||||||
| 						<type>embedded</type> |                         <type>embedded</type> | ||||||
| 						<systemProperties> |                         <systemProperties> | ||||||
| 							<!-- <provPersistenceTarget>cargo</provPersistenceTarget> --> |                             <!-- <provPersistenceTarget>cargo</provPersistenceTarget> --> | ||||||
| 						</systemProperties> |                         </systemProperties> | ||||||
| 					</container> |                     </container> | ||||||
| 					<configuration> |                     <configuration> | ||||||
| 						<properties> |                         <properties> | ||||||
| 							<cargo.servlet.port>8082</cargo.servlet.port> |                             <cargo.servlet.port>8082</cargo.servlet.port> | ||||||
| 						</properties> |                         </properties> | ||||||
| 					</configuration> |                     </configuration> | ||||||
| 				</configuration> |                 </configuration> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 		</plugins> |         </plugins> | ||||||
| 	</build> |     </build> | ||||||
| 
 | 
 | ||||||
| 	<profiles> |     <profiles> | ||||||
| 		<profile> |         <profile> | ||||||
| 			<id>integration</id> |             <id>integration</id> | ||||||
| 			<build> |             <build> | ||||||
| 				<plugins> |                 <plugins> | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.codehaus.cargo</groupId> |                         <groupId>org.codehaus.cargo</groupId> | ||||||
| 						<artifactId>cargo-maven2-plugin</artifactId> |                         <artifactId>cargo-maven2-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>start-server</id> |                                 <id>start-server</id> | ||||||
| 								<phase>pre-integration-test</phase> |                                 <phase>pre-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>start</goal> |                                     <goal>start</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>stop-server</id> |                                 <id>stop-server</id> | ||||||
| 								<phase>post-integration-test</phase> |                                 <phase>post-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>stop</goal> |                                     <goal>stop</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.apache.maven.plugins</groupId> |                         <groupId>org.apache.maven.plugins</groupId> | ||||||
| 						<artifactId>maven-surefire-plugin</artifactId> |                         <artifactId>maven-surefire-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<phase>integration-test</phase> |                                 <phase>integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>test</goal> |                                     <goal>test</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 								<configuration> |                                 <configuration> | ||||||
| 									<excludes> |                                     <excludes> | ||||||
| 										<exclude>none</exclude> |                                         <exclude>none</exclude> | ||||||
| 									</excludes> |                                     </excludes> | ||||||
| 									<includes> |                                     <includes> | ||||||
| 										<include>**/*IntegrationTest.java</include> |                                         <include>**/*IntegrationTest.java</include> | ||||||
| 										<include>**/*IntTest.java</include> |                                         <include>**/*IntTest.java</include> | ||||||
| 									</includes> |                                     </includes> | ||||||
| 								</configuration> |                                 </configuration> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 				</plugins> |                 </plugins> | ||||||
| 			</build> |             </build> | ||||||
| 		</profile> |         </profile> | ||||||
|          |          | ||||||
| 		<profile> |         <profile> | ||||||
| 			<id>live</id> |             <id>live</id> | ||||||
| 			<build> |             <build> | ||||||
| 				<plugins> |                 <plugins> | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.codehaus.cargo</groupId> |                         <groupId>org.codehaus.cargo</groupId> | ||||||
| 						<artifactId>cargo-maven2-plugin</artifactId> |                         <artifactId>cargo-maven2-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>start-server</id> |                                 <id>start-server</id> | ||||||
| 								<phase>pre-integration-test</phase> |                                 <phase>pre-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>start</goal> |                                     <goal>start</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>stop-server</id> |                                 <id>stop-server</id> | ||||||
| 								<phase>post-integration-test</phase> |                                 <phase>post-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>stop</goal> |                                     <goal>stop</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 
 | 
 | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.apache.maven.plugins</groupId> |                         <groupId>org.apache.maven.plugins</groupId> | ||||||
| 						<artifactId>maven-surefire-plugin</artifactId> |                         <artifactId>maven-surefire-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<phase>integration-test</phase> |                                 <phase>integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>test</goal> |                                     <goal>test</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 								<configuration> |                                 <configuration> | ||||||
| 									<excludes> |                                     <excludes> | ||||||
| 										<exclude>none</exclude> |                                         <exclude>none</exclude> | ||||||
| 									</excludes> |                                     </excludes> | ||||||
| 									<includes> |                                     <includes> | ||||||
| 										<include>**/*LiveTest.java</include> |                                         <include>**/*LiveTest.java</include> | ||||||
| 									</includes> |                                     </includes> | ||||||
| 									<systemPropertyVariables> |                                     <systemPropertyVariables> | ||||||
| 										<webTarget>cargo</webTarget> |                                         <webTarget>cargo</webTarget> | ||||||
| 									</systemPropertyVariables> |                                     </systemPropertyVariables> | ||||||
| 								</configuration> |                                 </configuration> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 
 | 
 | ||||||
| 				</plugins> |                 </plugins> | ||||||
| 			</build> |             </build> | ||||||
| 		</profile> |         </profile> | ||||||
| 	</profiles> |     </profiles> | ||||||
| 
 | 
 | ||||||
| 	<properties> |     <properties> | ||||||
| 		<commons-fileupload.version>1.3.3</commons-fileupload.version> |         <commons-fileupload.version>1.3.3</commons-fileupload.version> | ||||||
| 		<kryo.version>4.0.0</kryo.version> |         <kryo.version>4.0.0</kryo.version> | ||||||
| 		<protobuf-java-format.version>1.4</protobuf-java-format.version> |         <protobuf-java-format.version>1.4</protobuf-java-format.version> | ||||||
| 		<protobuf-java.version>3.1.0</protobuf-java.version> |         <protobuf-java.version>3.1.0</protobuf-java.version> | ||||||
| 		<commons-lang3.version>3.5</commons-lang3.version> |         <commons-lang3.version>3.5</commons-lang3.version> | ||||||
| 		<xstream.version>1.4.9</xstream.version> |         <xstream.version>1.4.9</xstream.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- util --> |         <!-- util --> | ||||||
| 		<guava.version>20.0</guava.version> |         <guava.version>20.0</guava.version> | ||||||
| 		<jayway-rest-assured.version>2.9.0</jayway-rest-assured.version> |         <jayway-rest-assured.version>2.9.0</jayway-rest-assured.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- Maven plugins --> |         <!-- Maven plugins --> | ||||||
| 		<cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> |         <cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> | ||||||
| 		<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version> |         <findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- okhttp --> |         <!-- okhttp --> | ||||||
| 		<com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version> |         <com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version> | ||||||
| 
 | 
 | ||||||
| 		<json.path.version>2.2.0</json.path.version> |         <json.path.version>2.2.0</json.path.version> | ||||||
| 	</properties> |     </properties> | ||||||
| 
 | 
 | ||||||
| </project> | </project> | ||||||
|  | |||||||
| @ -1,305 +1,305 @@ | |||||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | <project xmlns="http://maven.apache.org/POM/4.0.0" 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"> |     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
| 	<modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
| 	<artifactId>spring-rest</artifactId> |     <artifactId>spring-rest</artifactId> | ||||||
| 	<version>0.1-SNAPSHOT</version> |     <version>0.1-SNAPSHOT</version> | ||||||
| 	<name>spring-rest</name> |     <name>spring-rest</name> | ||||||
| 	<packaging>war</packaging> |     <packaging>war</packaging> | ||||||
| 
 | 
 | ||||||
| 	<parent> |     <parent> | ||||||
| 		<artifactId>parent-boot-2</artifactId> |         <artifactId>parent-boot-2</artifactId> | ||||||
| 		<groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
| 		<version>0.0.1-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
| 		<relativePath>../parent-boot-2</relativePath> |         <relativePath>../parent-boot-2</relativePath> | ||||||
| 	</parent> |     </parent> | ||||||
| 
 | 
 | ||||||
| 	<dependencies> |     <dependencies> | ||||||
| 
 | 
 | ||||||
| 		<!-- Spring Boot Dependencies --> |         <!-- Spring Boot Dependencies --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-web</artifactId> |             <artifactId>spring-boot-starter-web</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-thymeleaf</artifactId> |             <artifactId>spring-boot-starter-thymeleaf</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-actuator</artifactId> |             <artifactId>spring-boot-starter-actuator</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-devtools</artifactId> |             <artifactId>spring-boot-devtools</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework.boot</groupId> |             <groupId>org.springframework.boot</groupId> | ||||||
| 			<artifactId>spring-boot-starter-test</artifactId> |             <artifactId>spring-boot-starter-test</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- Spring --> |         <!-- Spring --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-web</artifactId> |             <artifactId>spring-web</artifactId> | ||||||
| 			<exclusions> |             <exclusions> | ||||||
| 				<exclusion> |                 <exclusion> | ||||||
| 					<artifactId>commons-logging</artifactId> |                     <artifactId>commons-logging</artifactId> | ||||||
| 					<groupId>commons-logging</groupId> |                     <groupId>commons-logging</groupId> | ||||||
| 				</exclusion> |                 </exclusion> | ||||||
| 			</exclusions> |             </exclusions> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-webmvc</artifactId> |             <artifactId>spring-webmvc</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-oxm</artifactId> |             <artifactId>spring-oxm</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>commons-fileupload</groupId> |             <groupId>commons-fileupload</groupId> | ||||||
| 			<artifactId>commons-fileupload</artifactId> |             <artifactId>commons-fileupload</artifactId> | ||||||
| 			<version>${commons-fileupload.version}</version> |             <version>${commons-fileupload.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- web --> |         <!-- web --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>javax.servlet</groupId> |             <groupId>javax.servlet</groupId> | ||||||
| 			<artifactId>javax.servlet-api</artifactId> |             <artifactId>javax.servlet-api</artifactId> | ||||||
| 			<scope>provided</scope> |             <scope>provided</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>javax.servlet</groupId> |             <groupId>javax.servlet</groupId> | ||||||
| 			<artifactId>jstl</artifactId> |             <artifactId>jstl</artifactId> | ||||||
| 			<scope>runtime</scope> |             <scope>runtime</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- marshalling --> |         <!-- marshalling --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.fasterxml.jackson.core</groupId> |             <groupId>com.fasterxml.jackson.core</groupId> | ||||||
| 			<artifactId>jackson-databind</artifactId> |             <artifactId>jackson-databind</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.fasterxml.jackson.dataformat</groupId> |             <groupId>com.fasterxml.jackson.dataformat</groupId> | ||||||
| 			<artifactId>jackson-dataformat-xml</artifactId> |             <artifactId>jackson-dataformat-xml</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.thoughtworks.xstream</groupId> |             <groupId>com.thoughtworks.xstream</groupId> | ||||||
| 			<artifactId>xstream</artifactId> |             <artifactId>xstream</artifactId> | ||||||
| 			<version>${xstream.version}</version> |             <version>${xstream.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- util --> |         <!-- util --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.google.guava</groupId> |             <groupId>com.google.guava</groupId> | ||||||
| 			<artifactId>guava</artifactId> |             <artifactId>guava</artifactId> | ||||||
| 			<version>${guava.version}</version> |             <version>${guava.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.apache.commons</groupId> |             <groupId>org.apache.commons</groupId> | ||||||
| 			<artifactId>commons-lang3</artifactId> |             <artifactId>commons-lang3</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- okhttp --> |         <!-- okhttp --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.squareup.okhttp3</groupId> |             <groupId>com.squareup.okhttp3</groupId> | ||||||
| 			<artifactId>okhttp</artifactId> |             <artifactId>okhttp</artifactId> | ||||||
| 			<version>${com.squareup.okhttp3.version}</version> |             <version>${com.squareup.okhttp3.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- test scoped --> |         <!-- test scoped --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.hamcrest</groupId> |             <groupId>org.hamcrest</groupId> | ||||||
| 			<artifactId>hamcrest-core</artifactId> |             <artifactId>hamcrest-core</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.hamcrest</groupId> |             <groupId>org.hamcrest</groupId> | ||||||
| 			<artifactId>hamcrest-library</artifactId> |             <artifactId>hamcrest-library</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.mockito</groupId> |             <groupId>org.mockito</groupId> | ||||||
| 			<artifactId>mockito-core</artifactId> |             <artifactId>mockito-core</artifactId> | ||||||
| 			<scope>test</scope> |             <scope>test</scope> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
| 			<artifactId>spring-test</artifactId> |             <artifactId>spring-test</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- --> |         <!-- --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.google.protobuf</groupId> |             <groupId>com.google.protobuf</groupId> | ||||||
| 			<artifactId>protobuf-java</artifactId> |             <artifactId>protobuf-java</artifactId> | ||||||
| 			<version>${protobuf-java.version}</version> |             <version>${protobuf-java.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.googlecode.protobuf-java-format</groupId> |             <groupId>com.googlecode.protobuf-java-format</groupId> | ||||||
| 			<artifactId>protobuf-java-format</artifactId> |             <artifactId>protobuf-java-format</artifactId> | ||||||
| 			<version>${protobuf-java-format.version}</version> |             <version>${protobuf-java-format.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.esotericsoftware</groupId> |             <groupId>com.esotericsoftware</groupId> | ||||||
| 			<artifactId>kryo</artifactId> |             <artifactId>kryo</artifactId> | ||||||
| 			<version>${kryo.version}</version> |             <version>${kryo.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>com.jayway.jsonpath</groupId> |             <groupId>com.jayway.jsonpath</groupId> | ||||||
| 			<artifactId>json-path</artifactId> |             <artifactId>json-path</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 		<!-- Apache common IO for utility --> |         <!-- Apache common IO for utility --> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>commons-io</groupId> |             <groupId>commons-io</groupId> | ||||||
| 			<artifactId>commons-io</artifactId> |             <artifactId>commons-io</artifactId> | ||||||
| 			<version>2.4</version> |             <version>2.4</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>au.com.dius</groupId> |             <groupId>au.com.dius</groupId> | ||||||
| 			<artifactId>pact-jvm-provider-junit_2.11</artifactId> |             <artifactId>pact-jvm-provider-junit_2.11</artifactId> | ||||||
| 			<version>${pact.version}</version> |             <version>${pact.version}</version> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 		<dependency> |         <dependency> | ||||||
| 			<groupId>io.rest-assured</groupId> |             <groupId>io.rest-assured</groupId> | ||||||
| 			<artifactId>rest-assured</artifactId> |             <artifactId>rest-assured</artifactId> | ||||||
| 		</dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
| 	</dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
| 	<build> |     <build> | ||||||
| 		<finalName>spring-rest</finalName> |         <finalName>spring-rest</finalName> | ||||||
| 		<resources> |         <resources> | ||||||
| 			<resource> |             <resource> | ||||||
| 				<directory>src/main/resources</directory> |                 <directory>src/main/resources</directory> | ||||||
| 				<filtering>true</filtering> |                 <filtering>true</filtering> | ||||||
| 			</resource> |             </resource> | ||||||
| 		</resources> |         </resources> | ||||||
| 
 | 
 | ||||||
| 		<plugins> |         <plugins> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.springframework.boot</groupId> |                 <groupId>org.springframework.boot</groupId> | ||||||
| 				<artifactId>spring-boot-maven-plugin</artifactId> |                 <artifactId>spring-boot-maven-plugin</artifactId> | ||||||
| 				<configuration> |                 <configuration> | ||||||
| 					<skip>true</skip> |                     <skip>true</skip> | ||||||
| 				</configuration> |                 </configuration> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.apache.maven.plugins</groupId> |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
| 				<artifactId>maven-war-plugin</artifactId> |                 <artifactId>maven-war-plugin</artifactId> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.apache.maven.plugins</groupId> |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
| 				<artifactId>maven-checkstyle-plugin</artifactId> |                 <artifactId>maven-checkstyle-plugin</artifactId> | ||||||
| 				<version>${checkstyle-maven-plugin.version}</version> |                 <version>${checkstyle-maven-plugin.version}</version> | ||||||
| 				<configuration> |                 <configuration> | ||||||
| 					<configLocation>checkstyle.xml</configLocation> |                     <configLocation>checkstyle.xml</configLocation> | ||||||
| 				</configuration> |                 </configuration> | ||||||
| 				<executions> |                 <executions> | ||||||
| 					<execution> |                     <execution> | ||||||
| 						<goals> |                         <goals> | ||||||
| 							<goal>check</goal> |                             <goal>check</goal> | ||||||
| 						</goals> |                         </goals> | ||||||
| 					</execution> |                     </execution> | ||||||
| 				</executions> |                 </executions> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 		</plugins> |         </plugins> | ||||||
| 	</build> |     </build> | ||||||
| 
 | 
 | ||||||
| 	<profiles> |     <profiles> | ||||||
| 		<profile> |         <profile> | ||||||
| 			<id>live</id> |             <id>live</id> | ||||||
| 			<build> |             <build> | ||||||
| 				<plugins> |                 <plugins> | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.codehaus.cargo</groupId> |                         <groupId>org.codehaus.cargo</groupId> | ||||||
| 						<artifactId>cargo-maven2-plugin</artifactId> |                         <artifactId>cargo-maven2-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>start-server</id> |                                 <id>start-server</id> | ||||||
| 								<phase>pre-integration-test</phase> |                                 <phase>pre-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>start</goal> |                                     <goal>start</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<id>stop-server</id> |                                 <id>stop-server</id> | ||||||
| 								<phase>post-integration-test</phase> |                                 <phase>post-integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>stop</goal> |                                     <goal>stop</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 
 | 
 | ||||||
| 					<plugin> |                     <plugin> | ||||||
| 						<groupId>org.apache.maven.plugins</groupId> |                         <groupId>org.apache.maven.plugins</groupId> | ||||||
| 						<artifactId>maven-surefire-plugin</artifactId> |                         <artifactId>maven-surefire-plugin</artifactId> | ||||||
| 						<executions> |                         <executions> | ||||||
| 							<execution> |                             <execution> | ||||||
| 								<phase>integration-test</phase> |                                 <phase>integration-test</phase> | ||||||
| 								<goals> |                                 <goals> | ||||||
| 									<goal>test</goal> |                                     <goal>test</goal> | ||||||
| 								</goals> |                                 </goals> | ||||||
| 								<configuration> |                                 <configuration> | ||||||
| 									<excludes> |                                     <excludes> | ||||||
| 										<exclude>none</exclude> |                                         <exclude>none</exclude> | ||||||
| 									</excludes> |                                     </excludes> | ||||||
| 									<includes> |                                     <includes> | ||||||
| 										<include>**/*LiveTest.java</include> |                                         <include>**/*LiveTest.java</include> | ||||||
| 									</includes> |                                     </includes> | ||||||
| 									<systemPropertyVariables> |                                     <systemPropertyVariables> | ||||||
| 										<webTarget>cargo</webTarget> |                                         <webTarget>cargo</webTarget> | ||||||
| 									</systemPropertyVariables> |                                     </systemPropertyVariables> | ||||||
| 								</configuration> |                                 </configuration> | ||||||
| 							</execution> |                             </execution> | ||||||
| 						</executions> |                         </executions> | ||||||
| 					</plugin> |                     </plugin> | ||||||
| 
 | 
 | ||||||
| 				</plugins> |                 </plugins> | ||||||
| 			</build> |             </build> | ||||||
| 		</profile> |         </profile> | ||||||
| 
 | 
 | ||||||
| 	</profiles> |     </profiles> | ||||||
| 
 | 
 | ||||||
| 	<reporting> |     <reporting> | ||||||
| 		<plugins> |         <plugins> | ||||||
| 			<plugin> |             <plugin> | ||||||
| 				<groupId>org.apache.maven.plugins</groupId> |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
| 				<artifactId>maven-checkstyle-plugin</artifactId> |                 <artifactId>maven-checkstyle-plugin</artifactId> | ||||||
| 				<version>${checkstyle-maven-plugin.version}</version> |                 <version>${checkstyle-maven-plugin.version}</version> | ||||||
| 				<configuration> |                 <configuration> | ||||||
| 					<configLocation>checkstyle.xml</configLocation> |                     <configLocation>checkstyle.xml</configLocation> | ||||||
| 				</configuration> |                 </configuration> | ||||||
| 			</plugin> |             </plugin> | ||||||
| 		</plugins> |         </plugins> | ||||||
| 	</reporting> |     </reporting> | ||||||
| 
 | 
 | ||||||
| 	<properties> |     <properties> | ||||||
| 		<commons-fileupload.version>1.3.2</commons-fileupload.version> |         <commons-fileupload.version>1.3.2</commons-fileupload.version> | ||||||
| 		<kryo.version>4.0.0</kryo.version> |         <kryo.version>4.0.0</kryo.version> | ||||||
| 		<protobuf-java-format.version>1.4</protobuf-java-format.version> |         <protobuf-java-format.version>1.4</protobuf-java-format.version> | ||||||
| 		<protobuf-java.version>3.1.0</protobuf-java.version> |         <protobuf-java.version>3.1.0</protobuf-java.version> | ||||||
| 		<commons-lang3.version>3.5</commons-lang3.version> |         <commons-lang3.version>3.5</commons-lang3.version> | ||||||
| 		<xstream.version>1.4.9</xstream.version> |         <xstream.version>1.4.9</xstream.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- util --> |         <!-- util --> | ||||||
| 		<guava.version>20.0</guava.version> |         <guava.version>20.0</guava.version> | ||||||
| 
 | 
 | ||||||
| 		<!-- Maven plugins --> |         <!-- Maven plugins --> | ||||||
| 		<cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> |         <cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> | ||||||
| 		<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version> |         <findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version> | ||||||
| 		<checkstyle-maven-plugin.version>3.0.0</checkstyle-maven-plugin.version> |         <checkstyle-maven-plugin.version>3.0.0</checkstyle-maven-plugin.version> | ||||||
| 		<dependency.locations.enabled>false</dependency.locations.enabled> |         <dependency.locations.enabled>false</dependency.locations.enabled> | ||||||
| 		<!-- okhttp --> |         <!-- okhttp --> | ||||||
| 		<com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version> |         <com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version> | ||||||
| 
 | 
 | ||||||
| 		<json.path.version>2.2.0</json.path.version> |         <json.path.version>2.2.0</json.path.version> | ||||||
| 		<pact.version>3.5.11</pact.version> |         <pact.version>3.5.11</pact.version> | ||||||
| 		<rest-assured.version>3.1.0</rest-assured.version> |         <rest-assured.version>3.1.0</rest-assured.version> | ||||||
| 	</properties> |     </properties> | ||||||
| 
 | 
 | ||||||
| </project> | </project> | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| ###The Course | ### The Course | ||||||
| The "REST With Spring" Classes: http://github.learnspringsecurity.com | The "REST With Spring" Classes: http://github.learnspringsecurity.com | ||||||
| 
 | 
 | ||||||
| ###Relevant Articles: | ### Relevant Articles: | ||||||
| - [A Custom Security Expression with Spring Security](http://www.baeldung.com/spring-security-create-new-custom-security-expression) | - [A Custom Security Expression with Spring Security](http://www.baeldung.com/spring-security-create-new-custom-security-expression) | ||||||
| - [Custom AccessDecisionVoters in Spring Security](http://www.baeldung.com/spring-security-custom-voter) | - [Custom AccessDecisionVoters in Spring Security](http://www.baeldung.com/spring-security-custom-voter) | ||||||
| - [Spring Security: Authentication with a Database-backed UserDetailsService](http://www.baeldung.com/spring-security-authentication-with-a-database) | - [Spring Security: Authentication with a Database-backed UserDetailsService](http://www.baeldung.com/spring-security-authentication-with-a-database) | ||||||
| @ -9,4 +9,4 @@ The "REST With Spring" Classes: http://github.learnspringsecurity.com | |||||||
| - [Multiple Entry Points in Spring Security](http://www.baeldung.com/spring-security-multiple-entry-points) | - [Multiple Entry Points in Spring Security](http://www.baeldung.com/spring-security-multiple-entry-points) | ||||||
| - [Multiple Authentication Providers in Spring Security](http://www.baeldung.com/spring-security-multiple-auth-providers) | - [Multiple Authentication Providers in Spring Security](http://www.baeldung.com/spring-security-multiple-auth-providers) | ||||||
| - [Granted Authority Versus Role in Spring Security](http://www.baeldung.com/spring-security-granted-authority-vs-role) | - [Granted Authority Versus Role in Spring Security](http://www.baeldung.com/spring-security-granted-authority-vs-role) | ||||||
| - [Spring Data with Spring Security] (https://www.baeldung.com/spring-data-security) | - [Spring Data with Spring Security](https://www.baeldung.com/spring-data-security) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user