From 8f8679d8461b0d71e8fc290a570d67c2bcc4cfa2 Mon Sep 17 00:00:00 2001 From: Alexander Molochko Date: Tue, 27 Aug 2019 23:21:51 +0300 Subject: [PATCH 001/107] BAEL-790 Using JaVers for Data Model Auditing in Spring Data --- spring-boot-data/pom.xml | 49 ++++++++++--- .../javers/SpringBootJaVersApplication.java | 31 ++++++++ .../javers/config/JaversConfiguration.java | 20 +++++ .../com/baeldung/javers/domain/Address.java | 33 +++++++++ .../com/baeldung/javers/domain/Product.java | 61 ++++++++++++++++ .../com/baeldung/javers/domain/Store.java | 62 ++++++++++++++++ .../javers/repo/ProductRepository.java | 11 +++ .../baeldung/javers/repo/StoreRepository.java | 9 +++ .../baeldung/javers/service/StoreService.java | 59 +++++++++++++++ .../baeldung/javers/web/RebrandStoreDto.java | 5 ++ .../baeldung/javers/web/StoreController.java | 73 +++++++++++++++++++ .../baeldung/javers/web/UpdatePriceDto.java | 5 ++ .../src/main/resources/application.properties | 25 ++++++- 13 files changed, 432 insertions(+), 11 deletions(-) create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java create mode 100644 spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java diff --git a/spring-boot-data/pom.xml b/spring-boot-data/pom.xml index 9c11e09f4a..83c4c5610f 100644 --- a/spring-boot-data/pom.xml +++ b/spring-boot-data/pom.xml @@ -6,44 +6,42 @@ war spring-boot-data Spring Boot Data Module - parent-boot-2 com.baeldung 0.0.1-SNAPSHOT ../parent-boot-2 - org.springframework.boot spring-boot-starter-data-redis 2.1.6.RELEASE - + + org.javers + javers-spring-boot-starter-sql + ${javers.version} + org.springframework.boot spring-boot-starter-data-mongodb 2.1.6.RELEASE - org.springframework.boot spring-boot-starter-data-jpa 2.1.6.RELEASE - com.h2database h2 1.4.197 - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-tomcat @@ -54,8 +52,8 @@ spring-boot-starter-test test - + spring-boot @@ -98,6 +96,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + @@ -106,6 +112,22 @@ autoconfiguration + + org.springframework.boot + spring-boot-maven-plugin + + com.baeldung.javers.SpringBootJaVersApplication + JAR + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + org.apache.maven.plugins maven-surefire-plugin @@ -133,14 +155,21 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + - com.baeldung.SpringBootDataApplication + 5.6.3 2.2.4 - diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java b/spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java new file mode 100644 index 0000000000..91c9b11af5 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java @@ -0,0 +1,31 @@ +package com.baeldung.javers; + +import com.baeldung.javers.domain.Address; +import com.baeldung.javers.domain.Product; +import com.baeldung.javers.domain.Store; +import com.baeldung.javers.repo.StoreRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.event.EventListener; + +@SpringBootApplication +public class SpringBootJaVersApplication { + @Autowired + StoreRepository storeRepository; + + public static void main(String[] args) { + SpringApplication.run(SpringBootJaVersApplication.class, args); + } + + @EventListener + public void appReady(ApplicationReadyEvent event) { + Store store = new Store("Baeldung store", new Address("Some street", 22222)); + for (int i = 1; i < 3; i++) { + Product product = new Product("Product #" + i, 100 * i); + store.addProduct(product); + } + storeRepository.save(store); + } +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java b/spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java new file mode 100644 index 0000000000..b230dcec1d --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java @@ -0,0 +1,20 @@ +package com.baeldung.javers.config; + +import org.javers.spring.auditable.AuthorProvider; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class JaversConfiguration { + @Bean + public AuthorProvider provideJaversAuthor() { + return new SimpleAuthorProvider(); + } + + private static class SimpleAuthorProvider implements AuthorProvider { + @Override + public String provide() { + return "Baeldung Author"; + } + } +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java b/spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java new file mode 100644 index 0000000000..930276b3ee --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java @@ -0,0 +1,33 @@ +package com.baeldung.javers.domain; + +import javax.persistence.Embeddable; + +@Embeddable +public class Address { + private String address; + private Integer zipCode; + + public Address(String address, Integer zipCode) { + this.address = address; + this.zipCode = zipCode; + } + + public Address() { + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Integer getZipCode() { + return zipCode; + } + + public void setZipCode(Integer zipCode) { + this.zipCode = zipCode; + } +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java b/spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java new file mode 100644 index 0000000000..61a2993bb9 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java @@ -0,0 +1,61 @@ +package com.baeldung.javers.domain; + +import javax.persistence.*; + +@Entity +public class Product { + @Id + @GeneratedValue + private int id; + + private String name; + private double price; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "store_id") + private Store store; + + public Product(String name, double price) { + this.name = name; + this.price = price; + } + + public Product() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Store getStore() { + return store; + } + + public void setStore(Store store) { + this.store = store; + } + + public void setNamePrefix(String prefix) { + this.name = prefix + this.name; + } +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java b/spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java new file mode 100644 index 0000000000..5aa6686261 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java @@ -0,0 +1,62 @@ +package com.baeldung.javers.domain; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +public class Store { + @Id + @GeneratedValue + private int id; + private String name; + @Embedded + private Address address; + @OneToMany( + mappedBy = "store", + cascade = CascadeType.ALL, + orphanRemoval = true + ) + private List products = new ArrayList<>(); + + public Store(String name, Address address) { + this.name = name; + this.address = address; + } + + public Store() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public void addProduct(Product product) { + product.setStore(this); + this.products.add(product); + } + + public List getProducts() { + return this.products; + } +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java b/spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java new file mode 100644 index 0000000000..090ebe6742 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.javers.repo; + +import com.baeldung.javers.domain.Product; +import org.javers.spring.annotation.JaversAuditable; +import org.springframework.data.repository.CrudRepository; + +public interface ProductRepository extends CrudRepository { + @Override + @JaversAuditable + S save(S s); +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java b/spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java new file mode 100644 index 0000000000..aa9d07c4c8 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java @@ -0,0 +1,9 @@ +package com.baeldung.javers.repo; + +import com.baeldung.javers.domain.Store; +import org.javers.spring.annotation.JaversSpringDataAuditable; +import org.springframework.data.repository.CrudRepository; + +@JaversSpringDataAuditable +public interface StoreRepository extends CrudRepository { +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java b/spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java new file mode 100644 index 0000000000..2977f715cb --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java @@ -0,0 +1,59 @@ +package com.baeldung.javers.service; + + +import com.baeldung.javers.domain.Product; +import com.baeldung.javers.domain.Store; +import com.baeldung.javers.repo.ProductRepository; +import com.baeldung.javers.repo.StoreRepository; +import org.springframework.stereotype.Service; + +import java.util.Optional; +import java.util.Random; + +@Service +public class StoreService { + private final ProductRepository productRepository; + private final StoreRepository storeRepository; + + public StoreService(ProductRepository productRepository, StoreRepository storeRepository) { + this.productRepository = productRepository; + this.storeRepository = storeRepository; + } + + public void updateProductPrice(Integer productId, Double price) { + Optional productOpt = productRepository.findById(productId); + productOpt.ifPresent(product -> { + product.setPrice(price); + productRepository.save(product); + }); + } + + public void rebrandStore(int storeId, String updatedName) { + Optional storeOpt = storeRepository.findById(storeId); + storeOpt.ifPresent(store -> { + store.setName(updatedName); + store.getProducts().forEach(product -> { + product.setNamePrefix(updatedName); + }); + storeRepository.save(store); + }); + } + + public void createRandomProduct(Integer storeId) { + Optional storeOpt = this.storeRepository.findById(storeId); + storeOpt.ifPresent(store -> { + Random random = new Random(); + Product product = new Product("Product#" + random.nextInt(), random.nextDouble() * 100); + store.addProduct(product); + storeRepository.save(store); + }); + } + + public Store findStoreById(int storeId) { + return storeRepository.findById(storeId).get(); + } + + public Product findProductById(int id) { + return this.productRepository.findById(id).get(); + } +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java b/spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java new file mode 100644 index 0000000000..c9681add40 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java @@ -0,0 +1,5 @@ +package com.baeldung.javers.web; + +public class RebrandStoreDto { + public String name; +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java b/spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java new file mode 100644 index 0000000000..89c3c03a11 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java @@ -0,0 +1,73 @@ +package com.baeldung.javers.web; + +import com.baeldung.javers.domain.Product; +import com.baeldung.javers.domain.Store; +import com.baeldung.javers.service.StoreService; +import org.javers.core.Changes; +import org.javers.core.Javers; +import org.javers.core.metamodel.object.CdoSnapshot; +import org.javers.repository.jql.JqlQuery; +import org.javers.repository.jql.QueryBuilder; +import org.javers.shadow.Shadow; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +public class StoreController { + private final StoreService storeService; + private final Javers javers; + + public StoreController(StoreService customerService, Javers javers) { + this.storeService = customerService; + this.javers = javers; + } + + @PostMapping("/stores/{storeId}/products/random") + public void createRandomProduct(@PathVariable final Integer storeId) { + storeService.createRandomProduct(storeId); + } + + @PostMapping("/stores/{storeId}/rebrand") + public void rebrandStore(@PathVariable final Integer storeId, @RequestBody RebrandStoreDto rebrandStoreDto) { + storeService.rebrandStore(storeId, rebrandStoreDto.name); + } + + @PostMapping(value = "/stores/{storeId}/products/{productId}/price", consumes = MediaType.APPLICATION_JSON_VALUE) + public void updateProductPrice(@PathVariable final Integer productId, @PathVariable String storeId, @RequestBody UpdatePriceDto priceDto) { + storeService.updateProductPrice(productId, priceDto.price); + } + + @GetMapping("/products/{productId}/changes") + public String getProductChanges(@PathVariable int productId) { + Product product = storeService.findProductById(productId); + QueryBuilder jqlQuery = QueryBuilder.byInstance(product); + Changes changes = javers.findChanges(jqlQuery.build()); + return javers.getJsonConverter().toJson(changes); + } + + @GetMapping("/products/snapshots") + public String getProductSnapshots() { + QueryBuilder jqlQuery = QueryBuilder.byClass(Product.class); + List snapshots = javers.findSnapshots(jqlQuery.build()); + return javers.getJsonConverter().toJson(snapshots); + } + + @GetMapping("/stores/{storeId}/shadows") + public String getStoreShadows(@PathVariable int storeId) { + Store store = storeService.findStoreById(storeId); + JqlQuery jqlQuery = QueryBuilder.byInstance(store) + .withChildValueObjects().build(); + List> shadows = javers.findShadows(jqlQuery); + return javers.getJsonConverter().toJson(shadows.get(0)); + } + + @GetMapping("/stores/snapshots") + public String getStoresSnapshots() { + QueryBuilder jqlQuery = QueryBuilder.byClass(Store.class); + List snapshots = javers.findSnapshots(jqlQuery.build()); + return javers.getJsonConverter().toJson(snapshots); + } + +} diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java b/spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java new file mode 100644 index 0000000000..02808a8134 --- /dev/null +++ b/spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java @@ -0,0 +1,5 @@ +package com.baeldung.javers.web; + +public class UpdatePriceDto { + public double price; +} diff --git a/spring-boot-data/src/main/resources/application.properties b/spring-boot-data/src/main/resources/application.properties index 845b783634..6378a48506 100644 --- a/spring-boot-data/src/main/resources/application.properties +++ b/spring-boot-data/src/main/resources/application.properties @@ -1,2 +1,25 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss -spring.jackson.time-zone=Europe/Zagreb \ No newline at end of file +spring.jackson.time-zone=Europe/Zagreb +spring.h2.console.path=/h2 +spring.h2.console.enabled=true +spring.datasource.url=jdbc:h2:mem:testdb +spring.datasource.driver-class-name=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= +spring.main.allow-bean-definition-overriding=true +javers.mappingStyle=FIELD +javers.algorithm=SIMPLE +javers.commitIdGenerator=synchronized_sequence +javers.prettyPrint=true +javers.typeSafeValues=false +javers.newObjectSnapshot=true +javers.packagesToScan= +javers.auditableAspectEnabled=true +javers.springDataAuditableRepositoryAspectEnabled=true +javers.sqlSchema= +javers.sqlSchemaManagementEnabled=true +javers.prettyPrintDateFormats.localDateTime=dd MMM yyyy, HH:mm:ss +javers.prettyPrintDateFormats.zonedDateTime=dd MMM yyyy, HH:mm:ssZ +javers.prettyPrintDateFormats.localDate=dd MMM yyyy +javers.prettyPrintDateFormats.localTime=HH:mm:ss + From 1889628daa76b4f8b846a2596bab47229a101f51 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 3 Sep 2019 16:27:36 +0200 Subject: [PATCH 002/107] BAEL-2966 --- .../interpolation/NotNullRequest.java | 17 ++++++++++ .../interpolation/RestController.java | 15 +++++++++ .../interpolation/ValidationExamples.java | 31 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 spring-core-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java create mode 100644 spring-core-2/src/main/java/com/baeldung/interpolation/RestController.java create mode 100644 spring-core-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java diff --git a/spring-core-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java b/spring-core-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java new file mode 100644 index 0000000000..9a2b00be8f --- /dev/null +++ b/spring-core-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java @@ -0,0 +1,17 @@ +package com.baeldung.interpolation; + +import javax.validation.constraints.NotNull; + +public class NotNullRequest { + + @NotNull(message = "stringValue has to be present") + private String stringValue; + + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } +} diff --git a/spring-core-2/src/main/java/com/baeldung/interpolation/RestController.java b/spring-core-2/src/main/java/com/baeldung/interpolation/RestController.java new file mode 100644 index 0000000000..87b16320fe --- /dev/null +++ b/spring-core-2/src/main/java/com/baeldung/interpolation/RestController.java @@ -0,0 +1,15 @@ +package com.baeldung.interpolation; + +import javax.validation.Valid; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class RestController { + + @PostMapping("/test-not-null") + public void testNotNull(@Valid @RequestBody NotNullRequest request) { + + } +} diff --git a/spring-core-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java b/spring-core-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java new file mode 100644 index 0000000000..d353e4f7f2 --- /dev/null +++ b/spring-core-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java @@ -0,0 +1,31 @@ +package com.baeldung.interpolation; + +import java.util.Formatter; +import javax.validation.constraints.Size; +import javax.validation.constraints.Min; +import javax.validation.constraints.DecimalMin; + +public class ValidationExamples { + + private static final Formatter formatter = new Formatter(); + + @Size( + min = 5, + max = 14, + message = "The author email '${validatedValue}' must be between {min} and {max} characters long" + ) + private String authorEmail; + + @Min( + value = 1, + message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case" + ) + private int testCount; + + @DecimalMin( + value = "50", + message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%" + ) + private double codeCoverage; + +} From 40ec4b95982661c03d93a9dec24c14e5cc46c61d Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 3 Sep 2019 16:32:13 +0200 Subject: [PATCH 003/107] add validation to pom --- spring-core-2/pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index d68beda64a..6c2635c88b 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -41,6 +41,11 @@ ${junit-jupiter.version} test + + javax.validation + validation-api + ${validation-api.version} + @@ -55,6 +60,7 @@ 2.22.1 + 2.0.1.Final - \ No newline at end of file + From 017992bf74006e111b0a4152035a5ed2f586f9be Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 3 Sep 2019 16:39:23 +0200 Subject: [PATCH 004/107] move to new module --- spring-core-2/pom.xml | 6 ------ .../java/com/baeldung/interpolation/NotNullRequest.java | 0 .../java/com/baeldung/interpolation/RestController.java | 0 .../java/com/baeldung/interpolation/ValidationExamples.java | 0 4 files changed, 6 deletions(-) rename {spring-core-2 => spring-mvc-simple-2}/src/main/java/com/baeldung/interpolation/NotNullRequest.java (100%) rename {spring-core-2 => spring-mvc-simple-2}/src/main/java/com/baeldung/interpolation/RestController.java (100%) rename {spring-core-2 => spring-mvc-simple-2}/src/main/java/com/baeldung/interpolation/ValidationExamples.java (100%) diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index 6c2635c88b..e24839b737 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -41,11 +41,6 @@ ${junit-jupiter.version} test - - javax.validation - validation-api - ${validation-api.version} - @@ -60,7 +55,6 @@ 2.22.1 - 2.0.1.Final diff --git a/spring-core-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java rename to spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/NotNullRequest.java diff --git a/spring-core-2/src/main/java/com/baeldung/interpolation/RestController.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/RestController.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/interpolation/RestController.java rename to spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/RestController.java diff --git a/spring-core-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java similarity index 100% rename from spring-core-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java rename to spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java From 6627bcdc841e7bec124a281770a9070e39b225e9 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 3 Sep 2019 16:41:50 +0200 Subject: [PATCH 005/107] rename file --- .../{RestController.java => ValidationController.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/{RestController.java => ValidationController.java} (91%) diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/RestController.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationController.java similarity index 91% rename from spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/RestController.java rename to spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationController.java index 87b16320fe..3fed170fdf 100644 --- a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/RestController.java +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationController.java @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @RestController -public class RestController { +public class ValidationController { @PostMapping("/test-not-null") public void testNotNull(@Valid @RequestBody NotNullRequest request) { From 68d755274960d71920fd4f08cdd238694c631731 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Thu, 5 Sep 2019 09:50:34 +0200 Subject: [PATCH 006/107] Update pom.xml From f173646635285a51abc83cca1d2381cac80db7d6 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Thu, 5 Sep 2019 09:56:24 +0200 Subject: [PATCH 007/107] Update pom.xml From b003e69e0a57b57a766b8f3aa1d58f162e8f9479 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Thu, 5 Sep 2019 09:59:01 +0200 Subject: [PATCH 008/107] update pom --- spring-core-2/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index e24839b737..d68beda64a 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -57,4 +57,4 @@ 2.22.1 - + \ No newline at end of file From a1dcb5c5ea404f1cc7ac6f7d4c6df7f67595b9d9 Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 9 Sep 2019 11:10:18 +0200 Subject: [PATCH 009/107] BAEL-3131 Guide to Java HashMap --- java-collections-maps-2/README.md | 1 + .../main/java/com/baeldung/map/Product.java | 133 ++++++++++++++++++ .../com/baeldung/map/ProductUnitTest.java | 124 ++++++++++++++++ 3 files changed, 258 insertions(+) create mode 100644 java-collections-maps-2/src/main/java/com/baeldung/map/Product.java create mode 100644 java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java diff --git a/java-collections-maps-2/README.md b/java-collections-maps-2/README.md index ff84e93ce4..3740639339 100644 --- a/java-collections-maps-2/README.md +++ b/java-collections-maps-2/README.md @@ -1,3 +1,4 @@ ## Relevant Articles: - [Map of Primitives in Java](https://www.baeldung.com/java-map-primitives) - [Copying a HashMap in Java](https://www.baeldung.com/java-copy-hashmap) +- [Guide to Java HashMap]() diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java b/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java new file mode 100644 index 0000000000..5559895730 --- /dev/null +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java @@ -0,0 +1,133 @@ +package com.baeldung.map; + +import java.util.*; + +public class Product { + + private String name; + private String description; + private List tags; + + public Product(String name, String description) { + this.name = name; + this.description = description; + this.tags = new ArrayList<>(); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public List getTags() { + return tags; + } + + public Product addTagsOfOtherProdcut(Product product) { + this.tags.addAll(product.getTags()); + return this; + } + + @Override + public boolean equals(Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Product product = (Product) o; + return Objects.equals(name, product.name) && + Objects.equals(description, product.description); + } + + @Override + public int hashCode() { + return Objects.hash(name, description); + } + + public static void forEach() { + + HashMap productsByName = new HashMap<>(); + productsByName.forEach( (key, product) + -> System.out.println("Key: " + key + " Product:" + product.getDescription()) + //do something with the key and value + ); + + //Prior to Java 8: + for(Map.Entry entry : productsByName.entrySet()) { + Product product = entry.getValue(); + String key = entry.getKey(); + //do something with the key and value + } + } + + public static void getOrDefault() { + + HashMap productsByName = new HashMap<>(); + Product chocolate = new Product("chocolate", "something sweet"); + Product defaultProduct = productsByName.getOrDefault("horse carriage", chocolate); + Product bike = productsByName.getOrDefault("E-Bike", chocolate); + + //Prior to Java 8: + Product bike2 = productsByName.containsKey("E-Bike") + ? productsByName.get("E-Bike") + : chocolate; + Product defaultProduct2 = productsByName.containsKey("horse carriage") + ? productsByName.get("horse carriage") + : chocolate; + } + + public static void putIfAbsent() { + + HashMap productsByName = new HashMap<>(); + Product chocolate = new Product("chocolate", "something sweet"); + productsByName.putIfAbsent("E-Bike", chocolate); + + //Prior to Java 8: + if(productsByName.containsKey("E-Bike")) { + productsByName.put("E-Bike", chocolate); + } + } + + public static void merge() { + + HashMap productsByName = new HashMap<>(); + Product eBike2 = new Product("E-Bike", "A bike with a battery"); + eBike2.getTags().add("sport"); + productsByName.merge("E-Bike", eBike2, Product::addTagsOfOtherProdcut); + + //Prior to Java 8: + if(productsByName.containsKey("E-Bike")) { + productsByName.get("E-Bike").addTagsOfOtherProdcut(eBike2); + } else { + productsByName.put("E-Bike", eBike2); + } + } + + public static void compute() { + + HashMap productsByName = new HashMap<>(); + Product eBike2 = new Product("E-Bike", "A bike with a battery"); + + productsByName.compute("E-Bike", (k,v) -> { + if(v != null) { + return v.addTagsOfOtherProdcut(eBike2); + } else { + return eBike2; + } + }); + + //Prior to Java 8: + if(productsByName.containsKey("E-Bike")) { + productsByName.get("E-Bike").addTagsOfOtherProdcut(eBike2); + } else { + productsByName.put("E-Bike", eBike2); + } + } +} diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java new file mode 100644 index 0000000000..28ac06e166 --- /dev/null +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java @@ -0,0 +1,124 @@ +package com.baeldung.map; + +import org.junit.jupiter.api.Test; + +import java.util.HashMap; + +import static org.junit.jupiter.api.Assertions.*; + +class ProductUnitTest { + + + @Test + public void getExistingValue() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + + Product nextPurchase = productsByName.get("E-Bike"); + + assertEquals("A bike with a battery", nextPurchase.getDescription()); + } + + @Test + public void getNonExistingValue() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + + Product nextPurchase = productsByName.get("Car"); + + assertEquals(null, nextPurchase); + } + + @Test + public void getExistingValueAfterSameKeyInsertedTwice() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + Product newEBike = new Product("E-Bike", "A bike with a better battery"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + productsByName.put(newEBike.getName(), newEBike); + + Product nextPurchase = productsByName.get("E-Bike"); + + assertEquals("A bike with a better battery", nextPurchase.getDescription()); + } + + @Test + public void getExistingValueWithNullKey() { + HashMap productsByName = new HashMap<>(); + + Product defaultProduct = new Product("Chocolate", "At least buy chocolate"); + + productsByName.put(null, defaultProduct); + productsByName.put(defaultProduct.getName(), defaultProduct); + + Product nextPurchase = productsByName.get(null); + assertEquals("At least buy chocolate", nextPurchase.getDescription()); + + nextPurchase = productsByName.get("Chocolate"); + assertEquals("At least buy chocolate", nextPurchase.getDescription()); + } + + @Test + public void insertSameObjectWithDifferentKey() { + HashMap productsByName = new HashMap<>(); + + Product defaultProduct = new Product("Chocolate", "At least buy chocolate"); + + productsByName.put(null, defaultProduct); + productsByName.put(defaultProduct.getName(), defaultProduct); + + assertSame(productsByName.get(null), productsByName.get("Chocolate")); + } + + @Test + public void checkIfKeyExists() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + + productsByName.put(eBike.getName(), eBike); + + assertTrue(productsByName.containsKey("E-Bike")); + } + + @Test + public void checkIfValueExists() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + + productsByName.put(eBike.getName(), eBike); + + assertTrue(productsByName.containsValue(eBike)); + } + + @Test + public void removeExistingKey() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + + productsByName.remove("E-Bike"); + + assertNull(productsByName.get("E-Bike")); + } + +} \ No newline at end of file From e48b29d58c714ed79b09e1a9a21fc5c1302f6ad7 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 10 Sep 2019 11:35:35 +0200 Subject: [PATCH 010/107] add custom interpolator --- .../interpolation/MyMessageInterpolator.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java new file mode 100644 index 0000000000..8251138b9b --- /dev/null +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java @@ -0,0 +1,28 @@ +package com.baeldung.interpolation; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import javax.validation.MessageInterpolator; +import java.util.Locale; + +public class MyMessageInterpolator implements MessageInterpolator { + + private static Logger logger = LoggerFactory.getLogger(MyMessageInterpolator.class); + + private final MessageInterpolator defaultInterpolator; + + public MyMessageInterpolator(MessageInterpolator interpolator) { + this.defaultInterpolator = interpolator; + } + + @Override + public String interpolate(String messageTemplate, Context context) { + logger.debug("Selecting the language " + Locale.getDefault() + " for the error message."); + return defaultInterpolator.interpolate(messageTemplate, context, Locale.getDefault()); + } + + @Override + public String interpolate(String messageTemplate, Context context, Locale locale) { + return defaultInterpolator.interpolate(messageTemplate, context, locale); + } +} From 7da248c9dbe38c0f486f150fb98fd5f1f35d7d5d Mon Sep 17 00:00:00 2001 From: binary-joe Date: Thu, 22 Aug 2019 22:38:33 +0200 Subject: [PATCH 011/107] BAEL-2976 http basic auth --- .../core-java-networking-2/pom.xml | 13 +++- .../com/baeldung/url/auth/HttpClient.java | 72 +++++++++++++++++++ .../baeldung/url/auth/HttpClientUnitTest.java | 52 ++++++++++++++ 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java create mode 100644 core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java diff --git a/core-java-modules/core-java-networking-2/pom.xml b/core-java-modules/core-java-networking-2/pom.xml index 8a26f6ab9f..bea832aa14 100644 --- a/core-java-modules/core-java-networking-2/pom.xml +++ b/core-java-modules/core-java-networking-2/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 core-java-networking-2 core-java-networking-2 @@ -12,9 +12,18 @@ + + org.apache.httpcomponents + httpclient + ${httpclient.version} + core-java-networking-2 - + + + + 4.5.9 + diff --git a/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java new file mode 100644 index 0000000000..dccaf3de84 --- /dev/null +++ b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java @@ -0,0 +1,72 @@ +package com.baeldung.url.auth; + +import java.io.IOException; +import java.net.Authenticator; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.PasswordAuthentication; +import java.net.ProtocolException; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +import org.apache.commons.codec.binary.Base64; + +public class HttpClient { + + private final String user; + private final String password; + + public HttpClient(String user, String password) { + this.user = user; + this.password = password; + } + + public int sendRquestWithAuthHeader(String url) throws IOException { + HttpURLConnection connection = null; + try { + connection = createConnection(url); + connection.setRequestProperty("Authorization", createBasicAuthHeaderValue()); + return connection.getResponseCode(); + } finally { + if (connection != null) { + connection.disconnect(); + } + } + } + + public int sendRquestWithAuthenticator(String url) throws IOException { + setAuthenticator(); + + HttpURLConnection connection = null; + try { + connection = createConnection(url); + return connection.getResponseCode(); + } finally { + if (connection != null) { + connection.disconnect(); + } + } + } + + private void setAuthenticator() { + Authenticator.setDefault(new Authenticator() { + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, password.toCharArray()); + } + }); + } + + private String createBasicAuthHeaderValue() { + String auth = user + ":" + password; + byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.UTF_8)); + String authHeaderValue = "Basic " + new String(encodedAuth); + return authHeaderValue; + } + + private HttpURLConnection createConnection(String urlString) throws MalformedURLException, IOException, ProtocolException { + URL url = new URL(String.format(urlString)); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + return connection; + } +} diff --git a/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java new file mode 100644 index 0000000000..0ccb6e5a54 --- /dev/null +++ b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/url/auth/HttpClientUnitTest.java @@ -0,0 +1,52 @@ +package com.baeldung.url.auth; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class HttpClientUnitTest { + + @Test + public void sendRquestWithAuthHeader() throws Exception { + HttpClient httpClient = new HttpClient("user1", "pass1"); + + int status = httpClient.sendRquestWithAuthHeader("https://httpbin.org/basic-auth/user1/pass1"); + + assertTrue(isSuccess(status)); + } + + @Test + public void sendRquestWithAuthHeader_whenIncorrectCredentials_thenNotSuccessful() throws Exception { + HttpClient httpClient = new HttpClient("John", "Smith"); + + int status = httpClient.sendRquestWithAuthHeader("https://httpbin.org/basic-auth/user1/pass1"); + + assertTrue(isUnauthorized(status)); + } + + @Test + public void sendRquestWithAuthenticator() throws Exception { + HttpClient httpClient = new HttpClient("user2", "pass2"); + + int status = httpClient.sendRquestWithAuthenticator("https://httpbin.org/basic-auth/user2/pass2"); + + assertTrue(isSuccess(status)); + } + + @Test + public void sendRquestWithAuthenticator_whenIncorrectCredentials_thenNotSuccessful() throws Exception { + HttpClient httpClient = new HttpClient("John", "Smith"); + + int status = httpClient.sendRquestWithAuthenticator("https://httpbin.org/basic-auth/user2/pass2"); + + assertTrue(isUnauthorized(status)); + } + + private boolean isSuccess(int status) { + return (status >= 200) && (status < 300); + } + + private boolean isUnauthorized(int status) { + return status == 401; + } +} From 60c990b8c1e1df51203b8d592a39eea2ca439687 Mon Sep 17 00:00:00 2001 From: binary-joe Date: Sat, 14 Sep 2019 19:37:32 +0200 Subject: [PATCH 012/107] fix merge issue; refactoring --- .../core-java-networking-2/pom.xml | 2 ++ .../com/baeldung/url/auth/HttpClient.java | 24 ++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/core-java-modules/core-java-networking-2/pom.xml b/core-java-modules/core-java-networking-2/pom.xml index 3837b77eba..2d404a553b 100644 --- a/core-java-modules/core-java-networking-2/pom.xml +++ b/core-java-modules/core-java-networking-2/pom.xml @@ -16,6 +16,8 @@ org.apache.httpcomponents httpclient ${httpclient.version} + + org.apache.commons commons-lang3 ${commons-lang3.version} diff --git a/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java index dccaf3de84..779f8aa898 100644 --- a/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java +++ b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/url/auth/HttpClient.java @@ -48,12 +48,11 @@ public class HttpClient { } } - private void setAuthenticator() { - Authenticator.setDefault(new Authenticator() { - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(user, password.toCharArray()); - } - }); + private HttpURLConnection createConnection(String urlString) throws MalformedURLException, IOException, ProtocolException { + URL url = new URL(String.format(urlString)); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + return connection; } private String createBasicAuthHeaderValue() { @@ -63,10 +62,13 @@ public class HttpClient { return authHeaderValue; } - private HttpURLConnection createConnection(String urlString) throws MalformedURLException, IOException, ProtocolException { - URL url = new URL(String.format(urlString)); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - return connection; + private void setAuthenticator() { + Authenticator.setDefault(new BasicAuthenticator()); + } + + private final class BasicAuthenticator extends Authenticator { + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, password.toCharArray()); + } } } From dd5a432614153e57326b58afef3c1624385cd132 Mon Sep 17 00:00:00 2001 From: Anshul Bansal Date: Sun, 15 Sep 2019 16:54:50 +0300 Subject: [PATCH 013/107] BAEL-3191 - Categories in Groovy --- .../baeldung/category/BaeldungCategory.groovy | 17 ++++ .../baeldung/category/NumberCategory.groovy | 16 +++ .../baeldung/category/CategoryUnitTest.groovy | 99 +++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy create mode 100644 core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy create mode 100644 core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy new file mode 100644 index 0000000000..366dd182c8 --- /dev/null +++ b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy @@ -0,0 +1,17 @@ +package com.baeldung.category; + +class BaeldungCategory { + + public static String capitalize(String self) { + String capitalizedStr = self; + if (self.size() > 0) { + capitalizedStr = self.substring(0, 1).toUpperCase() + self.substring(1); + } + return capitalizedStr + } + + public static Number square(Number self) { + return self*self; + } + +} diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy new file mode 100644 index 0000000000..cf0e5282fc --- /dev/null +++ b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy @@ -0,0 +1,16 @@ +package com.baeldung.category; + +import groovy.lang.Category + +@Category(Number) +class NumberCategory { + + public Number cube() { + return this*this*this + } + + public Number toThePower(Number exponent) { + return Math.pow(this, exponent) + } + +} diff --git a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy new file mode 100644 index 0000000000..2e10efbe03 --- /dev/null +++ b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy @@ -0,0 +1,99 @@ +package com.baeldung.category + +import groovy.time.* +import java.text.SimpleDateFormat +import groovy.xml.* +import groovy.xml.dom.* +import com.baeldung.category.BaeldungCategory +import com.baeldung.category.NumberCategory + +class CategoryUnitTest extends GroovyTestCase { + + void test_whenUsingTimeCategory_thenOperationOnDate() { + def jan_1_2019 = new Date("01/01/2019") + use (TimeCategory) { + assert jan_1_2019 + 10.seconds == new Date("01/01/2019 00:00:10") + + assert jan_1_2019 + 20.minutes == new Date("01/01/2019 00:20:00") + + assert jan_1_2019 + 2.hours == new Date("01/01/2019 02:00:00") + + assert jan_1_2019 - 1.day == new Date("12/31/2018") + + assert jan_1_2019 + 2.weeks == new Date("01/15/2019") + + assert jan_1_2019 - 2.months == new Date("11/01/2018") + + assert jan_1_2019 + 3.years == new Date("01/01/2022") + } + } + + void test_whenUsingTimeCategory_thenOperationOnNumber() { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy") + use (TimeCategory) { + assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days) + + sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") + assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes) + assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours) + } + } + + void test_whenUsingDOMCategory_thenOperationOnXML() { + + def baeldungArticlesText = """ + +
+ An Intro to the Java Debug Interface (JDI) + A quick and practical overview of Java Debug Interface. +
+
+ A Quick Guide to Working with Web Services in Groovy + Learn how to work with Web Services in Groovy. +
+
+""" + def baeldungArticlesDom = DOMBuilder.newInstance().parseText(baeldungArticlesText) + + def root = baeldungArticlesDom.documentElement + + use (DOMCategory) { + assert root.article.size() == 2 + + def articles = root.article + + assert articles[0].title.text() == "An Intro to the Java Debug Interface (JDI)" + assert articles[1].desc.text() == "Learn how to work with Web Services in Groovy." + + def articleNode3 = root.appendNode(new QName("article"), ["core-java": "false"]) + + articleNode3.appendNode("title", "Metaprogramming in Groovy") + articleNode3.appendNode("desc", "Explore the concept of runtime and compile-time metaprogramming in Groovy") + + assert root.article.size() == 3 + + assert root.article[2].title.text() == "Metaprogramming in Groovy" + } + } + + void test_whenUsingBaeldungCategory_thenCapitalizeString() { + use (BaeldungCategory) { + assert "norman".capitalize() == "Norman" + } + } + + void test_whenUsingBaeldungCategory_thenSquareNumber() { + use (BaeldungCategory) { + assert 50.square() == 2500 + assert 20.01.square() == 400.4001 + } + } + + void test_whenUsingNumberUtils_thenCubeNumber() { + use (NumberCategory) { + assert 3.cube() == 27 + assert 2.4.toThePower(4) == 33.1776 + } + } + +} From 6bab705944217661c11aeac24386935905def018 Mon Sep 17 00:00:00 2001 From: Michael Sievers Date: Tue, 17 Sep 2019 08:09:08 +0200 Subject: [PATCH 014/107] [BAEL-3077] Update comments in unit tests to align with article snippets --- .../mapper/DeliveryAddressMapperUnitTest.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java index e2c12fcba3..7d1e432546 100644 --- a/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java +++ b/mapstruct/src/test/java/com/baeldung/mapper/DeliveryAddressMapperUnitTest.java @@ -17,48 +17,51 @@ public class DeliveryAddressMapperUnitTest { @Test public void testGivenCustomerAndAddress_mapsToDeliveryAddress() { - // given + // given a customer Customer customer = new Customer().setFirstName("Max") .setLastName("Powers"); + // and some address Address homeAddress = new Address().setStreet("123 Some Street") .setCounty("Nevada") .setPostalcode("89123"); - // when + // when calling DeliveryAddressMapper::from DeliveryAddress deliveryAddress = deliveryAddressMapper.from(customer, homeAddress); - // then + // then a new DeliveryAddress is created, based on the given customer and his home address assertEquals(deliveryAddress.getForename(), customer.getFirstName()); assertEquals(deliveryAddress.getSurname(), customer.getLastName()); assertEquals(deliveryAddress.getStreet(), homeAddress.getStreet()); assertEquals(deliveryAddress.getCounty(), homeAddress.getCounty()); assertEquals(deliveryAddress.getPostalcode(), homeAddress.getPostalcode()); + } @Test public void testGivenDeliveryAddressAndSomeOtherAddress_updatesDeliveryAddress() { - // given - Customer customer = new Customer().setFirstName("Max") - .setLastName("Powers"); - - DeliveryAddress deliveryAddress = new DeliveryAddress().setStreet("123 Some Street") + // given a delivery address + DeliveryAddress deliveryAddress = new DeliveryAddress().setForename("Max") + .setSurname("Powers") + .setStreet("123 Some Street") .setCounty("Nevada") .setPostalcode("89123"); - Address otherAddress = new Address().setStreet("456 Some other street") + // and some new address + Address newAddress = new Address().setStreet("456 Some other street") .setCounty("Arizona") .setPostalcode("12345"); - // when - DeliveryAddress updatedDeliveryAddress = deliveryAddressMapper.updateAddress(deliveryAddress, otherAddress); + // when calling DeliveryAddressMapper::updateAddress + DeliveryAddress updatedDeliveryAddress = deliveryAddressMapper.updateAddress(deliveryAddress, newAddress); - // then + // then the *existing* delivery address is updated assertSame(deliveryAddress, updatedDeliveryAddress); - assertEquals(deliveryAddress.getStreet(), otherAddress.getStreet()); - assertEquals(deliveryAddress.getCounty(), otherAddress.getCounty()); - assertEquals(deliveryAddress.getPostalcode(), otherAddress.getPostalcode()); + assertEquals(deliveryAddress.getStreet(), newAddress.getStreet()); + assertEquals(deliveryAddress.getCounty(), newAddress.getCounty()); + assertEquals(deliveryAddress.getPostalcode(), newAddress.getPostalcode()); + } } From b3b7e78ce6aa895761dfe0a314f3f45dc6d18793 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 17 Sep 2019 09:07:47 +0200 Subject: [PATCH 015/107] review updates --- .../interpolation/MyMessageInterpolator.java | 3 ++- .../baeldung/interpolation/ValidationExamples.java | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java index 8251138b9b..efa3d62b88 100644 --- a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java @@ -17,12 +17,13 @@ public class MyMessageInterpolator implements MessageInterpolator { @Override public String interpolate(String messageTemplate, Context context) { - logger.debug("Selecting the language " + Locale.getDefault() + " for the error message."); + messageTemplate = messageTemplate.toUpperCase(); return defaultInterpolator.interpolate(messageTemplate, context, Locale.getDefault()); } @Override public String interpolate(String messageTemplate, Context context, Locale locale) { + messageTemplate = messageTemplate.toUpperCase(); return defaultInterpolator.interpolate(messageTemplate, context, locale); } } diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java index d353e4f7f2..30d770205e 100644 --- a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java @@ -10,21 +10,21 @@ public class ValidationExamples { private static final Formatter formatter = new Formatter(); @Size( - min = 5, - max = 14, - message = "The author email '${validatedValue}' must be between {min} and {max} characters long" + min = 5, + max = 14, + message = "The author email '${validatedValue}' must be between {min} and {max} characters long" ) private String authorEmail; @Min( - value = 1, - message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case" + value = 1, + message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case" ) private int testCount; @DecimalMin( - value = "50", - message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%" + value = "50", + message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%" ) private double codeCoverage; From a958de4d3f06b5d2061b51e9042d37cb6dcc576b Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Thu, 19 Sep 2019 17:35:06 +0100 Subject: [PATCH 016/107] [BAEL-17490] README descriptions 6 --- spring-boot-data/README.md | 4 +++ .../{README.MD => README.md} | 4 +++ spring-boot-ops-2/{README.MD => README.md} | 4 +++ spring-boot-ops/README.md | 5 ++++ spring-boot-parent/README.md | 4 +++ spring-boot-property-exp/README.md | 27 ++++++++++++------- spring-boot-rest/README.md | 24 ++++++++++++----- spring-boot-security/README.md | 16 ++++++++--- spring-boot-testing/{README.MD => README.md} | 5 ++++ spring-boot-vue/README.md | 4 +++ 10 files changed, 77 insertions(+), 20 deletions(-) rename spring-boot-libraries/{README.MD => README.md} (74%) rename spring-boot-ops-2/{README.MD => README.md} (71%) rename spring-boot-testing/{README.MD => README.md} (86%) diff --git a/spring-boot-data/README.md b/spring-boot-data/README.md index 6f0b8c8123..513c5fed18 100644 --- a/spring-boot-data/README.md +++ b/spring-boot-data/README.md @@ -1,3 +1,7 @@ +## Spring Boot Data + +This module contains articles about Spring Boot with Spring Data + ## Relevant Articles: - [Formatting JSON Dates in Spring Boot](https://www.baeldung.com/spring-boot-formatting-json-dates) diff --git a/spring-boot-libraries/README.MD b/spring-boot-libraries/README.md similarity index 74% rename from spring-boot-libraries/README.MD rename to spring-boot-libraries/README.md index f3706e0fa4..f0bc3c9e89 100644 --- a/spring-boot-libraries/README.MD +++ b/spring-boot-libraries/README.md @@ -1,3 +1,7 @@ +## Spring Boot Libraries + +This module contains articles about various Spring Boot libraries + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring diff --git a/spring-boot-ops-2/README.MD b/spring-boot-ops-2/README.md similarity index 71% rename from spring-boot-ops-2/README.MD rename to spring-boot-ops-2/README.md index b4218dc395..fa48cfd4da 100644 --- a/spring-boot-ops-2/README.MD +++ b/spring-boot-ops-2/README.md @@ -1,3 +1,7 @@ +## Spring Boot Operations + +This module contains articles about Spring Boot Operations + ### Relevant Articles - [How to Configure Spring Boot Tomcat](https://www.baeldung.com/spring-boot-configure-tomcat) diff --git a/spring-boot-ops/README.md b/spring-boot-ops/README.md index 5be5c974d3..a40732d336 100644 --- a/spring-boot-ops/README.md +++ b/spring-boot-ops/README.md @@ -1,3 +1,7 @@ +## Spring Boot Operations + +This module contains articles about Spring Boot Operations + ### Relevant Articles: - [Deploy a Spring Boot WAR into a Tomcat Server](http://www.baeldung.com/spring-boot-war-tomcat-deploy) - [Spring Boot Dependency Management with a Custom Parent](http://www.baeldung.com/spring-boot-dependency-management-custom-parent) @@ -12,3 +16,4 @@ - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) + - [more...](/spring-boot-ops-2) \ No newline at end of file diff --git a/spring-boot-parent/README.md b/spring-boot-parent/README.md index c3bb4c700d..b48a286d62 100644 --- a/spring-boot-parent/README.md +++ b/spring-boot-parent/README.md @@ -1,3 +1,7 @@ +## Spring Boot Parent + +This module contains articles about Spring Boot Starter Parent + ### Relevant Articles - [The Spring Boot Starter Parent](https://www.baeldung.com/spring-boot-starter-parent) diff --git a/spring-boot-property-exp/README.md b/spring-boot-property-exp/README.md index 70cf6bdfac..e880837dc0 100644 --- a/spring-boot-property-exp/README.md +++ b/spring-boot-property-exp/README.md @@ -1,18 +1,27 @@ -## The Module Holds Sources for the Following Articles +## Spring Boot Property Expansion + +This Module contains articles about Spring Boot Property Expansion + +### Relevant Articles + - [Automatic Property Expansion with Spring Boot](http://www.baeldung.com/spring-boot-auto-property-expansion) -### Module property-exp-default-config - This module contains both a standard Maven Spring Boot build and the Gradle build which is Maven compatible. +## SubModules - In order to execute the Maven example, run the following command: +### property-exp-default-config + +This module contains both a standard Maven Spring Boot build and the Gradle build which is Maven compatible. - `mvn spring-boot:run` +In order to execute the Maven example, run the following command: - To execute the Gradle example: +`mvn spring-boot:run` + +To execute the Gradle example: `gradle bootRun` - ### Module property-exp-custom-config - This project is not using the standard Spring Boot parent and is configured manually. Run the following command: +### property-exp-custom-config - `mvn exec:java` +This project is not using the standard Spring Boot parent and is configured manually. Run the following command: + +`mvn exec:java` diff --git a/spring-boot-rest/README.md b/spring-boot-rest/README.md index 6f365bd465..b3365d932e 100644 --- a/spring-boot-rest/README.md +++ b/spring-boot-rest/README.md @@ -1,4 +1,19 @@ -Module for the articles that are part of the Spring REST E-book: +## Spring Boot REST + +This module contains articles about Spring Boot RESTful APIs. + +### Relevant Articles + +- [HATEOAS for a Spring REST Service](http://www.baeldung.com/rest-api-discoverability-with-spring) +- [Versioning a REST API](http://www.baeldung.com/rest-versioning) +- [ETags for REST with Spring](http://www.baeldung.com/etags-for-rest-with-spring) +- [Testing REST with multiple MIME types](http://www.baeldung.com/testing-rest-api-with-multiple-media-types) +- [Testing Web APIs with Postman Collections](https://www.baeldung.com/postman-testing-collections) +- [Spring Boot Consuming and Producing JSON](https://www.baeldung.com/spring-boot-json) + +### E-book + +These articles are part of the Spring REST E-book: 1. [Bootstrap a Web Application with Spring 5](https://www.baeldung.com/bootstraping-a-web-application-with-spring-and-java-based-configuration) 2. [Build a REST API with Spring and Java Config](http://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration) @@ -11,9 +26,4 @@ Module for the articles that are part of the Spring REST E-book: 9. [REST Pagination in Spring](http://www.baeldung.com/rest-api-pagination-in-spring) 10. [Test a REST API with Java](http://www.baeldung.com/integration-testing-a-rest-api) -- [HATEOAS for a Spring REST Service](http://www.baeldung.com/rest-api-discoverability-with-spring) -- [Versioning a REST API](http://www.baeldung.com/rest-versioning) -- [ETags for REST with Spring](http://www.baeldung.com/etags-for-rest-with-spring) -- [Testing REST with multiple MIME types](http://www.baeldung.com/testing-rest-api-with-multiple-media-types) -- [Testing Web APIs with Postman Collections](https://www.baeldung.com/postman-testing-collections) -- [Spring Boot Consuming and Producing JSON](https://www.baeldung.com/spring-boot-json) + diff --git a/spring-boot-security/README.md b/spring-boot-security/README.md index 30a3218672..be40010091 100644 --- a/spring-boot-security/README.md +++ b/spring-boot-security/README.md @@ -1,3 +1,13 @@ +## Spring Boot Security + +This module contains articles about Spring Boot Security + +### Relevant Articles: + +- [Spring Boot Security Auto-Configuration](http://www.baeldung.com/spring-boot-security-autoconfiguration) +- [Spring Security for Spring Boot Integration Tests](https://www.baeldung.com/spring-security-integration-tests) +- [Introduction to Spring Security Taglibs](https://www.baeldung.com/spring-security-taglibs) + ### Spring Boot Security Auto-Configuration - mvn clean install @@ -5,9 +15,7 @@ - uncomment security properties for easy testing. If not random will be generated. ### CURL commands + - curl -X POST -u baeldung-admin:baeldung -d grant_type=client_credentials -d username=baeldung-admin -d password=baeldung http://localhost:8080/oauth/token -### Relevant Articles: -- [Spring Boot Security Auto-Configuration](http://www.baeldung.com/spring-boot-security-autoconfiguration) -- [Spring Security for Spring Boot Integration Tests](https://www.baeldung.com/spring-security-integration-tests) -- [Introduction to Spring Security Taglibs](https://www.baeldung.com/spring-security-taglibs) + diff --git a/spring-boot-testing/README.MD b/spring-boot-testing/README.md similarity index 86% rename from spring-boot-testing/README.MD rename to spring-boot-testing/README.md index 7a4c4f53a1..0b2533e6bc 100644 --- a/spring-boot-testing/README.MD +++ b/spring-boot-testing/README.md @@ -1,4 +1,9 @@ +## Spring Boot Testing + +This module contains articles about Spring Boot testing + ### The Course + The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: diff --git a/spring-boot-vue/README.md b/spring-boot-vue/README.md index e68f961e51..5de138826c 100644 --- a/spring-boot-vue/README.md +++ b/spring-boot-vue/README.md @@ -1,2 +1,6 @@ +## Spring Boot Vue + +This module contains articles about Spring Boot with Vue.js + ### Relevant Articles: - [Vue.js Frontend with a Spring Boot Backend](http://www.baeldung.com/spring-boot-vue-js) From a4686004be0653836f0996a50bb6fd195feac2c6 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Thu, 19 Sep 2019 17:55:15 +0100 Subject: [PATCH 017/107] [BAEL-17491] README descriptions 7 --- spring-cloud-bus/README.md | 4 ++++ spring-cloud-cli/README.md | 4 ++-- spring-cloud-data-flow/README.MD | 2 -- spring-cloud-data-flow/README.md | 4 ++++ spring-cloud/README.md | 3 +++ spring-core-2/README.md | 4 ++++ spring-core/README.md | 5 +++++ spring-cucumber/README.md | 4 ++++ spring-data-rest-querydsl/README.md | 4 ++++ spring-data-rest/README.md | 28 ++++++++++++++++------------ spring-dispatcher-servlet/README.md | 4 ++++ 11 files changed, 50 insertions(+), 16 deletions(-) delete mode 100644 spring-cloud-data-flow/README.MD create mode 100644 spring-cloud-data-flow/README.md create mode 100644 spring-cloud/README.md diff --git a/spring-cloud-bus/README.md b/spring-cloud-bus/README.md index c5410ca4e2..82f2dbba63 100644 --- a/spring-cloud-bus/README.md +++ b/spring-cloud-bus/README.md @@ -1,3 +1,7 @@ +## Spring Cloud Bus + +This modules contains articles about Spring Cloud Bus + ### Relevant articles - [Spring Cloud Bus](http://www.baeldung.com/spring-cloud-bus) diff --git a/spring-cloud-cli/README.md b/spring-cloud-cli/README.md index 7f29be3f07..99df3ddbad 100644 --- a/spring-cloud-cli/README.md +++ b/spring-cloud-cli/README.md @@ -1,6 +1,6 @@ -========= - ## Spring Cloud CLI +This module contains articles about Spring Cloud CLI + ### Relevant Articles: - [Introduction to Spring Cloud CLI](http://www.baeldung.com/spring-cloud-cli) diff --git a/spring-cloud-data-flow/README.MD b/spring-cloud-data-flow/README.MD deleted file mode 100644 index f2ab96de2c..0000000000 --- a/spring-cloud-data-flow/README.MD +++ /dev/null @@ -1,2 +0,0 @@ - -This is an aggregator module for Spring Cloud Data Flow modules. diff --git a/spring-cloud-data-flow/README.md b/spring-cloud-data-flow/README.md new file mode 100644 index 0000000000..40e1db6840 --- /dev/null +++ b/spring-cloud-data-flow/README.md @@ -0,0 +1,4 @@ +## Spring Cloud Data Flow + +This module contains modules about Spring Cloud Data Flow + diff --git a/spring-cloud/README.md b/spring-cloud/README.md new file mode 100644 index 0000000000..1cc9d9d3cf --- /dev/null +++ b/spring-cloud/README.md @@ -0,0 +1,3 @@ +## Spring Cloud + +This module contains modules about Spring Cloud \ No newline at end of file diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 113bbe9c83..4a53c60b0d 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -1,3 +1,7 @@ +## Spring Core + +This module contains articles about Core Spring Functionality + ## Relevant Articles: - [Understanding getBean() in Spring](https://www.baeldung.com/spring-getbean) diff --git a/spring-core/README.md b/spring-core/README.md index 3ff3f1ea41..018012a927 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -1,3 +1,7 @@ +## Spring Core + +This module contains articles about Core Spring Functionality + ### Relevant Articles: - [Wiring in Spring: @Autowired, @Resource and @Inject](http://www.baeldung.com/spring-annotations-resource-inject-autowire) - [Constructor Injection in Spring with Lombok](http://www.baeldung.com/spring-injection-lombok) @@ -9,4 +13,5 @@ - [Spring Application Context Events](https://www.baeldung.com/spring-context-events) - [What is a Spring Bean?](https://www.baeldung.com/spring-bean) - [Spring PostConstruct and PreDestroy Annotations](https://www.baeldung.com/spring-postconstruct-predestroy) +- [more...](/spring-core-2) diff --git a/spring-cucumber/README.md b/spring-cucumber/README.md index 1e506f3a09..0638ff777a 100644 --- a/spring-cucumber/README.md +++ b/spring-cucumber/README.md @@ -1,2 +1,6 @@ +## Spring Cucumber + +This module contains articles about Spring testing with Cucumber + ### Relevant Articles: - [Cucumber Spring Integration](http://www.baeldung.com/cucumber-spring-integration) diff --git a/spring-data-rest-querydsl/README.md b/spring-data-rest-querydsl/README.md index 03b5fee06a..88efaff35e 100644 --- a/spring-data-rest-querydsl/README.md +++ b/spring-data-rest-querydsl/README.md @@ -1,2 +1,6 @@ +## Spring Data REST Querydsl + +This module contains articles about Spring Data REST Querydsl + ### Relevant Articles: - [REST Query Language Over Multiple Tables with Querydsl Web Support](http://www.baeldung.com/rest-querydsl-multiple-tables) diff --git a/spring-data-rest/README.md b/spring-data-rest/README.md index 4b89a24bbc..b12590e5e5 100644 --- a/spring-data-rest/README.md +++ b/spring-data-rest/README.md @@ -1,9 +1,21 @@ +## Spring Data REST + +This module contains articles about Spring Data REST + +### Relevant Articles: +- [Introduction to Spring Data REST](http://www.baeldung.com/spring-data-rest-intro) +- [Guide to Spring Data REST Validators](http://www.baeldung.com/spring-data-rest-validators) +- [Working with Relationships in Spring Data REST](http://www.baeldung.com/spring-data-rest-relationships) +- [AngularJS CRUD Application with Spring Data REST](http://www.baeldung.com/angularjs-crud-with-spring-data-rest) +- [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) +- [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) +- [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) +- [Spring Boot with SQLite](https://www.baeldung.com/spring-boot-sqlite) +- [Spring Data Web Support](https://www.baeldung.com/spring-data-web-support) + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring -# About this project -This project contains examples from the [Introduction to Spring Data REST](http://www.baeldung.com/spring-data-rest-intro) article from Baeldung. - # Running the project The application uses [Spring Boot](http://projects.spring.io/spring-boot/), so it is easy to run. You can start it any of a few ways: * Run the `main` method from `SpringDataRestApplication` @@ -13,12 +25,4 @@ The application uses [Spring Boot](http://projects.spring.io/spring-boot/), so i # Viewing the running application To view the running application, visit [http://localhost:8080](http://localhost:8080) in your browser -### Relevant Articles: -- [Guide to Spring Data REST Validators](http://www.baeldung.com/spring-data-rest-validators) -- [Working with Relationships in Spring Data REST](http://www.baeldung.com/spring-data-rest-relationships) -- [AngularJS CRUD Application with Spring Data REST](http://www.baeldung.com/angularjs-crud-with-spring-data-rest) -- [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) -- [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) -- [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) -- [Spring Boot with SQLite](https://www.baeldung.com/spring-boot-sqlite) -- [Spring Data Web Support](https://www.baeldung.com/spring-data-web-support) + diff --git a/spring-dispatcher-servlet/README.md b/spring-dispatcher-servlet/README.md index a93993679f..3954d4df5a 100644 --- a/spring-dispatcher-servlet/README.md +++ b/spring-dispatcher-servlet/README.md @@ -1,3 +1,7 @@ +## Spring DispatcherServlet + +This module contains articles about Spring DispatcherServlet + ## Relevant articles: - [An Intro to the Spring DispatcherServlet](http://www.baeldung.com/spring-dispatcherservlet) From 5e1c8406fd67f09d4f852057245e7e2d9a755fa0 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Thu, 19 Sep 2019 17:57:14 +0100 Subject: [PATCH 018/107] minor edits --- spring-cloud-bus/README.md | 2 +- spring-core-2/README.md | 2 +- spring-core/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-cloud-bus/README.md b/spring-cloud-bus/README.md index 82f2dbba63..9c33353a24 100644 --- a/spring-cloud-bus/README.md +++ b/spring-cloud-bus/README.md @@ -1,6 +1,6 @@ ## Spring Cloud Bus -This modules contains articles about Spring Cloud Bus +This module contains articles about Spring Cloud Bus ### Relevant articles diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 4a53c60b0d..2f2ca7b351 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -1,6 +1,6 @@ ## Spring Core -This module contains articles about Core Spring Functionality +This module contains articles about core Spring functionality ## Relevant Articles: diff --git a/spring-core/README.md b/spring-core/README.md index 018012a927..c3c770a856 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -1,6 +1,6 @@ ## Spring Core -This module contains articles about Core Spring Functionality +This module contains articles about core Spring functionality ### Relevant Articles: - [Wiring in Spring: @Autowired, @Resource and @Inject](http://www.baeldung.com/spring-annotations-resource-inject-autowire) From 9baee5bc6e88df25304a9b10b2f66331c5fe108f Mon Sep 17 00:00:00 2001 From: Mike Baranski Date: Thu, 19 Sep 2019 23:53:16 -0400 Subject: [PATCH 019/107] [BAEL-3058] Demonstrate named query (#7772) * [BAEL-3058] Demonstrate named query * [BAEL-3058] Demonstrate the wrong way to do it, change to Junit 4 style test with annotations * Fix tab -> space and indentation * Moved hibernate-parameters to persistence-modules directory per request * Update persistence-modules/hibernate-parameters/pom.xml Co-Authored-By: KevinGilmore * Update persistence-modules/hibernate-parameters/pom.xml Co-Authored-By: KevinGilmore * Update persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java Co-Authored-By: KevinGilmore * Update persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java Co-Authored-By: KevinGilmore * Set version and add jar packaging --- .../hibernate-parameters/pom.xml | 52 ++++++++++++++ .../hibernate_parameters/Event.hbm.xml | 15 ++++ .../baeldung/hibernate_parameters/Event.java | 30 ++++++++ .../NamedParameterUnitTest.java | 72 +++++++++++++++++++ .../src/test/resources/hibernate.cfg.xml | 28 ++++++++ persistence-modules/pom.xml | 1 + 6 files changed, 198 insertions(+) create mode 100644 persistence-modules/hibernate-parameters/pom.xml create mode 100644 persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml create mode 100644 persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java create mode 100644 persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java create mode 100644 persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml diff --git a/persistence-modules/hibernate-parameters/pom.xml b/persistence-modules/hibernate-parameters/pom.xml new file mode 100644 index 0000000000..b744e181da --- /dev/null +++ b/persistence-modules/hibernate-parameters/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + com.baeldung + hibernate-parameters + 0.1-SNAPSHOT + hibernate-parameters + jar + Hibernate tutorial illustrating the use of named parameters + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + + org.hibernate + hibernate-core + 5.4.4.Final + + + + com.h2database + h2 + 1.4.196 + + + + + + + false + src/test/java + + **/*.xml + + + + src/test/resources + + + + + + true + + + diff --git a/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml new file mode 100644 index 0000000000..4055718776 --- /dev/null +++ b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java new file mode 100644 index 0000000000..f44b1bfd8a --- /dev/null +++ b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/Event.java @@ -0,0 +1,30 @@ +package com.baeldung.hibernate_parameters; + +public class Event { + private Long id; + + private String title; + + public Event() { + } + + public Event(String title) { + this.title = title; + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} \ No newline at end of file diff --git a/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java new file mode 100644 index 0000000000..23854dc393 --- /dev/null +++ b/persistence-modules/hibernate-parameters/src/test/java/com/baeldung/hibernate_parameters/NamedParameterUnitTest.java @@ -0,0 +1,72 @@ +package com.baeldung.hibernate_parameters; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistry; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.query.Query; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +public class NamedParameterUnitTest { + private SessionFactory sessionFactory; + + @Before + public void setUp() throws Exception { + final StandardServiceRegistry registry = new StandardServiceRegistryBuilder() + .configure() + .build(); + try { + sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory(); + Session session = sessionFactory.openSession(); + session.beginTransaction(); + session.save(new Event("Event 1")); + session.save(new Event("Event 2")); + session.getTransaction().commit(); + session.close(); + } catch (Exception e) { + StandardServiceRegistryBuilder.destroy(registry); + } + } + + @After + public void tearDown() throws Exception { + if (sessionFactory != null) { + sessionFactory.close(); + } + } + + @Test + public void whenNamedParameterProvided_thenCorrect() { + Session session = sessionFactory.openSession(); + session.beginTransaction(); + Query query = session.createQuery("from Event E WHERE E.title = :eventTitle", Event.class); + + // This binds the value "Event1" to the parameter :eventTitle + query.setParameter("eventTitle", "Event 1"); + + assertEquals(1, query.list().size()); + session.getTransaction().commit(); + session.close(); + } + + @Test(expected = org.hibernate.QueryException.class) + public void whenNamedParameterMissing_thenThrowsQueryException() { + Session session = sessionFactory.openSession(); + session.beginTransaction(); + Query query = session.createQuery("from Event E WHERE E.title = :eventTitle", Event.class); + + try { + query.list(); + fail("We are expecting an exception!"); + } finally { + session.getTransaction().commit(); + session.close(); + } + } +} diff --git a/persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml b/persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml new file mode 100644 index 0000000000..480baae4c1 --- /dev/null +++ b/persistence-modules/hibernate-parameters/src/test/resources/hibernate.cfg.xml @@ -0,0 +1,28 @@ + + + + + + + org.h2.Driver + jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE + sa + + + 1 + + org.hibernate.dialect.H2Dialect + + org.hibernate.cache.internal.NoCacheProvider + + true + + create + + + + + + \ No newline at end of file diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index 0c22267192..932b62a235 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -23,6 +23,7 @@ hibernate5 hibernate-ogm hibernate-mapping + hibernate-parameters influxdb java-cassandra java-cockroachdb From c1caed8ddeaa1276210b144b8717d6f655601f36 Mon Sep 17 00:00:00 2001 From: Antonio Moreno Date: Fri, 20 Sep 2019 04:56:39 +0100 Subject: [PATCH 020/107] moving basicmethods from oop-2 to oop-3 (#7827) --- .../src/main/java/com/baeldung/basicmethods/PersonName.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-oop-3}/src/main/java/com/baeldung/basicmethods/PersonName.java (100%) diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/basicmethods/PersonName.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/basicmethods/PersonName.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/basicmethods/PersonName.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/basicmethods/PersonName.java From ac8c5efb74dabcb017494d59ec6aad9d4ecf4a84 Mon Sep 17 00:00:00 2001 From: Alfred Samanga Date: Fri, 20 Sep 2019 08:08:12 +0200 Subject: [PATCH 021/107] BAEL-3321 Flogger fluent logging (#7824) * Added Flogger maven dependency * Implemented Flogger logging examples * Finished implementing Flogger logging examples * Changed Flogger Test to Integration tests --- logging-modules/flogger/pom.xml | 27 +++++++ .../com/baeldung/flogger/FloggerExamples.java | 17 +++++ .../flogger/FloggerIntegrationTest.java | 73 +++++++++++++++++++ logging-modules/pom.xml | 1 + 4 files changed, 118 insertions(+) create mode 100644 logging-modules/flogger/pom.xml create mode 100644 logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java create mode 100644 logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java diff --git a/logging-modules/flogger/pom.xml b/logging-modules/flogger/pom.xml new file mode 100644 index 0000000000..2b96332bf6 --- /dev/null +++ b/logging-modules/flogger/pom.xml @@ -0,0 +1,27 @@ + + + + logging-modules + com.baeldung + 1.0.0-SNAPSHOT + + 4.0.0 + + flogger + + + + com.google.flogger + flogger + 0.4 + + + com.google.flogger + flogger-system-backend + 0.4 + runtime + + + \ No newline at end of file diff --git a/logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java b/logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java new file mode 100644 index 0000000000..252d2d38e4 --- /dev/null +++ b/logging-modules/flogger/src/main/java/com/baeldung/flogger/FloggerExamples.java @@ -0,0 +1,17 @@ +package com.baeldung.flogger; + +import com.google.common.flogger.FluentLogger; +import com.google.common.flogger.LoggerConfig; + +import java.util.logging.Level; + +public class FloggerExamples { + + private static final FluentLogger logger = FluentLogger.forEnclosingClass(); + + public static void main(String[] args) { + LoggerConfig.of(logger).setLevel(Level.FINE); + Exception exception = new Exception("This is a test exception."); + logger.atInfo().withCause(exception).log("Log message with: %s", "Alfred"); + } +} diff --git a/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java b/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java new file mode 100644 index 0000000000..69460dc045 --- /dev/null +++ b/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java @@ -0,0 +1,73 @@ +package com.baeldung.flogger; + +import com.google.common.flogger.FluentLogger; +import com.google.common.flogger.LoggerConfig; +import com.google.common.flogger.StackSize; +import org.junit.Test; + +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.stream.IntStream; + +import static com.google.common.flogger.LazyArgs.lazy; + +public class FloggerIntegrationTest { + private static final FluentLogger logger = FluentLogger.forEnclosingClass(); + + @Test + public void givenAnInterval_shouldLogAfterEveryInterval() { + IntStream.range(0, 100).forEach(value -> { + logger.atInfo().every(40).log("This log shows [every 40 iterations] => %d", value); + }); + } + + @Test + public void givenATimeInterval_shouldLogAfterEveryTimeInterval() { + IntStream.range(0, 1_000_0000).forEach(value -> { + logger.atInfo().atMostEvery(10, TimeUnit.SECONDS).log("This log shows [every 10 seconds] => %d", value); + }); + } + + @Test + public void givenASimpleOperation_shouldLogTheResult() { + int result = 45 / 3; + logger.atInfo().log("The result is %d", result); + } + + @Test + public void givenCodeThatThrowsAndException_shouldLogTheException() { + try { + int result = 45 / 0; + } catch (RuntimeException re) { + logger.atInfo().withStackTrace(StackSize.FULL).withCause(re).log("Message"); + } + } + + @Test + public void givenALoggingConfiguration_shouldLogAtTheConfiguredLevel() { + LoggerConfig.of(logger).setLevel(Level.FINE); + logger.atInfo().log("Info Message"); + logger.atWarning().log("Warning Message"); + logger.atSevere().log("Severe Message"); + logger.atFinest().log("Finest Message"); + logger.atFine().log("Fine Message"); + logger.atFiner().log("Finer Message"); + logger.atConfig().log("Config Message"); + } + + @Test + public void givenALongRunningMethodForStats_shouldCallTheMethodLazily() { + //Wrong way of doing it + logger.atFine().log("stats=%s", collectSummaries()); + + // Almost no work done at the log site and structure is preserved. + logger.atFine().log("stats=%s", lazy(() -> collectSummaries())); + } + + public static String collectSummaries() { + //compute summaries in a long-running process + int items = 110; + int s = 30; + return String.format("%d seconds elapsed so far. %d items pending processing", s, items); + } +} diff --git a/logging-modules/pom.xml b/logging-modules/pom.xml index a303e50ff1..927afb6ca9 100644 --- a/logging-modules/pom.xml +++ b/logging-modules/pom.xml @@ -18,6 +18,7 @@ log4j2 logback log-mdc + flogger From 7d65b1fb241e189585bd2133bdcf7e1e3b8502cd Mon Sep 17 00:00:00 2001 From: Devender Kumar <47500074+kumar-devender@users.noreply.github.com> Date: Fri, 20 Sep 2019 08:09:27 +0200 Subject: [PATCH 022/107] BAEL-3286 added component scan filter example (#7786) * BAEL-3286 added component scan filter example * BAEL-3286 added component scan filter example * Fix alingemnt * Remove unused class * Corrected formatting * formatted code --- spring-boot-di/pom.xml | 92 ++++++++++--------- .../filter/annotation/Animal.java | 10 ++ .../ComponentScanAnnotationFilterApp.java | 21 +++++ .../filter/annotation/Elephant.java | 4 + .../componentscan/filter/aspectj/Cat.java | 3 + .../aspectj/ComponentScanCustomFilterApp.java | 24 +++++ .../filter/aspectj/Elephant.java | 3 + .../componentscan/filter/aspectj/Loin.java | 3 + .../filter/assignable/Animal.java | 3 + .../componentscan/filter/assignable/Cat.java | 3 + .../ComponentScanAssignableTypeFilterApp.java | 21 +++++ .../filter/assignable/Elephant.java | 3 + .../componentscan/filter/custom/Cat.java | 3 + .../custom/ComponentScanCustomFilter.java | 22 +++++ .../custom/ComponentScanCustomFilterApp.java | 21 +++++ .../componentscan/filter/custom/Loin.java | 3 + .../componentscan/filter/custom/Pet.java | 3 + .../componentscan/filter/regex/Cat.java | 3 + .../regex/ComponentScanRegexFilterApp.java | 20 ++++ .../componentscan/filter/regex/Elephant.java | 3 + .../componentscan/filter/regex/Loin.java | 3 + 21 files changed, 227 insertions(+), 44 deletions(-) create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java diff --git a/spring-boot-di/pom.xml b/spring-boot-di/pom.xml index b07d7c6385..c0faf44335 100644 --- a/spring-boot-di/pom.xml +++ b/spring-boot-di/pom.xml @@ -1,55 +1,59 @@ - 4.0.0 - spring-boot-di - spring-boot-di - jar - Module For Spring Boot DI + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-di + spring-boot-di + jar + Module For Spring Boot DI - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + - + + + org.aspectj + aspectjweaver + - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - provided - + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + - + - - - - org.springframework.boot - spring-boot-maven-plugin - - com.baeldung.SpringBootDiApplication - JAR - - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + com.baeldung.SpringBootDiApplication + JAR + + + + - - com.baeldung.SpringBootDiApplication - + + com.baeldung.SpringBootDiApplication + diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java new file mode 100644 index 0000000000..73bd0e3673 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java @@ -0,0 +1,10 @@ +package com.baeldung.componentscan.filter.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Animal { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java new file mode 100644 index 0000000000..7e89870d4b --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java @@ -0,0 +1,21 @@ +package com.baeldung.componentscan.filter.annotation; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +import java.util.Arrays; + +@Configuration +@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Animal.class)) +public class ComponentScanAnnotationFilterApp { + private static ApplicationContext applicationContext; + + public static void main(String[] args) { + applicationContext = new AnnotationConfigApplicationContext(ComponentScanAnnotationFilterApp.class); + Arrays.stream(applicationContext.getBeanDefinitionNames()) + .forEach(System.out::println); + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java new file mode 100644 index 0000000000..8ad8111d6b --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java @@ -0,0 +1,4 @@ +package com.baeldung.componentscan.filter.annotation; + +@Animal +public class Elephant { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java new file mode 100644 index 0000000000..b34a2d7112 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.aspectj; + +public class Cat { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java new file mode 100644 index 0000000000..3674c09531 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java @@ -0,0 +1,24 @@ +package com.baeldung.componentscan.filter.aspectj; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +import java.util.Arrays; + +@Configuration +@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASPECTJ, + pattern = "com.baeldung.componentscan.filter.aspectj.* " + + "&& !(com.baeldung.componentscan.filter.aspectj.L* " + + "|| com.baeldung.componentscan.filter.aspectj.E*)")) +public class ComponentScanCustomFilterApp { + private static ApplicationContext applicationContext; + + public static void main(String[] args) { + applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class); + Arrays.stream(applicationContext.getBeanDefinitionNames()) + .forEach(System.out::println); + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java new file mode 100644 index 0000000000..30abc9dcd4 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.aspectj; + +public class Elephant { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java new file mode 100644 index 0000000000..cf442e981e --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.aspectj; + +public class Loin { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java new file mode 100644 index 0000000000..77cf2e72f0 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.assignable; + +public interface Animal { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java new file mode 100644 index 0000000000..262ae154f8 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.assignable; + +public class Cat implements Animal { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java new file mode 100644 index 0000000000..a5fa2b0942 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java @@ -0,0 +1,21 @@ +package com.baeldung.componentscan.filter.assignable; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +import java.util.Arrays; + +@Configuration +@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = Animal.class)) +public class ComponentScanAssignableTypeFilterApp { + private static ApplicationContext applicationContext; + + public static void main(String[] args) { + applicationContext = new AnnotationConfigApplicationContext(ComponentScanAssignableTypeFilterApp.class); + Arrays.stream(applicationContext.getBeanDefinitionNames()) + .forEach(System.out::println); + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java new file mode 100644 index 0000000000..815e0d762a --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.assignable; + +public class Elephant implements Animal { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java new file mode 100644 index 0000000000..282d6bb641 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.custom; + +public class Cat extends Pet { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java new file mode 100644 index 0000000000..ebaccf7838 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java @@ -0,0 +1,22 @@ +package com.baeldung.componentscan.filter.custom; + +import org.springframework.core.type.ClassMetadata; +import org.springframework.core.type.classreading.MetadataReader; +import org.springframework.core.type.classreading.MetadataReaderFactory; +import org.springframework.core.type.filter.TypeFilter; + +import java.io.IOException; + +public class ComponentScanCustomFilter implements TypeFilter { + + @Override + public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) + throws IOException { + ClassMetadata classMetadata = metadataReader.getClassMetadata(); + String superClass = classMetadata.getSuperClassName(); + if (Pet.class.getName().equalsIgnoreCase(superClass)) { + return true; + } + return false; + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java new file mode 100644 index 0000000000..1a4f5dbf4e --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java @@ -0,0 +1,21 @@ +package com.baeldung.componentscan.filter.custom; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +import java.util.Arrays; + +@Configuration +@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.CUSTOM, classes = ComponentScanCustomFilter.class)) +public class ComponentScanCustomFilterApp { + private static ApplicationContext applicationContext; + + public static void main(String[] args) { + applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class); + Arrays.stream(applicationContext.getBeanDefinitionNames()) + .forEach(System.out::println); + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java new file mode 100644 index 0000000000..0e2f9e0692 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.custom; + +public class Loin { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java new file mode 100644 index 0000000000..9b4497221d --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.custom; + +public class Pet { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java new file mode 100644 index 0000000000..87341cae9d --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.regex; + +public class Cat { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java new file mode 100644 index 0000000000..36e94446b2 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java @@ -0,0 +1,20 @@ +package com.baeldung.componentscan.filter.regex; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +import java.util.Arrays; + +@Configuration +@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*[t]")) +public class ComponentScanRegexFilterApp { + private static ApplicationContext applicationContext; + + public static void main(String[] args) { + applicationContext = new AnnotationConfigApplicationContext(ComponentScanRegexFilterApp.class); + Arrays.stream(applicationContext.getBeanDefinitionNames()).forEach(System.out::println); + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java new file mode 100644 index 0000000000..314dca5b77 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.regex; + +public class Elephant { } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java new file mode 100644 index 0000000000..1b75fc1b43 --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java @@ -0,0 +1,3 @@ +package com.baeldung.componentscan.filter.regex; + +public class Loin { } From f2cac1ab7c182b58c60dfacd74e539f6067f47d4 Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Fri, 20 Sep 2019 19:00:34 +0530 Subject: [PATCH 023/107] [BAEL-13506] - Split or move core-java-8 module (#7790) --- algorithms-miscellaneous-3/README.md | 1 + algorithms-miscellaneous-3/pom.xml | 17 +++ .../baeldung/counter/CounterStatistics.java | 0 .../com/baeldung/counter/CounterUnitTest.java | 0 .../com/baeldung/counter/CounterUtil.java | 0 core-java-modules/core-java-8/README.md | 41 ++----- core-java-modules/core-java-8/pom.xml | 17 --- .../core-java-annotations/README.md | 11 ++ .../core-java-annotations/pom.xml | 72 +++++++++++++ .../annotations/ClassWithAnnotation.java | 0 .../ClassWithDeprecatedMethod.java | 0 .../annotations/ClassWithSafeVarargs.java | 0 .../ClassWithSuppressWarnings.java | 0 .../com/baeldung/annotations/IntConsumer.java | 0 .../com/baeldung/annotations/Interval.java | 0 .../baeldung/annotations/IntervalUsage.java | 0 .../com/baeldung/annotations/Intervals.java | 0 .../baeldung/annotations/MyAnnotation.java | 0 .../annotations/MyAnnotationTarget.java | 0 .../com/baeldung/annotations/MyOperation.java | 0 .../baeldung/annotations/MyOperationImpl.java | 0 .../com/baeldung/customannotations/Init.java | 0 .../customannotations/JsonElement.java | 0 .../customannotations/JsonSerializable.java | 0 .../JsonSerializationException.java | 0 .../ObjectToJsonConverter.java | 0 .../baeldung/customannotations/Person.java | 0 .../src/main/resources/logback.xml | 13 +++ .../JsonSerializerUnitTest.java | 0 .../src/test/resources/.gitignore | 13 +++ .../core-java-datetime/README.md | 7 ++ core-java-modules/core-java-datetime/pom.xml | 101 ++++++++++++++++++ .../src/main/resources/logback.xml | 13 +++ .../com/baeldung/time/InstantUnitTest.java | 0 .../time/InstantWithJMockUnitTest.java | 0 .../baeldung/time/LocalDateTimeUnitTest.java | 0 .../time/LocalDateTimeWithJMockUnitTest.java | 0 .../src/test/resources/.gitignore | 13 +++ .../core-java-function/README.md | 6 ++ core-java-modules/core-java-function/pom.xml | 49 +++++++++ .../src/main/resources/logback.xml | 13 +++ .../java8/Java8PredicateChainUnitTest.java | 0 .../src/test/resources/.gitignore | 13 +++ core-java-modules/core-java-lambdas/README.md | 1 + .../com/baeldung/doublecolon/Computer.java | 0 .../baeldung/doublecolon/ComputerUtils.java | 4 +- .../com/baeldung/doublecolon/MacbookPro.java | 0 .../function/ComputerPredicate.java | 0 .../doublecolon/function/TriFunction.java | 0 .../doublecolon/ComputerUtilsUnitTest.java | 0 core-java-modules/core-java-lang-2/README.md | 1 + core-java-modules/core-java-lang-2/pom.xml | 17 +++ .../baeldung/primitive/BenchmarkRunner.java | 0 .../primitive/BooleanPrimitiveLookup.java | 0 .../primitive/BooleanWrapperLookup.java | 0 .../primitive/BytePrimitiveLookup.java | 0 .../baeldung/primitive/ByteWrapperLookup.java | 0 .../primitive/CharPrimitiveLookup.java | 0 .../primitive/CharacterWrapperLookup.java | 0 .../primitive/DoublePrimitiveLookup.java | 0 .../primitive/DoubleWrapperLookup.java | 0 .../primitive/FloatPrimitiveLookup.java | 0 .../primitive/FloatWrapperLookup.java | 0 .../primitive/IntPrimitiveLookup.java | 0 .../primitive/IntegerWrapperLookup.java | 0 .../primitive/LongPrimitiveLookup.java | 0 .../baeldung/primitive/LongWrapperLookup.java | 0 .../java/com/baeldung/primitive/Lookup.java | 0 .../primitive/ShortPrimitiveLookup.java | 0 .../primitive/ShortWrapperLookup.java | 0 .../core-java-lang-math/README.md | 7 ++ core-java-modules/core-java-lang-math/pom.xml | 49 +++++++++ .../src/main/resources/logback.xml | 13 +++ .../java8/UnsignedArithmeticUnitTest.java | 0 .../baeldung/math/MathNewMethodsUnitTest.java | 0 .../src/test/resources/.gitignore | 13 +++ .../core-java-lang-oop-2/README.md | 1 + .../application/Application.java | 0 .../model/Alarm.java | 0 .../model/Car.java | 0 .../model/Motorbike.java | 0 .../model/MultiAlarmCar.java | 0 .../model/Vehicle.java | 0 .../StaticDefaulInterfaceMethodUnitTest.java | 0 .../core-java-optional/README.md | 2 + core-java-modules/core-java-optional/pom.xml | 17 +++ .../java/com/baeldung/optional/Modem.java | 0 .../baeldung/optional/OrElseAndOrElseGet.java | 0 .../OrElseAndOrElseGetBenchmarkRunner.java | 0 .../java/com/baeldung/optional/Person.java | 0 .../optional/OptionalChainingUnitTest.java | 0 .../java8/optional/OptionalUnitTest.java | 0 .../optional/OrElseAndOrElseGetUnitTest.java | 0 core-java-modules/core-java-streams/README.md | 9 ++ core-java-modules/core-java-streams/pom.xml | 54 ++++++++++ .../com/baeldung/forEach/ReverseList.java | 0 .../src/main/resources/logback.xml | 13 +++ .../collectors/Java8CollectorsUnitTest.java | 0 .../StreamForEachIfElseUnitTest.java | 0 .../src/test/resources/.gitignore | 13 +++ core-java-modules/core-java-text/README.md | 6 ++ core-java-modules/core-java-text/pom.xml | 32 ++++++ .../src/main/resources/logback.xml | 13 +++ .../src/test/resources/.gitignore | 13 +++ patterns/design-patterns-creational/README.md | 1 + .../baeldung/reducingIfElse/AddCommand.java | 0 .../com/baeldung/reducingIfElse/AddRule.java | 0 .../com/baeldung/reducingIfElse/Addition.java | 0 .../baeldung/reducingIfElse/Calculator.java | 0 .../com/baeldung/reducingIfElse/Command.java | 0 .../com/baeldung/reducingIfElse/Division.java | 0 .../baeldung/reducingIfElse/Expression.java | 0 .../com/baeldung/reducingIfElse/Modulo.java | 0 .../reducingIfElse/Multiplication.java | 0 .../baeldung/reducingIfElse/Operation.java | 0 .../com/baeldung/reducingIfElse/Operator.java | 0 .../reducingIfElse/OperatorFactory.java | 0 .../com/baeldung/reducingIfElse/Result.java | 0 .../com/baeldung/reducingIfElse/Rule.java | 0 .../baeldung/reducingIfElse/RuleEngine.java | 0 .../baeldung/reducingIfElse/Subtraction.java | 0 .../reduceIfelse/CalculatorUnitTest.java | 0 .../reduceIfelse/RuleEngineUnitTest.java | 0 pom.xml | 12 +++ 124 files changed, 640 insertions(+), 51 deletions(-) rename {core-java-modules/core-java-8 => algorithms-miscellaneous-3}/src/test/java/com/baeldung/counter/CounterStatistics.java (100%) rename {core-java-modules/core-java-8 => algorithms-miscellaneous-3}/src/test/java/com/baeldung/counter/CounterUnitTest.java (100%) rename {core-java-modules/core-java-8 => algorithms-miscellaneous-3}/src/test/java/com/baeldung/counter/CounterUtil.java (100%) create mode 100644 core-java-modules/core-java-annotations/README.md create mode 100644 core-java-modules/core-java-annotations/pom.xml rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/IntConsumer.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/Interval.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/IntervalUsage.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/Intervals.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/MyAnnotation.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/MyOperation.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/annotations/MyOperationImpl.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/customannotations/Init.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/customannotations/JsonElement.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/customannotations/JsonSerializable.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/customannotations/JsonSerializationException.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java (100%) rename core-java-modules/{core-java-8 => core-java-annotations}/src/main/java/com/baeldung/customannotations/Person.java (100%) create mode 100644 core-java-modules/core-java-annotations/src/main/resources/logback.xml rename core-java-modules/{core-java-8 => core-java-annotations}/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java (100%) create mode 100644 core-java-modules/core-java-annotations/src/test/resources/.gitignore create mode 100644 core-java-modules/core-java-datetime/README.md create mode 100644 core-java-modules/core-java-datetime/pom.xml create mode 100644 core-java-modules/core-java-datetime/src/main/resources/logback.xml rename core-java-modules/{core-java-8 => core-java-datetime}/src/test/java/com/baeldung/time/InstantUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-datetime}/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-datetime}/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-datetime}/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java (100%) create mode 100644 core-java-modules/core-java-datetime/src/test/resources/.gitignore create mode 100644 core-java-modules/core-java-function/README.md create mode 100644 core-java-modules/core-java-function/pom.xml create mode 100644 core-java-modules/core-java-function/src/main/resources/logback.xml rename core-java-modules/{core-java-8 => core-java-function}/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java (100%) create mode 100644 core-java-modules/core-java-function/src/test/resources/.gitignore rename core-java-modules/{core-java-8 => core-java-lambdas}/src/main/java/com/baeldung/doublecolon/Computer.java (100%) rename core-java-modules/{core-java-8 => core-java-lambdas}/src/main/java/com/baeldung/doublecolon/ComputerUtils.java (100%) rename core-java-modules/{core-java-8 => core-java-lambdas}/src/main/java/com/baeldung/doublecolon/MacbookPro.java (100%) rename core-java-modules/{core-java-8 => core-java-lambdas}/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java (100%) rename core-java-modules/{core-java-8 => core-java-lambdas}/src/main/java/com/baeldung/doublecolon/function/TriFunction.java (100%) rename core-java-modules/{core-java-8 => core-java-lambdas}/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/BenchmarkRunner.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/LongWrapperLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/Lookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-2}/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java (100%) create mode 100644 core-java-modules/core-java-lang-math/README.md create mode 100644 core-java-modules/core-java-lang-math/pom.xml create mode 100644 core-java-modules/core-java-lang-math/src/main/resources/logback.xml rename core-java-modules/{core-java-8 => core-java-lang-math}/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-math}/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java (100%) create mode 100644 core-java-modules/core-java-lang-math/src/test/resources/.gitignore rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java (100%) rename core-java-modules/{core-java-8 => core-java-lang-oop-2}/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/main/java/com/baeldung/optional/Modem.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/main/java/com/baeldung/optional/Person.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-optional}/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java (100%) create mode 100644 core-java-modules/core-java-streams/README.md create mode 100644 core-java-modules/core-java-streams/pom.xml rename core-java-modules/{core-java-8-2 => core-java-streams}/src/main/java/com/baeldung/forEach/ReverseList.java (100%) create mode 100644 core-java-modules/core-java-streams/src/main/resources/logback.xml rename core-java-modules/{core-java-8 => core-java-streams}/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java (100%) rename core-java-modules/{core-java-8 => core-java-streams}/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java (100%) create mode 100644 core-java-modules/core-java-streams/src/test/resources/.gitignore create mode 100644 core-java-modules/core-java-text/README.md create mode 100644 core-java-modules/core-java-text/pom.xml create mode 100644 core-java-modules/core-java-text/src/main/resources/logback.xml create mode 100644 core-java-modules/core-java-text/src/test/resources/.gitignore rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/AddCommand.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/AddRule.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Addition.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Calculator.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Command.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Division.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Expression.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Modulo.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Multiplication.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Operation.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Operator.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Result.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Rule.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/main/java/com/baeldung/reducingIfElse/Subtraction.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java (100%) rename {core-java-modules/core-java-8 => patterns/design-patterns-creational}/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java (100%) diff --git a/algorithms-miscellaneous-3/README.md b/algorithms-miscellaneous-3/README.md index ce0fde0415..843407f047 100644 --- a/algorithms-miscellaneous-3/README.md +++ b/algorithms-miscellaneous-3/README.md @@ -8,3 +8,4 @@ - [Checking if a Java Graph has a Cycle](https://www.baeldung.com/java-graph-has-a-cycle) - [A Guide to the Folding Technique in Java](https://www.baeldung.com/folding-hashing-technique) - [Creating a Triangle with for Loops in Java](https://www.baeldung.com/java-print-triangle) +- [Efficient Word Frequency Calculator in Java](https://www.baeldung.com/java-word-frequency) \ No newline at end of file diff --git a/algorithms-miscellaneous-3/pom.xml b/algorithms-miscellaneous-3/pom.xml index 5999d33c86..67923d37d7 100644 --- a/algorithms-miscellaneous-3/pom.xml +++ b/algorithms-miscellaneous-3/pom.xml @@ -54,6 +54,21 @@ 1.1.0 test
+ + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + @@ -73,5 +88,7 @@ 4.3 28.0-jre 2.6.0 + 1.19 + 1.19 \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterStatistics.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterStatistics.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterStatistics.java rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterStatistics.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUnitTest.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUnitTest.java rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUtil.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUtil.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUtil.java rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUtil.java diff --git a/core-java-modules/core-java-8/README.md b/core-java-modules/core-java-8/README.md index aee7121fb3..6d69d30d00 100644 --- a/core-java-modules/core-java-8/README.md +++ b/core-java-modules/core-java-8/README.md @@ -3,35 +3,12 @@ ## Core Java 8 Cookbooks and Examples ### Relevant Articles: -- [Guide to Java 8’s Collectors](http://www.baeldung.com/java-8-collectors) -- [New Features in Java 8](http://www.baeldung.com/java-8-new-features) -- [The Double Colon Operator in Java 8](http://www.baeldung.com/java-8-double-colon-operator) -- [Guide to Java 8 groupingBy Collector](http://www.baeldung.com/java-groupingby-collector) -- [Strategy Design Pattern in Java 8](http://www.baeldung.com/java-strategy-pattern) -- [Guide to Java 8 Comparator.comparing()](http://www.baeldung.com/java-8-comparator-comparing) -- [Guide To Java 8 Optional](http://www.baeldung.com/java-optional) -- [Guide to the Java 8 forEach](http://www.baeldung.com/foreach-java) -- [The Difference Between map() and flatMap()](http://www.baeldung.com/java-difference-map-and-flatmap) -- [Static and Default Methods in Interfaces in Java](http://www.baeldung.com/java-static-default-methods) -- [Efficient Word Frequency Calculator in Java](http://www.baeldung.com/java-word-frequency) -- [Introduction to Spliterator in Java](http://www.baeldung.com/java-spliterator) -- [Java 8 Math New Methods](http://www.baeldung.com/java-8-math) -- [Overview of Java Built-in Annotations](http://www.baeldung.com/java-default-annotations) -- [Finding Min/Max in an Array with Java](http://www.baeldung.com/java-array-min-max) -- [Internationalization and Localization in Java 8](http://www.baeldung.com/java-8-localization) -- [Java Optional – orElse() vs orElseGet()](http://www.baeldung.com/java-optional-or-else-vs-or-else-get) -- [Java 8 Unsigned Arithmetic Support](http://www.baeldung.com/java-unsigned-arithmetic) -- [Generalized Target-Type Inference in Java](http://www.baeldung.com/java-generalized-target-type-inference) -- [Overriding System Time for Testing in Java](http://www.baeldung.com/java-override-system-time) -- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone) -- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) -- [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) -- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic) -- [How to Replace Many if Statements in Java](https://www.baeldung.com/java-replace-if-statements) -- [Java @Override Annotation](https://www.baeldung.com/java-override) -- [Java @SuppressWarnings Annotation](https://www.baeldung.com/java-suppresswarnings) -- [Java @SafeVarargs Annotation](https://www.baeldung.com/java-safevarargs) -- [Java @Deprecated Annotation](https://www.baeldung.com/java-deprecated) -- [Java 8 Predicate Chain](https://www.baeldung.com/java-predicate-chain) -- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation) -- [The Difference Between Collection.stream().forEach() and Collection.forEach()](https://www.baeldung.com/java-collection-stream-foreach) +- [New Features in Java 8](https://www.baeldung.com/java-8-new-features) +- [Guide to Java 8 groupingBy Collector](https://www.baeldung.com/java-groupingby-collector) +- [Strategy Design Pattern in Java 8](https://www.baeldung.com/java-strategy-pattern) +- [Guide to Java 8 Comparator.comparing()](https://www.baeldung.com/java-8-comparator-comparing) +- [Guide to the Java 8 forEach](https://www.baeldung.com/foreach-java) +- [Introduction to Spliterator in Java](https://www.baeldung.com/java-spliterator) +- [Finding Min/Max in an Array with Java](https://www.baeldung.com/java-array-min-max) +- [Internationalization and Localization in Java 8](https://www.baeldung.com/java-8-localization) +- [Generalized Target-Type Inference in Java](https://www.baeldung.com/java-generalized-target-type-inference) diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml index 6e547b7fad..9ef3cd1201 100644 --- a/core-java-modules/core-java-8/pom.xml +++ b/core-java-modules/core-java-8/pom.xml @@ -116,12 +116,6 @@ ${powermock.version} test - - org.jmockit - jmockit - ${jmockit.version} - test - @@ -150,16 +144,6 @@ - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar - - true - - @@ -176,7 +160,6 @@ 3.6.1 1.8.9 2.0.0-RC.4 - 1.44 1.7.0 1.19 1.19 diff --git a/core-java-modules/core-java-annotations/README.md b/core-java-modules/core-java-annotations/README.md new file mode 100644 index 0000000000..a125e8abd5 --- /dev/null +++ b/core-java-modules/core-java-annotations/README.md @@ -0,0 +1,11 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Java @Override Annotation](https://www.baeldung.com/java-override) +- [Java @SuppressWarnings Annotation](https://www.baeldung.com/java-suppresswarnings) +- [Java @SafeVarargs Annotation](https://www.baeldung.com/java-safevarargs) +- [Java @Deprecated Annotation](https://www.baeldung.com/java-deprecated) +- [Overview of Java Built-in Annotations](https://www.baeldung.com/java-default-annotations) +- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation) \ No newline at end of file diff --git a/core-java-modules/core-java-annotations/pom.xml b/core-java-modules/core-java-annotations/pom.xml new file mode 100644 index 0000000000..7d7d7d4f7e --- /dev/null +++ b/core-java-modules/core-java-annotations/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + com.baeldung + core-java-annotations + 0.1.0-SNAPSHOT + core-java-annotations + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + + + + + core-java-annotations + + + src/main/resources + true + + + + + + + 3.6.1 + 1.8.9 + 1.19 + 1.19 + + 2.22.1 + + diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntConsumer.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntConsumer.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntConsumer.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntConsumer.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Interval.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Interval.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Interval.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Interval.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntervalUsage.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntervalUsage.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntervalUsage.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntervalUsage.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Intervals.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Intervals.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Intervals.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Intervals.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotation.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperation.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperationImpl.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperationImpl.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperationImpl.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperationImpl.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Init.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Init.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Init.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Init.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonElement.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonElement.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonElement.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonElement.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializable.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializable.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializable.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializable.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializationException.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializationException.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializationException.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializationException.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Person.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Person.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Person.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Person.java diff --git a/core-java-modules/core-java-annotations/src/main/resources/logback.xml b/core-java-modules/core-java-annotations/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/core-java-modules/core-java-annotations/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java b/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java rename to core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java diff --git a/core-java-modules/core-java-annotations/src/test/resources/.gitignore b/core-java-modules/core-java-annotations/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-modules/core-java-annotations/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-datetime/README.md b/core-java-modules/core-java-datetime/README.md new file mode 100644 index 0000000000..71aea2e9db --- /dev/null +++ b/core-java-modules/core-java-datetime/README.md @@ -0,0 +1,7 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone) +- [Overriding System Time for Testing in Java](https://www.baeldung.com/java-override-system-time) \ No newline at end of file diff --git a/core-java-modules/core-java-datetime/pom.xml b/core-java-modules/core-java-datetime/pom.xml new file mode 100644 index 0000000000..e2f86c7254 --- /dev/null +++ b/core-java-modules/core-java-datetime/pom.xml @@ -0,0 +1,101 @@ + + 4.0.0 + com.baeldung + core-java-datetime + 0.1.0-SNAPSHOT + core-java-datetime + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + joda-time + joda-time + ${joda.version} + + + org.aspectj + aspectjrt + ${asspectj.version} + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito2 + ${powermock.version} + test + + + org.jmockit + jmockit + ${jmockit.version} + test + + + + + core-java-datetime + + + src/main/resources + true + + + + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar + + true + + + + + + + + 3.6.1 + 2.10 + + 3.6.1 + 1.8.9 + 2.0.0-RC.4 + 1.44 + + 2.22.1 + + diff --git a/core-java-modules/core-java-datetime/src/main/resources/logback.xml b/core-java-modules/core-java-datetime/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/core-java-modules/core-java-datetime/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantUnitTest.java b/core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/InstantUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantUnitTest.java rename to core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/InstantUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java b/core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java rename to core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java b/core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java rename to core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java b/core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java rename to core-java-modules/core-java-datetime/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java diff --git a/core-java-modules/core-java-datetime/src/test/resources/.gitignore b/core-java-modules/core-java-datetime/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-modules/core-java-datetime/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-function/README.md b/core-java-modules/core-java-function/README.md new file mode 100644 index 0000000000..677f148bdb --- /dev/null +++ b/core-java-modules/core-java-function/README.md @@ -0,0 +1,6 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Java 8 Predicate Chain](https://www.baeldung.com/java-predicate-chain) \ No newline at end of file diff --git a/core-java-modules/core-java-function/pom.xml b/core-java-modules/core-java-function/pom.xml new file mode 100644 index 0000000000..5ed7ca68c2 --- /dev/null +++ b/core-java-modules/core-java-function/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + com.baeldung + core-java-function + 0.1.0-SNAPSHOT + core-java-function + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-function + + + src/main/resources + true + + + + + + + 3.6.1 + 1.8.9 + + 2.22.1 + + diff --git a/core-java-modules/core-java-function/src/main/resources/logback.xml b/core-java-modules/core-java-function/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/core-java-modules/core-java-function/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java b/core-java-modules/core-java-function/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java rename to core-java-modules/core-java-function/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java diff --git a/core-java-modules/core-java-function/src/test/resources/.gitignore b/core-java-modules/core-java-function/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-modules/core-java-function/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-lambdas/README.md b/core-java-modules/core-java-lambdas/README.md index 98fff64d68..832d4783f2 100644 --- a/core-java-modules/core-java-lambdas/README.md +++ b/core-java-modules/core-java-lambdas/README.md @@ -6,3 +6,4 @@ - [Lambda Expressions and Functional Interfaces: Tips and Best Practices](http://www.baeldung.com/java-8-lambda-expressions-tips) - [Exceptions in Java 8 Lambda Expressions](http://www.baeldung.com/java-lambda-exceptions) - [Method References in Java](https://www.baeldung.com/java-method-references) +- [The Double Colon Operator in Java 8](https://www.baeldung.com/java-8-double-colon-operator) \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/Computer.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/Computer.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/ComputerUtils.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/ComputerUtils.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/ComputerUtils.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/ComputerUtils.java index 317808d893..ea274072ea 100644 --- a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/ComputerUtils.java +++ b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/ComputerUtils.java @@ -1,10 +1,10 @@ package com.baeldung.doublecolon; -import com.baeldung.doublecolon.function.ComputerPredicate; - import java.util.ArrayList; import java.util.List; +import com.baeldung.doublecolon.function.ComputerPredicate; + public class ComputerUtils { static final ComputerPredicate after2010Predicate = (c) -> (c.getAge() > 2010); diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/MacbookPro.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/MacbookPro.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/TriFunction.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/TriFunction.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/TriFunction.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/TriFunction.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java b/core-java-modules/core-java-lambdas/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java rename to core-java-modules/core-java-lambdas/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java diff --git a/core-java-modules/core-java-lang-2/README.md b/core-java-modules/core-java-lang-2/README.md index 88a48661a0..d925e81d87 100644 --- a/core-java-modules/core-java-lang-2/README.md +++ b/core-java-modules/core-java-lang-2/README.md @@ -3,3 +3,4 @@ ## Core Java Lang Cookbooks and Examples ### Relevant Articles: +- [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) \ No newline at end of file diff --git a/core-java-modules/core-java-lang-2/pom.xml b/core-java-modules/core-java-lang-2/pom.xml index 4b02e06be4..fb4a5bd009 100644 --- a/core-java-modules/core-java-lang-2/pom.xml +++ b/core-java-modules/core-java-lang-2/pom.xml @@ -15,6 +15,21 @@ + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + @@ -28,6 +43,8 @@ + 1.19 + 1.19 diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BenchmarkRunner.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BenchmarkRunner.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BenchmarkRunner.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BenchmarkRunner.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/Lookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/Lookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/Lookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/Lookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java diff --git a/core-java-modules/core-java-lang-math/README.md b/core-java-modules/core-java-lang-math/README.md new file mode 100644 index 0000000000..cfa3052f43 --- /dev/null +++ b/core-java-modules/core-java-lang-math/README.md @@ -0,0 +1,7 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Java 8 Math New Methods](https://www.baeldung.com/java-8-math) +- [Java 8 Unsigned Arithmetic Support](https://www.baeldung.com/java-unsigned-arithmetic) diff --git a/core-java-modules/core-java-lang-math/pom.xml b/core-java-modules/core-java-lang-math/pom.xml new file mode 100644 index 0000000000..f3e5132e5b --- /dev/null +++ b/core-java-modules/core-java-lang-math/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + com.baeldung + core-java-lang-math + 0.1.0-SNAPSHOT + core-java-lang-math + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-lang-math + + + src/main/resources + true + + + + + + + 3.6.1 + 1.8.9 + + 2.22.1 + + diff --git a/core-java-modules/core-java-lang-math/src/main/resources/logback.xml b/core-java-modules/core-java-lang-math/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java rename to core-java-modules/core-java-lang-math/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java rename to core-java-modules/core-java-lang-math/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java diff --git a/core-java-modules/core-java-lang-math/src/test/resources/.gitignore b/core-java-modules/core-java-lang-math/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-2/README.md b/core-java-modules/core-java-lang-oop-2/README.md index c43c9f02dc..096e4ee002 100644 --- a/core-java-modules/core-java-lang-oop-2/README.md +++ b/core-java-modules/core-java-lang-oop-2/README.md @@ -13,3 +13,4 @@ - [Immutable Objects in Java](https://www.baeldung.com/java-immutable-object) - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](https://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) +- [Static and Default Methods in Interfaces in Java](https://www.baeldung.com/java-static-default-methods) \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java b/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java rename to core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java diff --git a/core-java-modules/core-java-optional/README.md b/core-java-modules/core-java-optional/README.md index b6848b5d33..22ac8736fa 100644 --- a/core-java-modules/core-java-optional/README.md +++ b/core-java-modules/core-java-optional/README.md @@ -4,3 +4,5 @@ ### Relevant Articles: - [Java Optional as Return Type](https://www.baeldung.com/java-optional-return) +- [Guide To Java 8 Optional](https://www.baeldung.com/java-optional) +- [Java Optional – orElse() vs orElseGet()](https://www.baeldung.com/java-optional-or-else-vs-or-else-get) \ No newline at end of file diff --git a/core-java-modules/core-java-optional/pom.xml b/core-java-modules/core-java-optional/pom.xml index ca6158ef5a..d5ccd43e55 100644 --- a/core-java-modules/core-java-optional/pom.xml +++ b/core-java-modules/core-java-optional/pom.xml @@ -27,6 +27,21 @@ jackson-databind ${jackson.version} + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + @@ -49,5 +64,7 @@ 1.8 1.8 5.4.0.Final + 1.19 + 1.19 \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Modem.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Modem.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Modem.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Modem.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Person.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Person.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Person.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Person.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java diff --git a/core-java-modules/core-java-streams/README.md b/core-java-modules/core-java-streams/README.md new file mode 100644 index 0000000000..e97641c221 --- /dev/null +++ b/core-java-modules/core-java-streams/README.md @@ -0,0 +1,9 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [The Difference Between map() and flatMap()](https://www.baeldung.com/java-difference-map-and-flatmap) +- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic) +- [The Difference Between Collection.stream().forEach() and Collection.forEach()](https://www.baeldung.com/java-collection-stream-foreach) +- [Guide to Java 8’s Collectors](https://www.baeldung.com/java-8-collectors) \ No newline at end of file diff --git a/core-java-modules/core-java-streams/pom.xml b/core-java-modules/core-java-streams/pom.xml new file mode 100644 index 0000000000..4ff8e8aaba --- /dev/null +++ b/core-java-modules/core-java-streams/pom.xml @@ -0,0 +1,54 @@ + + 4.0.0 + com.baeldung + core-java-streams + 0.1.0-SNAPSHOT + core-java-streams + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-streams + + + src/main/resources + true + + + + + + + 3.6.1 + + 2.22.1 + + diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/forEach/ReverseList.java similarity index 100% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/forEach/ReverseList.java diff --git a/core-java-modules/core-java-streams/src/main/resources/logback.xml b/core-java-modules/core-java-streams/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/core-java-modules/core-java-streams/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java diff --git a/core-java-modules/core-java-streams/src/test/resources/.gitignore b/core-java-modules/core-java-streams/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-modules/core-java-streams/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-text/README.md b/core-java-modules/core-java-text/README.md new file mode 100644 index 0000000000..5a6db4e8fd --- /dev/null +++ b/core-java-modules/core-java-text/README.md @@ -0,0 +1,6 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) \ No newline at end of file diff --git a/core-java-modules/core-java-text/pom.xml b/core-java-modules/core-java-text/pom.xml new file mode 100644 index 0000000000..f831ec5f40 --- /dev/null +++ b/core-java-modules/core-java-text/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + com.baeldung + core-java-text + 0.1.0-SNAPSHOT + core-java-text + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + + core-java-text + + + src/main/resources + true + + + + + + + diff --git a/core-java-modules/core-java-text/src/main/resources/logback.xml b/core-java-modules/core-java-text/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/core-java-modules/core-java-text/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-text/src/test/resources/.gitignore b/core-java-modules/core-java-text/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-modules/core-java-text/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/patterns/design-patterns-creational/README.md b/patterns/design-patterns-creational/README.md index 0c00dc7b3a..99b9b39787 100644 --- a/patterns/design-patterns-creational/README.md +++ b/patterns/design-patterns-creational/README.md @@ -6,3 +6,4 @@ - [Double-Checked Locking with Singleton](https://www.baeldung.com/java-singleton-double-checked-locking) - [Java Constructors vs Static Factory Methods](https://www.baeldung.com/java-constructors-vs-static-factory-methods) - [Automatic Generation of the Builder Pattern with FreeBuilder](https://www.baeldung.com/java-builder-pattern-freebuilder) +- [How to Replace Many if Statements in Java](https://www.baeldung.com/java-replace-if-statements) \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddCommand.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddCommand.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddRule.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/AddRule.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Addition.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Addition.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Calculator.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Calculator.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Command.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Command.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Division.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Division.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Expression.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Expression.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Modulo.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Modulo.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Multiplication.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Multiplication.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operator.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Operator.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Result.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Result.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Rule.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Rule.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java b/patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Subtraction.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java rename to patterns/design-patterns-creational/src/main/java/com/baeldung/reducingIfElse/Subtraction.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java b/patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java rename to patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java b/patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java rename to patterns/design-patterns-creational/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java diff --git a/pom.xml b/pom.xml index f804def032..1daffc5786 100644 --- a/pom.xml +++ b/pom.xml @@ -389,6 +389,12 @@ core-java-modules/core-java-8 core-java-modules/core-java-8-2 + core-java-modules/core-java-annotations + core-java-modules/core-java-streams + core-java-modules/core-java-function + core-java-modules/core-java-lang-math + core-java-modules/core-java-datetime + core-java-modules/core-java-text core-java-modules/core-java-lambdas @@ -1122,6 +1128,12 @@ core-java-modules/core-java-8 core-java-modules/core-java-8-2 + core-java-modules/core-java-annotations + core-java-modules/core-java-streams + core-java-modules/core-java-function + core-java-modules/core-java-lang-math + core-java-modules/core-java-datetime + core-java-modules/core-java-text core-java-modules/core-java-arrays From 87e98c90856ae44f34335c850f8dcbaa98621e89 Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Fri, 20 Sep 2019 16:47:19 +0300 Subject: [PATCH 024/107] Split or move core-java-modules/core-java-arrays module (#7784) --- .../core-java-arrays-2/.gitignore | 25 ------------------- .../core-java-arrays-2/README.MD | 6 ++++- .../array/AddElementToEndOfArray.java | 0 .../array/RemoveElementFromAnArray.java | 0 .../array/conversions/FloatToByteArray.java | 0 .../array/operations/ArrayOperations.java | 11 +++----- .../array/AddElementToEndOfArrayUnitTest.java | 0 .../RemoveElementFromAnArrayUnitTest.java | 7 ++---- .../conversions/FloatToByteArrayUnitTest.java | 8 +++--- .../operations/ArrayOperationsUnitTest.java | 8 +++--- .../operations/IntersectionUnitTest.java | 4 +-- core-java-modules/core-java-arrays/.gitignore | 25 ------------------- core-java-modules/core-java-arrays/README.md | 20 ++++++--------- 13 files changed, 26 insertions(+), 88 deletions(-) delete mode 100644 core-java-modules/core-java-arrays-2/.gitignore rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/main/java/com/baeldung/array/AddElementToEndOfArray.java (100%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java (100%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java (100%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/main/java/com/baeldung/array/operations/ArrayOperations.java (97%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java (100%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java (91%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java (80%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java (100%) rename core-java-modules/{core-java-arrays => core-java-arrays-2}/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java (91%) delete mode 100644 core-java-modules/core-java-arrays/.gitignore diff --git a/core-java-modules/core-java-arrays-2/.gitignore b/core-java-modules/core-java-arrays-2/.gitignore deleted file mode 100644 index 374c8bf907..0000000000 --- a/core-java-modules/core-java-arrays-2/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-2/README.MD b/core-java-modules/core-java-arrays-2/README.MD index f272f4d299..280fb33dc3 100644 --- a/core-java-modules/core-java-arrays-2/README.MD +++ b/core-java-modules/core-java-arrays-2/README.MD @@ -1,5 +1,9 @@ ## Relevant Articles - [Extending an Array’s Length](https://www.baeldung.com/java-array-add-element-at-the-end) -- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array) - [Looping Diagonally Through a 2d Java Array](https://www.baeldung.com/java-loop-diagonal-array) +- [Converting Between Stream and Array in Java](https://www.baeldung.com/java-stream-to-array) +- [Convert a Float to a Byte Array in Java](https://www.baeldung.com/java-convert-float-to-byte-array) +- [Array Operations in Java](https://www.baeldung.com/java-common-array-operations) +- [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection) +- [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element) diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/AddElementToEndOfArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/AddElementToEndOfArray.java similarity index 100% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/AddElementToEndOfArray.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/AddElementToEndOfArray.java diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java similarity index 100% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java similarity index 100% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java similarity index 97% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java index d8cc0afd61..94a00f7aba 100644 --- a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java +++ b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java @@ -1,19 +1,14 @@ package com.baeldung.array.operations; +import org.apache.commons.lang3.ArrayUtils; + import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.Random; -import java.util.Set; +import java.util.*; import java.util.function.Function; import java.util.function.IntPredicate; import java.util.function.Predicate; import java.util.stream.Stream; -import org.apache.commons.lang3.ArrayUtils; - public class ArrayOperations { // Get the first and last item of an array diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java similarity index 100% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java similarity index 91% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java index ea52cd17d9..567b870ef1 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java @@ -1,13 +1,10 @@ package com.baeldung.array; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - import org.apache.commons.lang3.ArrayUtils; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + class RemoveElementFromAnArrayUnitTest { private final RemoveElementFromAnArray sut = new RemoveElementFromAnArray(); diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java similarity index 80% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java index a2cd273f21..7656783052 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java @@ -1,12 +1,10 @@ package com.baeldung.array.conversions; -import static com.baeldung.array.conversions.FloatToByteArray.byteArrayToFloat; -import static com.baeldung.array.conversions.FloatToByteArray.byteArrayToFloatWithByteBuffer; -import static com.baeldung.array.conversions.FloatToByteArray.floatToByteArray; -import static com.baeldung.array.conversions.FloatToByteArray.floatToByteArrayWithByteBuffer; +import org.junit.Test; + +import static com.baeldung.array.conversions.FloatToByteArray.*; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -import org.junit.Test; public class FloatToByteArrayUnitTest { diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java similarity index 100% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java index a9c6d97d9f..d72681ca05 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java @@ -1,13 +1,13 @@ package com.baeldung.array.operations; -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.Arrays; - import org.assertj.core.api.Condition; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; + public class ArrayOperationsUnitTest { private Integer[] defaultObjectArray; diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java similarity index 91% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java index 3c61060ea8..1560cc5701 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java @@ -2,9 +2,7 @@ package com.baeldung.array.operations; import org.junit.jupiter.api.Test; -import static com.baeldung.array.operations.ArrayOperations.intersectionMultiSet; -import static com.baeldung.array.operations.ArrayOperations.intersectionSet; -import static com.baeldung.array.operations.ArrayOperations.intersectionSimple; +import static com.baeldung.array.operations.ArrayOperations.*; import static org.assertj.core.api.Assertions.assertThat; class IntersectionUnitTest { diff --git a/core-java-modules/core-java-arrays/.gitignore b/core-java-modules/core-java-arrays/.gitignore deleted file mode 100644 index 374c8bf907..0000000000 --- a/core-java-modules/core-java-arrays/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/core-java-modules/core-java-arrays/README.md b/core-java-modules/core-java-arrays/README.md index 45feff3edc..088e927910 100644 --- a/core-java-modules/core-java-arrays/README.md +++ b/core-java-modules/core-java-arrays/README.md @@ -3,17 +3,13 @@ ## Core Java Arrays Cookbooks and Examples ### Relevant Articles: -- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) -- [Check if a Java Array Contains a Value](http://www.baeldung.com/java-array-contains-value) -- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) -- [Guide to the java.util.Arrays Class](http://www.baeldung.com/java-util-arrays) -- [Multi-Dimensional Arrays In Java](http://www.baeldung.com/java-jagged-arrays) -- [Find Sum and Average in a Java Array](http://www.baeldung.com/java-array-sum-average) +- [How to Copy an Array in Java](https://www.baeldung.com/java-array-copy) +- [Check if a Java Array Contains a Value](https://www.baeldung.com/java-array-contains-value) +- [Initializing Arrays in Java](https://www.baeldung.com/java-initialize-array) +- [Guide to the java.util.Arrays Class](https://www.baeldung.com/java-util-arrays) +- [Multi-Dimensional Arrays In Java](https://www.baeldung.com/java-jagged-arrays) +- [Find Sum and Average in a Java Array](https://www.baeldung.com/java-array-sum-average) - [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) -- [How to Invert an Array in Java](http://www.baeldung.com/java-invert-array) -- [Array Operations in Java](http://www.baeldung.com/java-common-array-operations) -- [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection) +- [How to Invert an Array in Java](https://www.baeldung.com/java-invert-array) - [Sorting Arrays in Java](https://www.baeldung.com/java-sorting-arrays) -- [Convert a Float to a Byte Array in Java](https://www.baeldung.com/java-convert-float-to-byte-array) -- [Converting Between Stream and Array in Java](https://www.baeldung.com/java-stream-to-array) -- [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element) +- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array) From 8acac28de3cac1e79797b5c09de04c1efd5f8b5b Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 20 Sep 2019 15:08:28 +0100 Subject: [PATCH 025/107] [BAEL-17488] - README descriptions 4 (#7830) * [BAEL-17488] - README descriptions 4 * [BAEL-17488] - README descriptions 4 * minor changes --- spring-boot-admin/README.md | 4 +++ spring-boot-angular-ecommerce/README.md | 4 +++ spring-boot-angular/README.md | 4 +++ .../{README.MD => README.md} | 4 +++ spring-boot-bootstrap/README.md | 4 +++ spring-boot-camel/README.md | 26 ++++++++++++------- spring-boot-cli/README.md | 4 +-- spring-boot-client/README.MD | 4 +++ spring-boot-crud/README.md | 4 +++ spring-boot-ctx-fluent/README.md | 3 +++ 10 files changed, 50 insertions(+), 11 deletions(-) rename spring-boot-autoconfiguration/{README.MD => README.md} (75%) diff --git a/spring-boot-admin/README.md b/spring-boot-admin/README.md index 73ce857059..61010819fd 100644 --- a/spring-boot-admin/README.md +++ b/spring-boot-admin/README.md @@ -1,3 +1,7 @@ +## Spring Boot Admin + +This module contains articles about Spring Boot Admin + ## 1. Spring Boot Admin Server * mvn clean install diff --git a/spring-boot-angular-ecommerce/README.md b/spring-boot-angular-ecommerce/README.md index c6564643e2..9b592de9cc 100644 --- a/spring-boot-angular-ecommerce/README.md +++ b/spring-boot-angular-ecommerce/README.md @@ -1,2 +1,6 @@ +## Spring Boot Angular Ecommerce + +This module contains articles about Spring Boot with Angular in regards to ecommerce applications. + ### Relevant Articles: - [A Simple E-Commerce Implementation with Spring](https://www.baeldung.com/spring-angular-ecommerce) diff --git a/spring-boot-angular/README.md b/spring-boot-angular/README.md index cfc1ea69f4..a1904c2c17 100644 --- a/spring-boot-angular/README.md +++ b/spring-boot-angular/README.md @@ -1,3 +1,7 @@ +## Spring Boot Angular + +This module contains articles about Spring Boot with Angular + ### Relevant Articles: - [Building a Web Application with Spring Boot and Angular](https://www.baeldung.com/spring-boot-angular-web) diff --git a/spring-boot-autoconfiguration/README.MD b/spring-boot-autoconfiguration/README.md similarity index 75% rename from spring-boot-autoconfiguration/README.MD rename to spring-boot-autoconfiguration/README.md index dc9cad539a..920c378139 100644 --- a/spring-boot-autoconfiguration/README.MD +++ b/spring-boot-autoconfiguration/README.md @@ -1,3 +1,7 @@ +## Spring Boot Auto Configuration + +This module contains articles about Spring Boot Auto Configuration + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring diff --git a/spring-boot-bootstrap/README.md b/spring-boot-bootstrap/README.md index 6a88f25bd7..82ec384c86 100644 --- a/spring-boot-bootstrap/README.md +++ b/spring-boot-bootstrap/README.md @@ -1,3 +1,7 @@ +## Spring Boot Bootstrap + +This module contains articles about bootstrapping Spring Boot applications. + ### Relevant Articles: - [Spring Boot Tutorial – Bootstrap a Simple Application](http://www.baeldung.com/spring-boot-start) - [Thin JARs with Spring Boot](http://www.baeldung.com/spring-boot-thin-jar) diff --git a/spring-boot-camel/README.md b/spring-boot-camel/README.md index 0e85db4a7f..194b7ea9c7 100644 --- a/spring-boot-camel/README.md +++ b/spring-boot-camel/README.md @@ -1,18 +1,26 @@ -Example for the Article on Camel API with SpringBoot +## Spring Boot Camel -to start up, run: - mvn spring-boot:run +This module contains articles about Spring Boot with Apache Camel + +### Example for the Article on Camel API with SpringBoot + +To start, run: + +`mvn spring-boot:run` -them, do a POST http request to: - http://localhost:8080/camel/api/bean +Then, make a POST http request to: -with the HEADER: Content-Type: application/json, +`http://localhost:8080/camel/api/bean` -and a BODY Payload like {"id": 1,"name": "World"} +Include the HEADER: Content-Type: application/json, -and we will get a return code of 201 and the response: Hello, World - if the transform() method from Application class is uncommented and the process() method is commented +and a BODY Payload like: -or return code of 201 and the response: {"id": 10,"name": "Hello, World"} - if the transform() method from Application class is commented and the process() method is uncommented +`{"id": 1,"name": "World"}` + +We will get a return code of 201 and the response: `Hello, World` - if the transform() method from Application class is uncommented and the process() method is commented + +or return code of 201 and the response: `{"id": 10,"name": "Hello, World"}` - if the transform() method from Application class is commented and the process() method is uncommented ## Relevant articles: diff --git a/spring-boot-cli/README.md b/spring-boot-cli/README.md index 85323da9b4..8c8a0c99c1 100644 --- a/spring-boot-cli/README.md +++ b/spring-boot-cli/README.md @@ -1,6 +1,6 @@ -========= - ## Spring Boot CLI +This module contains articles about Spring Boot CLI + ### Relevant Articles: - [Introduction to Spring Boot CLI](http://www.baeldung.com/spring-boot-cli) diff --git a/spring-boot-client/README.MD b/spring-boot-client/README.MD index 8db48089a5..c8b9e1cd6e 100644 --- a/spring-boot-client/README.MD +++ b/spring-boot-client/README.MD @@ -1,3 +1,7 @@ +## Spring Boot Client + +This module contains articles about Spring Boot Clients + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring diff --git a/spring-boot-crud/README.md b/spring-boot-crud/README.md index ab2cbe1e3a..6b0032deb3 100644 --- a/spring-boot-crud/README.md +++ b/spring-boot-crud/README.md @@ -1,3 +1,7 @@ +## Spring boot CRUD + +This module contains articles about Spring Boot CRUD Operations + ### Relevant Articles: - [Spring Boot CRUD Application with Thymeleaf](https://www.baeldung.com/spring-boot-crud-thymeleaf) - [Using a Spring Boot Application as a Dependency](https://www.baeldung.com/spring-boot-dependency) diff --git a/spring-boot-ctx-fluent/README.md b/spring-boot-ctx-fluent/README.md index 0b4b9c1271..646ad0f7d1 100644 --- a/spring-boot-ctx-fluent/README.md +++ b/spring-boot-ctx-fluent/README.md @@ -1,3 +1,6 @@ +## Spring Boot Context Fluent + +This module contains articles about Spring Boot Fluent Builder ### Relevant Articles: From 27654ee87523320356ee48d8df2d91bf14c11c13 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Fri, 20 Sep 2019 15:45:21 +0100 Subject: [PATCH 026/107] Added prev/next links --- spring-boot-ops-2/README.md | 1 + spring-boot-ops/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-ops-2/README.md b/spring-boot-ops-2/README.md index fa48cfd4da..0925b099b1 100644 --- a/spring-boot-ops-2/README.md +++ b/spring-boot-ops-2/README.md @@ -6,3 +6,4 @@ This module contains articles about Spring Boot Operations - [How to Configure Spring Boot Tomcat](https://www.baeldung.com/spring-boot-configure-tomcat) - [Spring Boot Embedded Tomcat Logs](https://www.baeldung.com/spring-boot-embedded-tomcat-logs) +- More articles: [[<-- prev]](/spring-boot-ops) diff --git a/spring-boot-ops/README.md b/spring-boot-ops/README.md index a40732d336..58e63bcdc7 100644 --- a/spring-boot-ops/README.md +++ b/spring-boot-ops/README.md @@ -16,4 +16,4 @@ This module contains articles about Spring Boot Operations - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) - - [more...](/spring-boot-ops-2) \ No newline at end of file + - More articles: [[next -->]](/spring-boot-ops-2) \ No newline at end of file From f58a1aaf0f1a7f15b06dd3d766572f5e1590e7d7 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Fri, 20 Sep 2019 15:48:38 +0100 Subject: [PATCH 027/107] Added next/prev links --- spring-core-2/README.md | 1 + spring-core/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 2f2ca7b351..936c93b460 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -8,3 +8,4 @@ This module contains articles about core Spring functionality - [Exploring the Spring BeanFactory API](http://www.baeldung.com/spring-beanfactory) - [How to use the Spring FactoryBean?](http://www.baeldung.com/spring-factorybean) - [Spring – Injecting Collections](http://www.baeldung.com/spring-injecting-collections) +- More articles: [[<-- prev]](/spring-core) diff --git a/spring-core/README.md b/spring-core/README.md index c3c770a856..f90e84121d 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -13,5 +13,5 @@ This module contains articles about core Spring functionality - [Spring Application Context Events](https://www.baeldung.com/spring-context-events) - [What is a Spring Bean?](https://www.baeldung.com/spring-bean) - [Spring PostConstruct and PreDestroy Annotations](https://www.baeldung.com/spring-postconstruct-predestroy) -- [more...](/spring-core-2) +- More articles: [[next -->]](/spring-core-2) From 6809fb56d40b463d0a6084161e740aea4e3cf1dc Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Fri, 20 Sep 2019 16:14:46 +0100 Subject: [PATCH 028/107] [BAEL-17476] - Add README descriptions 9 --- spring-jinq/README.md | 4 ++++ spring-jms/README.md | 4 ++++ spring-jooq/README.md | 4 ++++ spring-kafka/README.md | 8 +++++--- spring-katharsis/README.md | 14 +++++++++----- spring-ldap/README.md | 4 +++- spring-mobile/README.md | 4 ++++ spring-mockito/README.md | 5 ++--- spring-mvc-forms-jsp/README.md | 4 +++- spring-mvc-forms-thymeleaf/README.md | 4 ++++ 10 files changed, 42 insertions(+), 13 deletions(-) diff --git a/spring-jinq/README.md b/spring-jinq/README.md index 10d7903f49..b2fea32123 100644 --- a/spring-jinq/README.md +++ b/spring-jinq/README.md @@ -1,3 +1,7 @@ +## Spring Jinq + +This module contains articles about Spring with Jinq + ## Relevant articles: - [Introduction to Jinq with Spring](http://www.baeldung.com/spring-jinq) diff --git a/spring-jms/README.md b/spring-jms/README.md index 55e74f18ff..ef768d086f 100644 --- a/spring-jms/README.md +++ b/spring-jms/README.md @@ -1,2 +1,6 @@ +## Spring JMS + +This module contains articles about Spring with JMS + ### Relevant Articles: - [Getting Started with Spring JMS](http://www.baeldung.com/spring-jms) diff --git a/spring-jooq/README.md b/spring-jooq/README.md index 2777aa450c..36397fa7ed 100644 --- a/spring-jooq/README.md +++ b/spring-jooq/README.md @@ -1,3 +1,7 @@ +## Spring jOOQ + +This module contains articles about Spring with jOOQ + ### Relevant Articles: - [Spring Boot Support for jOOQ](http://www.baeldung.com/spring-boot-support-for-jooq) - [Introduction to jOOQ with Spring](http://www.baeldung.com/jooq-with-spring) diff --git a/spring-kafka/README.md b/spring-kafka/README.md index 291bbca6f6..c04dda0a2f 100644 --- a/spring-kafka/README.md +++ b/spring-kafka/README.md @@ -1,10 +1,12 @@ +## Spring Kafka + +This module contains articles about Spring with Kafka + ### Relevant articles - [Intro to Apache Kafka with Spring](http://www.baeldung.com/spring-kafka) - - -# Spring Kafka +### Intro This is a simple Spring Boot app to demonstrate sending and receiving of messages in Kafka using spring-kafka. diff --git a/spring-katharsis/README.md b/spring-katharsis/README.md index 2082de2dda..c9391f7e22 100644 --- a/spring-katharsis/README.md +++ b/spring-katharsis/README.md @@ -1,9 +1,13 @@ -========= +## Spring Katharsis -## Java Web Application - -###The Course -The "REST With Spring" Classes: http://bit.ly/restwithspring +This module contains articles about Spring with Katharsis ### Relevant Articles: + - [JSON API in a Spring Application](http://www.baeldung.com/json-api-java-spring-web-app) + +### The Course + +The "REST With Spring" Classes: http://bit.ly/restwithspring + + diff --git a/spring-ldap/README.md b/spring-ldap/README.md index b8163ab44d..3f592ab365 100644 --- a/spring-ldap/README.md +++ b/spring-ldap/README.md @@ -1,4 +1,6 @@ -## Spring LDAP Example Project +## Spring LDAP + +This module contains articles about Spring LDAP ### Relevant articles diff --git a/spring-mobile/README.md b/spring-mobile/README.md index e3d23bcda6..d4473c8c54 100644 --- a/spring-mobile/README.md +++ b/spring-mobile/README.md @@ -1,3 +1,7 @@ +## Spring Mobile + +This module contains articles about Spring Mobile + ## Relevant articles: - [A Guide to Spring Mobile](http://www.baeldung.com/spring-mobile) diff --git a/spring-mockito/README.md b/spring-mockito/README.md index 969954c15e..7d7945a2fe 100644 --- a/spring-mockito/README.md +++ b/spring-mockito/README.md @@ -1,7 +1,6 @@ -========= - -## Mockito Mocks into Spring Beans +## Spring Mockito +This module contains articles about Spring with Mockito ### Relevant Articles: - [Injecting Mockito Mocks into Spring Beans](http://www.baeldung.com/injecting-mocks-in-spring) diff --git a/spring-mvc-forms-jsp/README.md b/spring-mvc-forms-jsp/README.md index 588828c9cf..941191858d 100644 --- a/spring-mvc-forms-jsp/README.md +++ b/spring-mvc-forms-jsp/README.md @@ -1,4 +1,6 @@ -## Spring MVC Forms Tutorials +## Spring MVC Forms JSP + +This module contains articles about Spring MVC Forms using JSP ### Relevant Articles - [MaxUploadSizeExceededException in Spring](http://www.baeldung.com/spring-maxuploadsizeexceeded) diff --git a/spring-mvc-forms-thymeleaf/README.md b/spring-mvc-forms-thymeleaf/README.md index 22f12afbca..7e011bdc60 100644 --- a/spring-mvc-forms-thymeleaf/README.md +++ b/spring-mvc-forms-thymeleaf/README.md @@ -1,3 +1,7 @@ +## Spring MVC Forms Thymeleaf + +This module contains articles about Spring MVC Forms using Thymeleaf + ### Relevant articles - [Session Attributes in Spring MVC](http://www.baeldung.com/spring-mvc-session-attributes) From ae690b025e7a4f2761583ccdde587dc4b21cbb57 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Fri, 20 Sep 2019 16:31:59 +0100 Subject: [PATCH 029/107] [BAEL-17494] - Added readme descriptions 10 --- spring-mvc-java/README.md | 5 ++-- spring-mvc-kotlin/README.md | 4 ++++ spring-mvc-simple-2/README.md | 5 ++++ spring-mvc-simple/README.md | 5 ++++ spring-mvc-velocity/README.md | 4 ++++ spring-mvc-webflow/README.md | 8 +++---- spring-mvc-xml/README.md | 14 ++++++----- spring-protobuf/README.md | 4 ++++ spring-quartz/README.md | 43 +++++++++++++++++----------------- spring-security-cors/README.md | 4 ++++ 10 files changed, 62 insertions(+), 34 deletions(-) diff --git a/spring-mvc-java/README.md b/spring-mvc-java/README.md index e67d4f30a1..e946fab3f2 100644 --- a/spring-mvc-java/README.md +++ b/spring-mvc-java/README.md @@ -1,8 +1,9 @@ -========= +## Spring MVC with Java Configuration -## Spring MVC with Java Configuration Example Project +This module contains articles about Spring MVC with Java configuration ### The Course + The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: diff --git a/spring-mvc-kotlin/README.md b/spring-mvc-kotlin/README.md index cc6827eb1b..bd0593731f 100644 --- a/spring-mvc-kotlin/README.md +++ b/spring-mvc-kotlin/README.md @@ -1,3 +1,7 @@ +## Spring MVC with Kotlin + +This module contains articles about Spring MVC with Kotlin + ### Relevant articles - [Spring MVC Setup with Kotlin](http://www.baeldung.com/spring-mvc-kotlin) - [Working with Kotlin and JPA](http://www.baeldung.com/kotlin-jpa) diff --git a/spring-mvc-simple-2/README.md b/spring-mvc-simple-2/README.md index 6dfe789be4..80456c5732 100644 --- a/spring-mvc-simple-2/README.md +++ b/spring-mvc-simple-2/README.md @@ -1,2 +1,7 @@ +## Spring MVC Simple 2 + +This module contains articles about Spring MVC + ## Relevant articles: - [How to Read HTTP Headers in Spring REST Controllers](https://www.baeldung.com/spring-rest-http-headers) +- More articles: [[<-- prev]](/spring-mvc-simple) diff --git a/spring-mvc-simple/README.md b/spring-mvc-simple/README.md index 755e0932fc..e2068dcae0 100644 --- a/spring-mvc-simple/README.md +++ b/spring-mvc-simple/README.md @@ -1,3 +1,7 @@ +## Spring MVC Simple + +This module contains articles about Spring MVC + ## Relevant articles: - [HandlerAdapters in Spring MVC](http://www.baeldung.com/spring-mvc-handler-adapters) @@ -8,3 +12,4 @@ - [Guide to Spring Email](http://www.baeldung.com/spring-email) - [Request Method Not Supported (405) in Spring](https://www.baeldung.com/spring-request-method-not-supported-405) - [Spring @RequestParam Annotation](https://www.baeldung.com/spring-request-param) +- More articles: [[more -->]](/spring-mvc-simple-2) \ No newline at end of file diff --git a/spring-mvc-velocity/README.md b/spring-mvc-velocity/README.md index 401e135f75..fed4ce260e 100644 --- a/spring-mvc-velocity/README.md +++ b/spring-mvc-velocity/README.md @@ -1,2 +1,6 @@ +## Spring MVC Velocity + +This module contains articles about Spring MVC with Velocity + ### Relevant Articles: - [Quick Guide to Spring MVC with Velocity](http://www.baeldung.com/spring-mvc-with-velocity) diff --git a/spring-mvc-webflow/README.md b/spring-mvc-webflow/README.md index 2df4716e31..dff99ff490 100644 --- a/spring-mvc-webflow/README.md +++ b/spring-mvc-webflow/README.md @@ -1,9 +1,7 @@ -========= +## Spring MVC WebFlow -## Spring MVC with Spring Web Flow - -###The Course +This module contains articles about Spring MVC Web Flow ### Relevant Articles: -- + - [Guide to Spring Web Flow](http://www.baeldung.com/spring-web-flow) diff --git a/spring-mvc-xml/README.md b/spring-mvc-xml/README.md index c8ec074d17..c08cfb1430 100644 --- a/spring-mvc-xml/README.md +++ b/spring-mvc-xml/README.md @@ -1,12 +1,10 @@ -========= +## Spring MVC XML + +This module contains articles about Spring MVC with XML configuration ###The Course The "REST With Spring" Classes: http://bit.ly/restwithspring -## Spring MVC with XML Configuration Example Project -- access a sample jsp page at: `http://localhost:8080/spring-mvc-xml/sample.html` - - ### Relevant Articles: - [Java Session Timeout](http://www.baeldung.com/servlet-session-timeout) - [Returning Image/Media Data with Spring MVC](http://www.baeldung.com/spring-mvc-image-media-data) @@ -15,4 +13,8 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Exploring SpringMVC’s Form Tag Library](http://www.baeldung.com/spring-mvc-form-tags) - [web.xml vs Initializer with Spring](http://www.baeldung.com/spring-xml-vs-java-config) - [A Java Web Application Without a web.xml](https://www.baeldung.com/java-web-app-without-web-xml) -- [Validating RequestParams and PathVariables in Spring](https://www.baeldung.com/spring-validate-requestparam-pathvariable) \ No newline at end of file +- [Validating RequestParams and PathVariables in Spring](https://www.baeldung.com/spring-validate-requestparam-pathvariable) + +## Spring MVC with XML Configuration Example Project +- access a sample jsp page at: `http://localhost:8080/spring-mvc-xml/sample.html` + diff --git a/spring-protobuf/README.md b/spring-protobuf/README.md index dad0e3f54a..d8737014a7 100644 --- a/spring-protobuf/README.md +++ b/spring-protobuf/README.md @@ -1,2 +1,6 @@ +## Spring Protocol Buffers + +This module contains articles about Spring with Protocol Buffers + ### Relevant Articles: - [Spring REST API with Protocol Buffers](http://www.baeldung.com/spring-rest-api-with-protocol-buffers) diff --git a/spring-quartz/README.md b/spring-quartz/README.md index 5d32e65053..45e20f6076 100644 --- a/spring-quartz/README.md +++ b/spring-quartz/README.md @@ -1,26 +1,27 @@ -========================================================================= +## Spring Quartz -## Scheduling in Spring with Quartz Example Project -This is the first example where we configure a basic scheduler. -##### Spring boot application, Main class -### -``` -org.baeldung.springquartz.SpringQuartzApp -``` -###### - -##### Configuration in *application.properties* -#### - - - Default: configures scheduler using Spring convenience classes: - ``` - using.spring.schedulerFactory=true - ``` - - To configure scheduler using Quartz API: - ``` - using.spring.schedulerFactory=false - ``` +This module contains articles about Spring with Quartz ### Relevant Articles: - [Scheduling in Spring with Quartz](http://www.baeldung.com/spring-quartz-schedule) + +## #Scheduling in Spring with Quartz Example Project +This is the first example where we configure a basic scheduler. + +##### Spring boot application, Main class + + +`org.baeldung.springquartz.SpringQuartzApp` + +##### Configuration in *application.properties* + + - Default: configures scheduler using Spring convenience classes: + + `using.spring.schedulerFactory=true` + + - To configure scheduler using Quartz API: + + `using.spring.schedulerFactory=false` + + diff --git a/spring-security-cors/README.md b/spring-security-cors/README.md index 2ab5e33ee3..c9e00e04d7 100644 --- a/spring-security-cors/README.md +++ b/spring-security-cors/README.md @@ -1,3 +1,7 @@ +## Spring Security CORS + +This module contains articles about Spring Security with CORS (Cross Origin Requests) + ## Relevant Articles - [Fixing 401s with CORS Preflights and Spring Security](https://www.baeldung.com/spring-security-cors-preflight) From b0c356b46804714a9ef9e5ef4453abee155660e1 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sat, 21 Sep 2019 09:59:04 -0500 Subject: [PATCH 030/107] BAEL-2338: add link back to article (#7838) * BAEL-2246: add link back to article * BAEL-2174: rename core-java-net module to core-java-networking * BAEL-2174: add link back to article * BAEL-2363 BAEL-2337 BAEL-1996 BAEL-2277 add links back to articles * BAEL-2367: add link back to article * BAEL-2335: add link back to article * BAEL-2413: add link back to article * Update README.MD * BAEL-2577: add link back to article * BAEL-2490: add link back to article * BAEL-2471: add link back to article * BAEL-2583: add link back to article * BAEL-2738: add link back to article * BAEL-2711: Add spring-boot-angular module to root pom * BAEL-2544 BAEL-2711 BAEL-2575 BAEL-2657 Add links back to articles * BAEL-2736: Add link back to article * BAEL-2789: Add link back to article * BAEL-2489: add link back to article * BAEL-2840: add link back to article * BAEL-2655: add link back to article * BAEL-2884: add link back to article * BAEL-2985: Fix Spring Boot Apps in spring-data-rest module * BAEL-2898 BAEL-3057 BAEL-3020 add links back to articles * BAEL-3126 BAEL-2463 README * BAEL-2989: add README * BAEL-3149 BAEL-3043 update README * BAEL-2338: update README * BAEL-3149: move code to new module --- .../core-java-lang-syntax-2/README.md | 6 +++++ .../core-java-lang-syntax-2/pom.xml | 26 +++++++++++++++++++ .../com/baeldung/core/modifiers/Employee.java | 0 .../baeldung/core/modifiers/ExampleClass.java | 0 .../core/modifiers/PublicOuterClass.java | 0 pom.xml | 2 ++ xml/README.md | 1 + 7 files changed, 35 insertions(+) create mode 100644 core-java-modules/core-java-lang-syntax-2/README.md create mode 100644 core-java-modules/core-java-lang-syntax-2/pom.xml rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-syntax-2}/src/main/java/com/baeldung/core/modifiers/Employee.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-syntax-2}/src/main/java/com/baeldung/core/modifiers/ExampleClass.java (100%) rename core-java-modules/{core-java-lang-oop-2 => core-java-lang-syntax-2}/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java (100%) diff --git a/core-java-modules/core-java-lang-syntax-2/README.md b/core-java-modules/core-java-lang-syntax-2/README.md new file mode 100644 index 0000000000..4cef971f75 --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/README.md @@ -0,0 +1,6 @@ +========= + +## Core Java Lang Syntax Cookbooks and Examples + +### Relevant Articles: +- [Java ‘private’ Access Modifier](https://www.baeldung.com/java-private-keyword) diff --git a/core-java-modules/core-java-lang-syntax-2/pom.xml b/core-java-modules/core-java-lang-syntax-2/pom.xml new file mode 100644 index 0000000000..1a8316628f --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + com.baeldung + core-java-lang-syntax-2 + 0.1.0-SNAPSHOT + core-java-lang-syntax-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + core-java-lang-syntax-2 + + + src/main/resources + true + + + + diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/Employee.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/Employee.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/Employee.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/Employee.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java diff --git a/pom.xml b/pom.xml index 1daffc5786..10e9eba400 100644 --- a/pom.xml +++ b/pom.xml @@ -413,6 +413,7 @@ core-java-modules/core-java-nio core-java-modules/core-java-security core-java-modules/core-java-lang-syntax + core-java-modules/core-java-lang-syntax-2 core-java-modules/core-java-lang core-java-modules/core-java-lang-2 core-java-modules/core-java-lang-oop @@ -1151,6 +1152,7 @@ core-java-modules/core-java-nio core-java-modules/core-java-security core-java-modules/core-java-lang-syntax + core-java-modules/core-java-lang-syntax-2 core-java-modules/core-java-lang core-java-modules/core-java-lang-2 core-java-modules/core-java-lang-oop diff --git a/xml/README.md b/xml/README.md index fb070100db..c24fe3e785 100644 --- a/xml/README.md +++ b/xml/README.md @@ -4,3 +4,4 @@ - [XML Libraries Support in Java](http://www.baeldung.com/java-xml-libraries) - [DOM parsing with Xerces](http://www.baeldung.com/java-xerces-dom-parsing) - [Write an org.w3.dom.Document to a File](https://www.baeldung.com/java-write-xml-document-file) +- [Convert XML to HTML in Java](https://www.baeldung.com/java-convert-xml-to-html) From 0cc708c07c0f706ae992ae8229bd5e94c02b0c50 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sat, 21 Sep 2019 21:46:02 -0500 Subject: [PATCH 031/107] BAEL-3149: fix indentation in pom.xml (#7848) * BAEL-2246: add link back to article * BAEL-2174: rename core-java-net module to core-java-networking * BAEL-2174: add link back to article * BAEL-2363 BAEL-2337 BAEL-1996 BAEL-2277 add links back to articles * BAEL-2367: add link back to article * BAEL-2335: add link back to article * BAEL-2413: add link back to article * Update README.MD * BAEL-2577: add link back to article * BAEL-2490: add link back to article * BAEL-2471: add link back to article * BAEL-2583: add link back to article * BAEL-2738: add link back to article * BAEL-2711: Add spring-boot-angular module to root pom * BAEL-2544 BAEL-2711 BAEL-2575 BAEL-2657 Add links back to articles * BAEL-2736: Add link back to article * BAEL-2789: Add link back to article * BAEL-2489: add link back to article * BAEL-2840: add link back to article * BAEL-2655: add link back to article * BAEL-2884: add link back to article * BAEL-2985: Fix Spring Boot Apps in spring-data-rest module * BAEL-2898 BAEL-3057 BAEL-3020 add links back to articles * BAEL-3126 BAEL-2463 README * BAEL-2989: add README * BAEL-3149 BAEL-3043 update README * BAEL-2338: update README * BAEL-3149: move code to new module * BAEL-3149: move code to new module --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 10e9eba400..d44bae0453 100644 --- a/pom.xml +++ b/pom.xml @@ -1152,7 +1152,7 @@ core-java-modules/core-java-nio core-java-modules/core-java-security core-java-modules/core-java-lang-syntax - core-java-modules/core-java-lang-syntax-2 + core-java-modules/core-java-lang-syntax-2 core-java-modules/core-java-lang core-java-modules/core-java-lang-2 core-java-modules/core-java-lang-oop From a47a1a7a1661873f6fdfb749bf47bdf939a4be1e Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Sun, 22 Sep 2019 09:13:12 +0530 Subject: [PATCH 032/107] [BAEL-13506] - Removed .gitignore files (#7849) --- .../src/test/resources/.gitignore | 13 ------------- .../src/test/resources/.gitignore | 13 ------------- .../src/test/resources/.gitignore | 13 ------------- .../src/test/resources/.gitignore | 13 ------------- .../core-java-streams/src/test/resources/.gitignore | 13 ------------- .../core-java-text/src/test/resources/.gitignore | 13 ------------- 6 files changed, 78 deletions(-) delete mode 100644 core-java-modules/core-java-annotations/src/test/resources/.gitignore delete mode 100644 core-java-modules/core-java-datetime/src/test/resources/.gitignore delete mode 100644 core-java-modules/core-java-function/src/test/resources/.gitignore delete mode 100644 core-java-modules/core-java-lang-math/src/test/resources/.gitignore delete mode 100644 core-java-modules/core-java-streams/src/test/resources/.gitignore delete mode 100644 core-java-modules/core-java-text/src/test/resources/.gitignore diff --git a/core-java-modules/core-java-annotations/src/test/resources/.gitignore b/core-java-modules/core-java-annotations/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/core-java-modules/core-java-annotations/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-datetime/src/test/resources/.gitignore b/core-java-modules/core-java-datetime/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/core-java-modules/core-java-datetime/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-function/src/test/resources/.gitignore b/core-java-modules/core-java-function/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/core-java-modules/core-java-function/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-lang-math/src/test/resources/.gitignore b/core-java-modules/core-java-lang-math/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/core-java-modules/core-java-lang-math/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-streams/src/test/resources/.gitignore b/core-java-modules/core-java-streams/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/core-java-modules/core-java-streams/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/core-java-modules/core-java-text/src/test/resources/.gitignore b/core-java-modules/core-java-text/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/core-java-modules/core-java-text/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file From c1a6515fcfd3a9855eeca0e626e3b003842a52b7 Mon Sep 17 00:00:00 2001 From: macroscopic64 Date: Sun, 22 Sep 2019 19:15:26 +0530 Subject: [PATCH 033/107] [BAEL-3288] - Graceful Shutdown of a Spring Boot Application --- .../GracefulShutdownApplication.java | 16 +++++++++ .../beans/LongRunningProcessBean.java | 36 +++++++++++++++++++ .../config/SpringConfiguration.java | 34 ++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java create mode 100644 spring-boot/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java create mode 100644 spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java new file mode 100644 index 0000000000..b7a840b38c --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java @@ -0,0 +1,16 @@ +package com.baeldung.gracefulshutdown; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@EnableAutoConfiguration +@ComponentScan(basePackages = {"com.baeldung.gracefulshutdown"}) +public class GracefulShutdownApplication { + + public static void main(String args[]) { + SpringApplication.run(GracefulShutdownApplication.class, args); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java new file mode 100644 index 0000000000..e21ddfe021 --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java @@ -0,0 +1,36 @@ +package com.baeldung.gracefulshutdown.beans; + +import javax.annotation.PostConstruct; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.task.TaskExecutor; +import org.springframework.stereotype.Component; + +@Component +public class LongRunningProcessBean { + + private static final Logger LOG = LoggerFactory.getLogger(LongRunningProcessBean.class); + + @Autowired + private TaskExecutor taskExecutor; + + @PostConstruct + public void runTaskOnStartup() { + LOG.info("runTaskOnStartup entering"); + for (int i = 0; i < 3; i++) { + final int processNumber = i; + taskExecutor.execute(() -> { + try { + LOG.info("Long running process {} using threadpool started", processNumber); + Thread.sleep(60_000); + LOG.info("Long running process {} using threadpool completed", processNumber); + } catch (Exception e) { + LOG.error("Error while executing task", e); + } + }); + } + LOG.info("runTaskOnStartup exiting"); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java new file mode 100644 index 0000000000..1f27163215 --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java @@ -0,0 +1,34 @@ +package com.baeldung.gracefulshutdown.config; + +import javax.annotation.PreDestroy; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.task.TaskExecutor; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +@Configuration +@EnableScheduling +public class SpringConfiguration { + + private static final Logger LOG = LoggerFactory.getLogger(SpringConfiguration.class); + + @Bean + public TaskExecutor taskExecutor() { + ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); + taskExecutor.setCorePoolSize(2); + taskExecutor.setMaxPoolSize(2); + taskExecutor.setWaitForTasksToCompleteOnShutdown(true); + taskExecutor.setAwaitTerminationSeconds(30); + taskExecutor.initialize(); + return taskExecutor; + } + + @PreDestroy + public void destroy() { + LOG.info("Shutdown initiated"); + } +} From b7368cb6dbca187efaf136137128e11e052d0ef8 Mon Sep 17 00:00:00 2001 From: Anshul Bansal Date: Sun, 22 Sep 2019 22:26:47 +0300 Subject: [PATCH 034/107] BAEL-3191 - review changes --- .../com/baeldung/category/BaeldungCategory.groovy | 4 ++-- .../com/baeldung/category/NumberCategory.groovy | 9 +++++---- .../com/baeldung/category/CategoryUnitTest.groovy | 12 +++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy index 366dd182c8..479c39699f 100644 --- a/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy +++ b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy @@ -10,8 +10,8 @@ class BaeldungCategory { return capitalizedStr } - public static Number square(Number self) { - return self*self; + public static double toThePower(Number self, Number exponent) { + return Math.pow(self, exponent); } } diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy index cf0e5282fc..ccf2ed519b 100644 --- a/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy +++ b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy @@ -4,13 +4,14 @@ import groovy.lang.Category @Category(Number) class NumberCategory { - + public Number cube() { return this*this*this } - - public Number toThePower(Number exponent) { - return Math.pow(this, exponent) + + public int divideWithRoundUp(BigDecimal divisor, boolean isRoundUp) { + def mathRound = isRoundUp ? BigDecimal.ROUND_UP : BigDecimal.ROUND_DOWN + return (int)new BigDecimal(this).divide(divisor, 0, mathRound) } } diff --git a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy index 2e10efbe03..a1f67b1e2e 100644 --- a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy +++ b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy @@ -82,17 +82,19 @@ class CategoryUnitTest extends GroovyTestCase { } } - void test_whenUsingBaeldungCategory_thenSquareNumber() { + void test_whenUsingBaeldungCategory_thenOperationsOnNumber() { use (BaeldungCategory) { - assert 50.square() == 2500 - assert 20.01.square() == 400.4001 + assert 50.toThePower(2) == 2500 + assert 2.4.toThePower(4) == 33.1776 } } - void test_whenUsingNumberUtils_thenCubeNumber() { + void test_whenUsingNumberCategory_thenOperationsOnNumber() { use (NumberCategory) { assert 3.cube() == 27 - assert 2.4.toThePower(4) == 33.1776 + assert 25.divideWithRoundUp(6, true) == 5 + assert 120.23.divideWithRoundUp(6.1, true) == 20 + assert 150.9.divideWithRoundUp(12.1, false) == 12 } } From dac59fbec2360eaf0624aba85e661647cf5c33c5 Mon Sep 17 00:00:00 2001 From: wugangca Date: Sun, 22 Sep 2019 20:23:27 -0600 Subject: [PATCH 035/107] BAEL-2988 Using Enums as Request Parameters in Spring (#7815) * BAEL-2988 Using Enums as Request Parameters in Spring * Remove the unused annotation based on PR feedback * Simplify code based on the PR feedback * Make the methods consistent with the article. --- .../main/java/com/baeldung/Application.java | 2 -- .../java/com/baeldung/config/MvcConfig.java | 7 ++++++ .../converter/StringToEnumConverter.java | 20 +++++++++++++++ .../com/baeldung/cors/EnumController.java | 25 +++++++++++++++++++ .../GlobalControllerExceptionHandler.java | 16 ++++++++++++ .../main/java/com/baeldung/model/Modes.java | 5 ++++ 6 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 spring-rest-simple/src/main/java/com/baeldung/config/converter/StringToEnumConverter.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/exceptions/GlobalControllerExceptionHandler.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/model/Modes.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/Application.java b/spring-rest-simple/src/main/java/com/baeldung/Application.java index dc6bfcb970..f4147568ce 100644 --- a/spring-rest-simple/src/main/java/com/baeldung/Application.java +++ b/spring-rest-simple/src/main/java/com/baeldung/Application.java @@ -4,11 +4,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; -import org.springframework.context.annotation.ComponentScan; @EnableAutoConfiguration @SpringBootApplication -@ComponentScan("com.baeldung.cors") public class Application extends SpringBootServletInitializer { public static void main(final String[] args) { diff --git a/spring-rest-simple/src/main/java/com/baeldung/config/MvcConfig.java b/spring-rest-simple/src/main/java/com/baeldung/config/MvcConfig.java index 48b627a344..246049b722 100644 --- a/spring-rest-simple/src/main/java/com/baeldung/config/MvcConfig.java +++ b/spring-rest-simple/src/main/java/com/baeldung/config/MvcConfig.java @@ -2,6 +2,7 @@ package com.baeldung.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter; @@ -17,6 +18,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import com.baeldung.config.converter.KryoHttpMessageConverter; +import com.baeldung.config.converter.StringToEnumConverter; import java.text.SimpleDateFormat; import java.util.List; @@ -71,4 +73,9 @@ public class MvcConfig implements WebMvcConfigurer { public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**"); } + + @Override + public void addFormatters(FormatterRegistry registry) { + registry.addConverter(new StringToEnumConverter()); + } } diff --git a/spring-rest-simple/src/main/java/com/baeldung/config/converter/StringToEnumConverter.java b/spring-rest-simple/src/main/java/com/baeldung/config/converter/StringToEnumConverter.java new file mode 100644 index 0000000000..349ee5a796 --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/config/converter/StringToEnumConverter.java @@ -0,0 +1,20 @@ +package com.baeldung.config.converter; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; + +import com.baeldung.model.Modes; + +@Component +public class StringToEnumConverter implements Converter { + @Override + public Modes convert(String source) { + // Remove the try-catch block if we want to handle the exception globally in GlobalControllerExceptionHandler + try { + return Modes.valueOf(source.toUpperCase()); + } catch (IllegalArgumentException e) { + return null; + } + + } +} diff --git a/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java b/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java new file mode 100644 index 0000000000..6bd5a16439 --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java @@ -0,0 +1,25 @@ +package com.baeldung.cors; + +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.model.Modes; + +@CrossOrigin(maxAge = 3600) +@RestController +@RequestMapping("/enums") +public class EnumController { + + @RequestMapping("/mode2str") + public String getStringToMode(@RequestParam("mode") Modes mode) { + return "good"; + } + + @RequestMapping("/findbymode/{mode}") + public String findByEnum(@PathVariable Modes mode) { + return "good"; + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/main/java/com/baeldung/exceptions/GlobalControllerExceptionHandler.java b/spring-rest-simple/src/main/java/com/baeldung/exceptions/GlobalControllerExceptionHandler.java new file mode 100644 index 0000000000..78fbcf97dd --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/exceptions/GlobalControllerExceptionHandler.java @@ -0,0 +1,16 @@ +package com.baeldung.exceptions; + +import org.springframework.core.convert.ConversionFailedException; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +@ControllerAdvice +public class GlobalControllerExceptionHandler { + @ExceptionHandler(ConversionFailedException.class) + public ResponseEntity handleConflict(RuntimeException ex) { + // Remove the try-catch block in the StringToEnumConverter if we want to handle the exception here + return new ResponseEntity<>(ex.getMessage(), HttpStatus.BAD_REQUEST); + } +} diff --git a/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java b/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java new file mode 100644 index 0000000000..a82df17d7d --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java @@ -0,0 +1,5 @@ +package com.baeldung.model; + +public enum Modes { + ALPHA, DELTA +} From 6073d2d451d4a3a08b6b9e7e8d25070b3a95521b Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Mon, 23 Sep 2019 16:55:02 +0300 Subject: [PATCH 036/107] Split or move core-java-modules/core-java-concurrency-basic module (#7799) --- .../core-java-concurrency-basic-2/README.md | 10 ++++++ .../core-java-concurrency-basic-2/pom.xml | 33 +++++++++++++++++++ .../com/baeldung/concurrent/delay/Delay.java | 0 .../concurrent/sleepwait/ThreadA.java | 0 .../concurrent/sleepwait/ThreadB.java | 0 .../sleepwait/WaitSleepExample.java | 0 .../BaeldungSynchronizedBlocks.java | 0 .../BaeldungSynchronizedMethods.java | 0 .../threadlifecycle/BlockedState.java | 0 .../concurrent/threadlifecycle/NewState.java | 0 .../threadlifecycle/RunnableState.java | 0 .../threadlifecycle/TerminatedState.java | 0 .../threadlifecycle/TimedWaitingState.java | 0 .../threadlifecycle/WaitingState.java | 0 .../concurrent/waitandnotify/Data.java | 0 .../waitandnotify/NetworkDriver.java | 0 .../concurrent/waitandnotify/Receiver.java | 0 .../concurrent/waitandnotify/Sender.java | 0 .../src/main/resources/logback.xml | 19 +++++++++++ .../BaeldungSychronizedBlockUnitTest.java | 0 .../BaeldungSynchronizeMethodsUnitTest.java | 0 .../waitandnotify/NetworkIntegrationTest.java | 8 ++--- .../core-java-concurrency-basic/README.md | 21 +++++------- .../threadsafety/CounterUnitTest.java} | 10 +++--- .../ExtrinsicLockCounterUnitTest.java} | 10 +++--- .../threadsafety/MathUtilsUnitTest.java} | 9 +++-- .../threadsafety/MessageServiceUnitTest.java} | 10 +++--- .../ReentrantLockCounterUnitTest.java} | 10 +++--- ...eentrantReadWriteLockCounterUnitTest.java} | 14 ++++---- pom.xml | 2 ++ 30 files changed, 114 insertions(+), 42 deletions(-) create mode 100644 core-java-modules/core-java-concurrency-basic-2/README.md create mode 100644 core-java-modules/core-java-concurrency-basic-2/pom.xml rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/delay/Delay.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java (100%) create mode 100644 core-java-modules/core-java-concurrency-basic-2/src/main/resources/logback.xml rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java (100%) rename core-java-modules/{core-java-concurrency-basic => core-java-concurrency-basic-2}/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java (100%) rename core-java-modules/core-java-concurrency-basic/src/test/{com/baeldung/concurrent/threadsafety/tests/CounterTest.java => java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java} (91%) rename core-java-modules/core-java-concurrency-basic/src/test/{com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java => java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java} (91%) rename core-java-modules/core-java-concurrency-basic/src/test/{com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java => java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java} (55%) rename core-java-modules/core-java-concurrency-basic/src/test/{com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java => java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java} (91%) rename core-java-modules/core-java-concurrency-basic/src/test/{com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java => java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java} (91%) rename core-java-modules/core-java-concurrency-basic/src/test/{com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java => java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java} (90%) diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md new file mode 100644 index 0000000000..e72725b7cb --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -0,0 +1,10 @@ +========= + +## Core Java Concurrency Basic 2 Examples + +### Relevant Articles: +- [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) +- [wait and notify() Methods in Java](https://www.baeldung.com/java-wait-notify) +- [Difference Between Wait and Sleep in Java](https://www.baeldung.com/java-wait-and-sleep) +- [Guide to the Synchronized Keyword in Java](https://www.baeldung.com/java-synchronized) +- [Life Cycle of a Thread in Java](https://www.baeldung.com/java-thread-lifecycle) diff --git a/core-java-modules/core-java-concurrency-basic-2/pom.xml b/core-java-modules/core-java-concurrency-basic-2/pom.xml new file mode 100644 index 0000000000..7e0a160456 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.baeldung + core-java-concurrency-basic-2 + 0.1.0-SNAPSHOT + core-java-concurrency-basic-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + + core-java-concurrency-basic-2 + + + src/main/resources + true + + + + + + + + diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/delay/Delay.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/delay/Delay.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/delay/Delay.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/delay/Delay.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/resources/logback.xml b/core-java-modules/core-java-concurrency-basic-2/src/main/resources/logback.xml new file mode 100644 index 0000000000..56af2d397e --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java rename to core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java rename to core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java rename to core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java index e2bc328df3..473fe6ff8e 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java +++ b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java @@ -1,15 +1,15 @@ package com.baeldung.concurrent.waitandnotify; -import static org.junit.Assert.assertEquals; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class NetworkIntegrationTest { diff --git a/core-java-modules/core-java-concurrency-basic/README.md b/core-java-modules/core-java-concurrency-basic/README.md index c498bed315..2f9d014103 100644 --- a/core-java-modules/core-java-concurrency-basic/README.md +++ b/core-java-modules/core-java-concurrency-basic/README.md @@ -3,18 +3,13 @@ ## Core Java Concurrency Basic Examples ### Relevant Articles: -- [Guide To CompletableFuture](http://www.baeldung.com/java-completablefuture) -- [A Guide to the Java ExecutorService](http://www.baeldung.com/java-executor-service-tutorial) -- [Guide to java.util.concurrent.Future](http://www.baeldung.com/java-future) -- [Difference Between Wait and Sleep in Java](http://www.baeldung.com/java-wait-and-sleep) -- [Guide to the Synchronized Keyword in Java](http://www.baeldung.com/java-synchronized) -- [Overview of the java.util.concurrent](http://www.baeldung.com/java-util-concurrent) -- [Implementing a Runnable vs Extending a Thread](http://www.baeldung.com/java-runnable-vs-extending-thread) -- [How to Kill a Java Thread](http://www.baeldung.com/java-thread-stop) -- [ExecutorService – Waiting for Threads to Finish](http://www.baeldung.com/java-executor-wait-for-threads) -- [wait and notify() Methods in Java](http://www.baeldung.com/java-wait-notify) -- [Life Cycle of a Thread in Java](http://www.baeldung.com/java-thread-lifecycle) -- [Runnable vs. Callable in Java](http://www.baeldung.com/java-runnable-callable) +- [Guide To CompletableFuture](https://www.baeldung.com/java-completablefuture) +- [A Guide to the Java ExecutorService](https://www.baeldung.com/java-executor-service-tutorial) +- [Guide to java.util.concurrent.Future](https://www.baeldung.com/java-future) +- [Overview of the java.util.concurrent](https://www.baeldung.com/java-util-concurrent) +- [Implementing a Runnable vs Extending a Thread](https://www.baeldung.com/java-runnable-vs-extending-thread) +- [How to Kill a Java Thread](https://www.baeldung.com/java-thread-stop) +- [ExecutorService – Waiting for Threads to Finish](https://www.baeldung.com/java-executor-wait-for-threads) +- [Runnable vs. Callable in Java](https://www.baeldung.com/java-runnable-callable) - [What is Thread-Safety and How to Achieve it?](https://www.baeldung.com/java-thread-safety) - [How to Start a Thread in Java](https://www.baeldung.com/java-start-thread) -- [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/CounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java similarity index 91% rename from core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/CounterTest.java rename to core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java index 176151083c..6761b05282 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/CounterTest.java +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java @@ -1,14 +1,16 @@ -package com.baeldung.concurrent.threadsafety.tests; +package com.baeldung.concurrent.threadsafety; -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; import com.baeldung.concurrent.threadsafety.callables.CounterCallable; import com.baeldung.concurrent.threadsafety.services.Counter; +import org.junit.Test; + import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -public class CounterTest { +import static org.assertj.core.api.Assertions.assertThat; + +public class CounterUnitTest { @Test public void whenCalledIncrementCounter_thenCorrect() throws Exception { diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java similarity index 91% rename from core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java rename to core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java index e34eb250bf..2dcb846bf4 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java @@ -1,14 +1,16 @@ -package com.baeldung.concurrent.threadsafety.tests; +package com.baeldung.concurrent.threadsafety; -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; import com.baeldung.concurrent.threadsafety.callables.ExtrinsicLockCounterCallable; import com.baeldung.concurrent.threadsafety.services.ExtrinsicLockCounter; +import org.junit.Test; + import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -public class ExtrinsicLockCounterTest { +import static org.assertj.core.api.Assertions.assertThat; + +public class ExtrinsicLockCounterUnitTest { @Test public void whenCalledIncrementCounter_thenCorrect() throws Exception { diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java similarity index 55% rename from core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java rename to core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java index 2708152906..018d4164f0 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java @@ -1,13 +1,16 @@ -package com.baeldung.concurrent.threadsafety.tests; +package com.baeldung.concurrent.threadsafety; import com.baeldung.concurrent.threadsafety.mathutils.MathUtils; import org.junit.Test; + +import java.math.BigInteger; + import static org.assertj.core.api.Assertions.assertThat; -public class MathUtilsTest { +public class MathUtilsUnitTest { @Test public void whenCalledFactorialMethod_thenCorrect() { - assertThat(MathUtils.factorial(2)).isEqualTo(2); + assertThat(MathUtils.factorial(2)).isEqualTo(new BigInteger("2")); } } diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java similarity index 91% rename from core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java rename to core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java index e62206c09a..4df695a537 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java @@ -1,14 +1,16 @@ -package com.baeldung.concurrent.threadsafety.tests; +package com.baeldung.concurrent.threadsafety; -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; import com.baeldung.concurrent.threadsafety.callables.MessageServiceCallable; import com.baeldung.concurrent.threadsafety.services.MessageService; +import org.junit.Test; + import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -public class MessageServiceTest { +import static org.assertj.core.api.Assertions.assertThat; + +public class MessageServiceUnitTest { @Test public void whenCalledgetMessage_thenCorrect() throws Exception { diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java similarity index 91% rename from core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java rename to core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java index 20fa2c74da..330d2d4c86 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java @@ -1,14 +1,16 @@ -package com.baeldung.concurrent.threadsafety.tests; +package com.baeldung.concurrent.threadsafety; import com.baeldung.concurrent.threadsafety.callables.ReentrantLockCounterCallable; import com.baeldung.concurrent.threadsafety.services.ReentrantLockCounter; +import org.junit.Test; + import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; -public class ReentrantLockCounterTest { +import static org.assertj.core.api.Assertions.assertThat; + +public class ReentrantLockCounterUnitTest { @Test public void whenCalledIncrementCounter_thenCorrect() throws Exception { diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java similarity index 90% rename from core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java rename to core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java index 6113473cac..71fad2c87f 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java @@ -1,14 +1,16 @@ -package com.baeldung.concurrent.threadsafety.tests; +package com.baeldung.concurrent.threadsafety; import com.baeldung.concurrent.threadsafety.callables.ReentranReadWriteLockCounterCallable; import com.baeldung.concurrent.threadsafety.services.ReentrantReadWriteLockCounter; +import org.junit.Test; + import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; -public class ReentrantReadWriteLockCounterTest { +import static org.assertj.core.api.Assertions.assertThat; + +public class ReentrantReadWriteLockCounterUnitTest { @Test public void whenCalledIncrementCounter_thenCorrect() throws Exception { @@ -16,9 +18,9 @@ public class ReentrantReadWriteLockCounterTest { ReentrantReadWriteLockCounter counter = new ReentrantReadWriteLockCounter(); Future future1 = (Future) executorService.submit(new ReentranReadWriteLockCounterCallable(counter)); Future future2 = (Future) executorService.submit(new ReentranReadWriteLockCounterCallable(counter)); - - assertThat(future1.get()).isEqualTo(1); + assertThat(future2.get()).isEqualTo(2); + assertThat(future1.get()).isEqualTo(1); } } diff --git a/pom.xml b/pom.xml index d44bae0453..6972736288 100644 --- a/pom.xml +++ b/pom.xml @@ -407,6 +407,7 @@ core-java-modules/core-java-collections-array-list core-java-modules/core-java-collections-set core-java-modules/core-java-concurrency-basic + core-java-modules/core-java-concurrency-basic-2 core-java-modules/core-java-concurrency-collections core-java-modules/core-java-io core-java-modules/core-java-io-files @@ -1146,6 +1147,7 @@ core-java-modules/core-java-collections-array-list core-java-modules/core-java-collections-set core-java-modules/core-java-concurrency-basic + core-java-modules/core-java-concurrency-basic-2 core-java-modules/core-java-concurrency-collections core-java-modules/core-java-io core-java-modules/core-java-io-files From 7da66ebd84bc7575765c3d33b92349a66b9b7200 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Mon, 23 Sep 2019 19:45:10 +0530 Subject: [PATCH 037/107] BAEL-16977 Week 38 | go through the integration test results and see what NEW failing tests we have (#7837) - Minor fixes for integration tests --- spring-jooq/src/test/resources/application.properties | 2 ++ .../baeldung/example/EmployeeDAOIntegrationTest.java | 10 +++++++--- .../com/baeldung/tags/EmployeeDAOIntegrationTest.java | 10 +++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 spring-jooq/src/test/resources/application.properties diff --git a/spring-jooq/src/test/resources/application.properties b/spring-jooq/src/test/resources/application.properties new file mode 100644 index 0000000000..dc5d81acfb --- /dev/null +++ b/spring-jooq/src/test/resources/application.properties @@ -0,0 +1,2 @@ +spring.datasource.url=jdbc:h2:tcp:~/jooq;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE +spring.jpa.hibernate.ddl-auto=update diff --git a/testing-modules/junit-5-basics/src/test/java/com/baeldung/example/EmployeeDAOIntegrationTest.java b/testing-modules/junit-5-basics/src/test/java/com/baeldung/example/EmployeeDAOIntegrationTest.java index d3b6a52726..2595f2b13c 100644 --- a/testing-modules/junit-5-basics/src/test/java/com/baeldung/example/EmployeeDAOIntegrationTest.java +++ b/testing-modules/junit-5-basics/src/test/java/com/baeldung/example/EmployeeDAOIntegrationTest.java @@ -1,18 +1,22 @@ package com.baeldung.example; -import com.baeldung.junit.tags.example.Employee; -import com.baeldung.junit.tags.example.EmployeeDAO; -import com.baeldung.junit.tags.example.SpringJdbcConfig; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.junit.tags.example.Employee; +import com.baeldung.junit.tags.example.EmployeeDAO; +import com.baeldung.junit.tags.example.SpringJdbcConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { SpringJdbcConfig.class }, loader = AnnotationConfigContextLoader.class) +@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD) public class EmployeeDAOIntegrationTest { @Autowired diff --git a/testing-modules/junit-5-basics/src/test/java/com/baeldung/tags/EmployeeDAOIntegrationTest.java b/testing-modules/junit-5-basics/src/test/java/com/baeldung/tags/EmployeeDAOIntegrationTest.java index bcd76cb4c2..7f0720b96d 100644 --- a/testing-modules/junit-5-basics/src/test/java/com/baeldung/tags/EmployeeDAOIntegrationTest.java +++ b/testing-modules/junit-5-basics/src/test/java/com/baeldung/tags/EmployeeDAOIntegrationTest.java @@ -1,8 +1,5 @@ package com.baeldung.tags; -import com.baeldung.junit.tags.example.Employee; -import com.baeldung.junit.tags.example.EmployeeDAO; -import com.baeldung.junit.tags.example.SpringJdbcConfig; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Tag; @@ -13,12 +10,19 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.junit.tags.example.Employee; +import com.baeldung.junit.tags.example.EmployeeDAO; +import com.baeldung.junit.tags.example.SpringJdbcConfig; + @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = { SpringJdbcConfig.class }, loader = AnnotationConfigContextLoader.class) +@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD) public class EmployeeDAOIntegrationTest { @Autowired From 933b41c8b5162ee1aad719d710e24d6b8394420c Mon Sep 17 00:00:00 2001 From: Amy DeGregorio Date: Mon, 23 Sep 2019 15:41:37 -0400 Subject: [PATCH 038/107] Bael 3329 - Updates to Spring Boot Admin (#7856) * BAEL-3222 Example Code and update to spring-boot-admin examples * BAEL-3329 Fix integration tests * BAEL-3329 Fix integration tests --- ...AdminClientApplicationIntegrationTest.java | 14 +++++----- .../spring-boot-admin-server/pom.xml | 10 ++++--- .../configs/NotifierConfiguration.java | 26 ++++++++++++------- .../configs/WebSecurityConfig.java | 2 ++ .../src/main/resources/application.properties | 14 +++++----- .../NotifierConfigurationIntegrationTest.java | 16 ++++++------ .../WebSecurityConfigIntegrationTest.java | 9 ++++--- 7 files changed, 52 insertions(+), 39 deletions(-) diff --git a/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java b/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java index 0201deabca..f9e969c06a 100644 --- a/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java +++ b/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java @@ -15,7 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.unauthenticated; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @@ -36,20 +36,20 @@ public class SpringBootAdminClientApplicationIntegrationTest { @Test public void whenEnvironmentAvailable_ThenAdminServerPropertiesExist() { - assertEquals(environment.getProperty("spring.boot.admin.url"), "http://localhost:8080"); - assertEquals(environment.getProperty("spring.boot.admin.username"), "admin"); - assertEquals(environment.getProperty("spring.boot.admin.password"), "admin"); + assertEquals(environment.getProperty("spring.boot.admin.client.url"), "http://localhost:8080"); + assertEquals(environment.getProperty("spring.boot.admin.client.username"), "admin"); + assertEquals(environment.getProperty("spring.boot.admin.client.password"), "admin"); } @Test public void whenHttpBasicAttempted_ThenSuccess() throws Exception { - mockMvc.perform(get("/env").with(httpBasic("client", "client"))); + mockMvc.perform(get("/actuator/env").with(httpBasic("client", "client"))); } @Test public void whenInvalidHttpBasicAttempted_ThenUnauthorized() throws Exception { mockMvc - .perform(get("/env").with(httpBasic("client", "invalid"))) - .andExpect(status().isUnauthorized()); + .perform(get("/actuator/env").with(httpBasic("client", "invalid"))) + .andExpect(unauthenticated()); } } diff --git a/spring-boot-admin/spring-boot-admin-server/pom.xml b/spring-boot-admin/spring-boot-admin-server/pom.xml index 142cf420f4..5ef99976c8 100644 --- a/spring-boot-admin/spring-boot-admin-server/pom.xml +++ b/spring-boot-admin/spring-boot-admin-server/pom.xml @@ -51,10 +51,12 @@ ${spring-boot-admin-starter-client.version} - - - - + + + org.springframework.boot + spring-boot-starter-mail + + org.springframework.boot spring-boot-starter-test diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java b/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java index d43f4b430a..f9abee11b7 100644 --- a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java +++ b/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java @@ -1,32 +1,40 @@ package com.baeldung.springbootadminserver.configs; import java.time.Duration; +import java.util.Collections; +import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.ObjectProvider; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.notify.CompositeNotifier; import de.codecentric.boot.admin.server.notify.LoggingNotifier; +import de.codecentric.boot.admin.server.notify.Notifier; import de.codecentric.boot.admin.server.notify.RemindingNotifier; import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier; @Configuration public class NotifierConfiguration { - @Autowired - private InstanceRepository repository; + private final InstanceRepository repository; + private final ObjectProvider> otherNotifiers; - // @Autowired private Notifier notifier; - - @Bean - public LoggingNotifier notifier() { - return new LoggingNotifier(repository); + public NotifierConfiguration(InstanceRepository repository, ObjectProvider> otherNotifiers) { + this.repository = repository; + this.otherNotifiers = otherNotifiers; } @Bean public FilteringNotifier filteringNotifier() { - return new FilteringNotifier(notifier(), repository); + CompositeNotifier delegate = new CompositeNotifier(this.otherNotifiers.getIfAvailable(Collections::emptyList)); + return new FilteringNotifier(delegate, this.repository); + } + + @Bean + public LoggingNotifier notifier() { + return new LoggingNotifier(repository); } @Primary diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java b/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java index ee37d2f0b3..1943c61ff4 100644 --- a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java +++ b/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java @@ -5,6 +5,7 @@ import java.util.UUID; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.security.web.csrf.CookieCsrfTokenRepository; @@ -13,6 +14,7 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import de.codecentric.boot.admin.server.config.AdminServerProperties; @Configuration +@EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { private final AdminServerProperties adminServer; diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties b/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties index ba7a7de2a0..273c11468c 100644 --- a/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties +++ b/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties @@ -16,14 +16,14 @@ management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always #mail notifications -#spring.mail.host=smtp.gmail.com -#spring.mail.username=test@gmail.com -#spring.mail.password=password -#spring.mail.port=587 -#spring.mail.properties.mail.smtp.auth=true -#spring.mail.properties.mail.smtp.starttls.enable=true +spring.mail.host= +spring.mail.username= +spring.mail.password= +spring.mail.port= +spring.mail.properties.mail.smtp.auth= +spring.mail.properties.mail.smtp.starttls.enable= -#spring.boot.admin.notify.mail.to=test@gmail.com +spring.boot.admin.notify.mail.to= #hipchat notifications #spring.boot.admin.notify.hipchat.auth-token= diff --git a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java b/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java index fc8acc4e4d..eca83b6f6c 100644 --- a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java +++ b/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java @@ -1,10 +1,7 @@ package com.baeldung.springbootadminserver; -import com.baeldung.springbootadminserver.configs.NotifierConfiguration; - -import de.codecentric.boot.admin.server.notify.Notifier; -import de.codecentric.boot.admin.server.notify.RemindingNotifier; -import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier; +import static org.junit.Assert.assertNotEquals; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,11 +10,14 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.ApplicationContext; import org.springframework.test.context.junit4.SpringRunner; -import static org.junit.Assert.assertNotEquals; -import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE; +import com.baeldung.springbootadminserver.configs.NotifierConfiguration; + +import de.codecentric.boot.admin.server.notify.Notifier; +import de.codecentric.boot.admin.server.notify.RemindingNotifier; +import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier; @RunWith(SpringRunner.class) -@SpringBootTest(classes = { NotifierConfiguration.class }, webEnvironment = NONE) +@SpringBootTest(classes = { NotifierConfiguration.class, SpringBootAdminServerApplication.class }, webEnvironment = NONE) public class NotifierConfigurationIntegrationTest { @Autowired private ApplicationContext applicationContext; diff --git a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java b/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java index 0c0695e6c2..e5018f5f5f 100644 --- a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java +++ b/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java @@ -14,6 +14,7 @@ import static org.springframework.security.test.web.servlet.request.SecurityMock import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.unauthenticated; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @@ -51,21 +52,21 @@ public class WebSecurityConfigIntegrationTest { .password("admin")); mockMvc - .perform(get("/api/applications/")) + .perform(get("/applications/")) .andExpect(status().is2xxSuccessful()); } @Test public void whenHttpBasicAttempted_ThenSuccess() throws Exception { - mockMvc.perform(get("/env").with(httpBasic("admin", "admin"))); + mockMvc.perform(get("/actuator/env").with(httpBasic("admin", "admin"))); } @Test public void whenInvalidHttpBasicAttempted_ThenUnauthorized() throws Exception { mockMvc - .perform(get("/env").with(httpBasic("admin", "invalid"))) - .andExpect(status().isUnauthorized()); + .perform(get("/actuator/env").with(httpBasic("admin", "invalid"))) + .andExpect(unauthenticated()); } } From ee9f90ab2f07c2f5094b309f9aaa54f35f17b6f0 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Tue, 24 Sep 2019 14:12:44 +0100 Subject: [PATCH 039/107] [BAEL-17477] Add links between reactive & reactive-2 (#7839) --- spring-5-reactive-2/README.md | 1 + spring-5-reactive/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-5-reactive-2/README.md b/spring-5-reactive-2/README.md index a8204932f7..1d21425fb8 100644 --- a/spring-5-reactive-2/README.md +++ b/spring-5-reactive-2/README.md @@ -3,3 +3,4 @@ This module contains articles about reactive Spring 5 - [Spring WebClient vs. RestTemplate](https://www.baeldung.com/spring-webclient-resttemplate) +- More articles: [[<-- prev]](/spring-5-reactive) diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index b782f817ad..89ff4fea9f 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -22,4 +22,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Testing Reactive Streams Using StepVerifier and TestPublisher](https://www.baeldung.com/reactive-streams-step-verifier-test-publisher) - [Debugging Reactive Streams in Spring 5](https://www.baeldung.com/spring-debugging-reactive-streams) - [Static Content in Spring WebFlux](https://www.baeldung.com/spring-webflux-static-content) -- [more...](/spring-5-reactive-2) +- More articles: [[next -->]](/spring-5-reactive-2) \ No newline at end of file From f4b4a9eea5a508d9b31e62f21b11a6d32aa8e2e8 Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Tue, 24 Sep 2019 16:18:08 +0300 Subject: [PATCH 040/107] Split or move java-collections-maps module (#7802) --- java-collections-maps-2/README.md | 8 ++++++ java-collections-maps-2/pom.xml | 19 ++++++++++++++ .../baeldung/map}/convert/MapToString.java | 2 +- .../baeldung/map}/convert/StringToMap.java | 2 +- .../map/{ => copyhashmap}/CopyHashMap.java | 6 ++--- .../map/initialize/MapInitializer.java | 2 +- .../baeldung/map/iteration/MapIteration.java | 0 .../java/com/baeldung/map/mapmax}/MapMax.java | 8 ++---- .../com/baeldung/map/mergemaps}/Employee.java | 2 +- .../baeldung/map/mergemaps}/MergeMaps.java | 4 +-- .../map/{ => primitives}/PrimitiveMaps.java | 2 +- .../com/baeldung/map}/sort/SortHashMap.java | 4 +-- .../map}/convert/MapToStringUnitTest.java | 2 +- .../map}/convert/StringToMapUnitTest.java | 2 +- .../CopyHashMapUnitTest.java | 9 +++---- .../map/{ => copyhashmap}/Employee.java | 2 +- .../initialize/MapInitializerUnitTest.java | 6 ++--- .../baeldung/map/mapmax}/MapMaxUnitTest.java | 9 +++---- .../TreeMapVsHashMapUnitTest.java | 14 +++++------ .../map}/weakhashmap/WeakHashMapUnitTest.java | 2 +- java-collections-maps/README.md | 18 ++++--------- java-collections-maps/pom.xml | 6 ----- .../com/baeldung/{java => }/map/MapUtil.java | 4 +-- .../com/baeldung/{java => }/map/MyKey.java | 2 +- .../{java => }/map/MyLinkedHashMap.java | 2 +- .../{java => }/map/ImmutableMapUnitTest.java | 11 +++----- .../{java => }/map/KeyCheckUnitTest.java | 8 +++--- .../map/MapMultipleValuesUnitTest.java | 21 ++++++---------- .../baeldung/{java => }/map/MapUnitTest.java | 2 +- .../{java => }/map/MapUtilUnitTest.java | 13 +++++----- .../map/MultiValuedMapUnitTest.java | 24 +++++++++--------- .../compare/HashMapComparisonUnitTest.java | 25 ++++++++----------- 32 files changed, 116 insertions(+), 125 deletions(-) rename {java-collections-maps/src/main/java/com/baeldung => java-collections-maps-2/src/main/java/com/baeldung/map}/convert/MapToString.java (96%) rename {java-collections-maps/src/main/java/com/baeldung => java-collections-maps-2/src/main/java/com/baeldung/map}/convert/StringToMap.java (94%) rename java-collections-maps-2/src/main/java/com/baeldung/map/{ => copyhashmap}/CopyHashMap.java (98%) rename {java-collections-maps/src/main/java/com/baeldung/java => java-collections-maps-2/src/main/java/com/baeldung}/map/initialize/MapInitializer.java (98%) rename {java-collections-maps => java-collections-maps-2}/src/main/java/com/baeldung/map/iteration/MapIteration.java (100%) rename {java-collections-maps/src/main/java/com/baeldung/map/util => java-collections-maps-2/src/main/java/com/baeldung/map/mapmax}/MapMax.java (94%) rename {java-collections-maps/src/main/java/com/baeldung/sort => java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps}/Employee.java (97%) rename {java-collections-maps/src/main/java/com/baeldung/map/java_8 => java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps}/MergeMaps.java (97%) rename java-collections-maps-2/src/main/java/com/baeldung/map/{ => primitives}/PrimitiveMaps.java (98%) rename {java-collections-maps/src/main/java/com/baeldung => java-collections-maps-2/src/main/java/com/baeldung/map}/sort/SortHashMap.java (97%) rename {java-collections-maps/src/test/java/com/baeldung => java-collections-maps-2/src/test/java/com/baeldung/map}/convert/MapToStringUnitTest.java (97%) rename {java-collections-maps/src/test/java/com/baeldung => java-collections-maps-2/src/test/java/com/baeldung/map}/convert/StringToMapUnitTest.java (95%) rename java-collections-maps-2/src/test/java/com/baeldung/map/{ => copyhashmap}/CopyHashMapUnitTest.java (98%) rename java-collections-maps-2/src/test/java/com/baeldung/map/{ => copyhashmap}/Employee.java (91%) rename {java-collections-maps/src/test/java/com/baeldung/java => java-collections-maps-2/src/test/java/com/baeldung}/map/initialize/MapInitializerUnitTest.java (94%) rename {java-collections-maps/src/test/java/com/baeldung/map/util => java-collections-maps-2/src/test/java/com/baeldung/map/mapmax}/MapMaxUnitTest.java (97%) rename java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java => java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java (91%) rename {java-collections-maps/src/test/java/com/baeldung => java-collections-maps-2/src/test/java/com/baeldung/map}/weakhashmap/WeakHashMapUnitTest.java (98%) rename java-collections-maps/src/main/java/com/baeldung/{java => }/map/MapUtil.java (96%) rename java-collections-maps/src/main/java/com/baeldung/{java => }/map/MyKey.java (97%) rename java-collections-maps/src/main/java/com/baeldung/{java => }/map/MyLinkedHashMap.java (94%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/ImmutableMapUnitTest.java (92%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/KeyCheckUnitTest.java (78%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/MapMultipleValuesUnitTest.java (96%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/MapUnitTest.java (99%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/MapUtilUnitTest.java (99%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/MultiValuedMapUnitTest.java (99%) rename java-collections-maps/src/test/java/com/baeldung/{java => }/map/compare/HashMapComparisonUnitTest.java (97%) diff --git a/java-collections-maps-2/README.md b/java-collections-maps-2/README.md index ff84e93ce4..7aef942ff0 100644 --- a/java-collections-maps-2/README.md +++ b/java-collections-maps-2/README.md @@ -1,3 +1,11 @@ ## Relevant Articles: - [Map of Primitives in Java](https://www.baeldung.com/java-map-primitives) - [Copying a HashMap in Java](https://www.baeldung.com/java-copy-hashmap) +- [Guide to WeakHashMap in Java](https://www.baeldung.com/java-weakhashmap) +- [Map to String Conversion in Java](https://www.baeldung.com/java-map-to-string-conversion) +- [Iterate over a Map in Java](https://www.baeldung.com/java-iterate-map) +- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps) +- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) +- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) +- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Java TreeMap vs HashMap](https://www.baeldung.com/java-treemap-vs-hashmap) diff --git a/java-collections-maps-2/pom.xml b/java-collections-maps-2/pom.xml index e242a8655e..a246559f61 100644 --- a/java-collections-maps-2/pom.xml +++ b/java-collections-maps-2/pom.xml @@ -41,6 +41,22 @@ commons-lang3 ${commons-lang3.version} + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + one.util + streamex + ${streamex.version} + + + com.jayway.awaitility + awaitility + ${avaitility.version} + test + org.assertj assertj-core @@ -50,6 +66,9 @@ + 0.6.5 + 4.1 + 1.7.0 8.2.0 3.0.2 8.1.0 diff --git a/java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java similarity index 96% rename from java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java index aca0d05ef1..d13be924ff 100644 --- a/java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import com.google.common.base.Joiner; import org.apache.commons.lang3.StringUtils; diff --git a/java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java similarity index 94% rename from java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java index caabca4a09..416ba4dd9a 100644 --- a/java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import com.google.common.base.Splitter; diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java similarity index 98% rename from java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java index 2ebc9413c8..cb18f3aa11 100644 --- a/java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java @@ -1,4 +1,6 @@ -package com.baeldung.map; +package com.baeldung.map.copyhashmap; + +import org.apache.commons.lang3.SerializationUtils; import java.util.HashMap; import java.util.Map; @@ -6,8 +8,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.stream.Collectors; -import org.apache.commons.lang3.SerializationUtils; - public class CopyHashMap { public static HashMap copyUsingConstructor(HashMap originalMap) { diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java b/java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java similarity index 98% rename from java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java index 4dbaceac62..4d63abcfd0 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map.initialize; +package com.baeldung.map.initialize; import java.util.AbstractMap; import java.util.Collections; diff --git a/java-collections-maps/src/main/java/com/baeldung/map/iteration/MapIteration.java b/java-collections-maps-2/src/main/java/com/baeldung/map/iteration/MapIteration.java similarity index 100% rename from java-collections-maps/src/main/java/com/baeldung/map/iteration/MapIteration.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/iteration/MapIteration.java diff --git a/java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java similarity index 94% rename from java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java index 93a98ba6fd..8c33c857ee 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java @@ -1,11 +1,7 @@ -package com.baeldung.map.util; +package com.baeldung.map.mapmax; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Optional; public class MapMax { diff --git a/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/sort/Employee.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java index b5e56f6141..d7fb0d1a1d 100644 --- a/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java @@ -1,4 +1,4 @@ -package com.baeldung.sort; +package com.baeldung.map.mergemaps; public class Employee implements Comparable { diff --git a/java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java index 052cfb8bad..4f187bad90 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java @@ -1,7 +1,7 @@ -package com.baeldung.map.java_8; +package com.baeldung.map.mergemaps; -import com.baeldung.sort.Employee; import one.util.streamex.EntryStream; + import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java b/java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java similarity index 98% rename from java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java index d835950c68..30bec12ccc 100644 --- a/java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java @@ -1,4 +1,4 @@ -package com.baeldung.map; +package com.baeldung.map.primitives; import cern.colt.map.AbstractIntDoubleMap; import cern.colt.map.OpenIntDoubleHashMap; diff --git a/java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java index b8a2b32060..14610ffb00 100644 --- a/java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java @@ -1,8 +1,8 @@ -package com.baeldung.sort; +package com.baeldung.map.sort; +import com.baeldung.map.mergemaps.Employee; import com.google.common.base.Functions; import com.google.common.collect.ImmutableSortedMap; -import com.google.common.collect.Lists; import com.google.common.collect.Ordering; import java.util.*; diff --git a/java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java index d9923e74a0..4517dea328 100644 --- a/java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import org.apache.commons.collections4.MapUtils; import org.junit.Assert; diff --git a/java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java similarity index 95% rename from java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java index 8fb906efd0..2f80b30871 100644 --- a/java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import org.junit.Assert; import org.junit.jupiter.api.Test; diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java similarity index 98% rename from java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java index c400eea153..e2d5e327e1 100644 --- a/java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java @@ -1,13 +1,12 @@ -package com.baeldung.map; +package com.baeldung.map.copyhashmap; -import static org.assertj.core.api.Assertions.assertThat; +import com.google.common.collect.ImmutableMap; +import org.junit.Test; import java.util.HashMap; import java.util.Map; -import org.junit.Test; - -import com.google.common.collect.ImmutableMap; +import static org.assertj.core.api.Assertions.assertThat; public class CopyHashMapUnitTest { diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java similarity index 91% rename from java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java index 7963fa811c..5db55c26ea 100644 --- a/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java @@ -1,4 +1,4 @@ -package com.baeldung.map; +package com.baeldung.map.copyhashmap; import java.io.Serializable; diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java similarity index 94% rename from java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java index 80a8983d6f..7c6dffe787 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java @@ -1,10 +1,10 @@ -package com.baeldung.java.map.initialize; +package com.baeldung.map.initialize; -import static org.junit.Assert.assertEquals; +import org.junit.Test; import java.util.Map; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class MapInitializerUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java index 883265cc8b..30b945bfc8 100644 --- a/java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java @@ -1,14 +1,13 @@ -package com.baeldung.map.util; +package com.baeldung.map.mapmax; - -import static org.junit.Assert.assertEquals; +import org.junit.Before; +import org.junit.Test; import java.util.HashMap; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class MapMaxUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java b/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java similarity index 91% rename from java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java index f2dfc992c2..1057e3b9f0 100644 --- a/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java @@ -1,16 +1,14 @@ -package com.baeldung.collection; - -import java.util.ConcurrentModificationException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; +package com.baeldung.map.treemaphashmap; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; -public class WhenComparingTreeMapVsHashMap { +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +public class TreeMapVsHashMapUnitTest { @Test public void whenInsertObjectsTreeMap_thenNaturalOrder() { diff --git a/java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java similarity index 98% rename from java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java index d7bcb31867..293f24c378 100644 --- a/java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.weakhashmap; +package com.baeldung.map.weakhashmap; import org.junit.Test; diff --git a/java-collections-maps/README.md b/java-collections-maps/README.md index 2eeb2c8843..3a6ad1d10c 100644 --- a/java-collections-maps/README.md +++ b/java-collections-maps/README.md @@ -3,21 +3,13 @@ ## Java Collections Cookbooks and Examples ### Relevant Articles: -- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap) -- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap) -- [The Java HashMap Under the Hood](http://www.baeldung.com/java-hashmap) -- [A Guide to LinkedHashMap in Java](http://www.baeldung.com/java-linked-hashmap) -- [A Guide to TreeMap in Java](http://www.baeldung.com/java-treemap) -- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) -- [Java TreeMap vs HashMap](http://www.baeldung.com/java-treemap-vs-hashmap) -- [How to Store Duplicate Keys in a Map in Java?](http://www.baeldung.com/java-map-duplicate-keys) -- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Guide to the Guava BiMap](https://www.baeldung.com/guava-bimap) +- [The Java HashMap Under the Hood](https://www.baeldung.com/java-hashmap) +- [A Guide to LinkedHashMap in Java](https://www.baeldung.com/java-linked-hashmap) +- [A Guide to TreeMap in Java](https://www.baeldung.com/java-treemap) +- [How to Store Duplicate Keys in a Map in Java?](https://www.baeldung.com/java-map-duplicate-keys) - [Get the Key for a Value from a Java Map](https://www.baeldung.com/java-map-key-from-value) -- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) -- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) -- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps) - [How to Check If a Key Exists in a Map](https://www.baeldung.com/java-map-key-exists) - [Comparing Two HashMaps in Java](https://www.baeldung.com/java-compare-hashmaps) - [Immutable Map Implementations in Java](https://www.baeldung.com/java-immutable-maps) -- [Map to String Conversion in Java](https://www.baeldung.com/java-map-to-string-conversion) - [Guide to Apache Commons MultiValuedMap](https://www.baeldung.com/apache-commons-multi-valued-map) diff --git a/java-collections-maps/pom.xml b/java-collections-maps/pom.xml index 83cc97a21e..b755582580 100644 --- a/java-collections-maps/pom.xml +++ b/java-collections-maps/pom.xml @@ -36,11 +36,6 @@ ${assertj.version} test - - one.util - streamex - ${streamex.version} - @@ -49,6 +44,5 @@ 1.7.0 3.6.1 7.1.0 - 0.6.5 diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java b/java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java similarity index 96% rename from java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java rename to java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java index 688c7592f3..91b7197a92 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java +++ b/java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java @@ -1,12 +1,12 @@ /** * */ -package com.baeldung.java.map; +package com.baeldung.map; import java.util.HashSet; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import java.util.stream.Stream; /** diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java b/java-collections-maps/src/main/java/com/baeldung/map/MyKey.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java rename to java-collections-maps/src/main/java/com/baeldung/map/MyKey.java index ae3c3edc39..9993d7862c 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java +++ b/java-collections-maps/src/main/java/com/baeldung/map/MyKey.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map; +package com.baeldung.map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java b/java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java similarity index 94% rename from java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java rename to java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java index 1e237580ec..b687e57d85 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java +++ b/java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map; +package com.baeldung.map; import java.util.LinkedHashMap; import java.util.Map; diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java similarity index 92% rename from java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java index b239ae07d8..d308aac7eb 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java @@ -1,16 +1,13 @@ -package com.baeldung.java.map; +package com.baeldung.map; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import com.google.common.collect.ImmutableMap; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.jupiter.api.Test; - -import com.google.common.collect.ImmutableMap; +import static org.junit.jupiter.api.Assertions.*; public class ImmutableMapUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java similarity index 78% rename from java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java index 2c97a97690..dbad2e5b5e 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java @@ -1,13 +1,11 @@ -package com.baeldung.java.map; +package com.baeldung.map; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.util.Collections; import java.util.Map; -import org.junit.Test; +import static org.junit.Assert.*; public class KeyCheckUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java similarity index 96% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java index 3a0affa6f3..721b48ea7b 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java @@ -1,13 +1,9 @@ -package com.baeldung.java.map; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +package com.baeldung.map; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.TreeMultimap; import org.apache.commons.collections4.MultiMap; import org.apache.commons.collections4.MultiMapUtils; import org.apache.commons.collections4.MultiValuedMap; @@ -18,10 +14,9 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.Multimap; -import com.google.common.collect.TreeMultimap; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; public class MapMultipleValuesUnitTest { private static final Logger LOG = LoggerFactory.getLogger(MapMultipleValuesUnitTest.class); diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java similarity index 99% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java index 7582eb87fb..eaf68ccba5 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map; +package com.baeldung.map; import org.junit.Test; import org.slf4j.Logger; diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java similarity index 99% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java index e31385e972..f8e4c8fd8a 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java @@ -1,9 +1,12 @@ /** * */ -package com.baeldung.java.map; +package com.baeldung.map; -import static org.junit.Assert.assertEquals; +import com.google.common.collect.HashBiMap; +import org.apache.commons.collections4.BidiMap; +import org.apache.commons.collections4.bidimap.DualHashBidiMap; +import org.junit.Test; import java.util.Arrays; import java.util.HashMap; @@ -11,11 +14,7 @@ import java.util.HashSet; import java.util.Map; import java.util.stream.Collectors; -import org.apache.commons.collections4.BidiMap; -import org.apache.commons.collections4.bidimap.DualHashBidiMap; -import org.junit.Test; - -import com.google.common.collect.HashBiMap; +import static org.junit.Assert.assertEquals; /** * @author swpraman diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java similarity index 99% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java index b3aaf8925f..686c1cef87 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java @@ -1,15 +1,4 @@ -package com.baeldung.java.map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; +package com.baeldung.map; import org.apache.commons.collections4.MultiMapUtils; import org.apache.commons.collections4.MultiSet; @@ -18,6 +7,17 @@ import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; import org.apache.commons.collections4.multimap.HashSetValuedHashMap; import org.junit.Test; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + public class MultiValuedMapUnitTest { @Test diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java index e8aa12d4bd..0edd0cd87b 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java @@ -1,24 +1,21 @@ -package com.baeldung.java.map.compare; +package com.baeldung.map.compare; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.collection.IsMapContaining.hasEntry; -import static org.hamcrest.collection.IsMapContaining.hasKey; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import com.google.common.base.Equivalence; +import com.google.common.collect.MapDifference; +import com.google.common.collect.MapDifference.ValueDifference; +import com.google.common.collect.Maps; +import org.junit.Before; +import org.junit.Test; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; - -import com.google.common.base.Equivalence; -import com.google.common.collect.MapDifference; -import com.google.common.collect.MapDifference.ValueDifference; -import com.google.common.collect.Maps; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.collection.IsMapContaining.hasEntry; +import static org.hamcrest.collection.IsMapContaining.hasKey; +import static org.junit.Assert.*; public class HashMapComparisonUnitTest { From f822c1032baf2fa9cf8a36d604338f8bd2e492a6 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Tue, 24 Sep 2019 14:27:23 +0100 Subject: [PATCH 041/107] [BAEL-17699 (#7860) --- .../src/main/resources/factorybean-abstract-spring-ctx.xml | 0 .../src/main/resources/factorybean-spring-ctx.xml | 0 .../src/test/resources/beanfactory-example.xml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {spring-core => spring-core-2}/src/main/resources/factorybean-abstract-spring-ctx.xml (100%) rename {spring-core => spring-core-2}/src/main/resources/factorybean-spring-ctx.xml (100%) rename {spring-core => spring-core-2}/src/test/resources/beanfactory-example.xml (100%) diff --git a/spring-core/src/main/resources/factorybean-abstract-spring-ctx.xml b/spring-core-2/src/main/resources/factorybean-abstract-spring-ctx.xml similarity index 100% rename from spring-core/src/main/resources/factorybean-abstract-spring-ctx.xml rename to spring-core-2/src/main/resources/factorybean-abstract-spring-ctx.xml diff --git a/spring-core/src/main/resources/factorybean-spring-ctx.xml b/spring-core-2/src/main/resources/factorybean-spring-ctx.xml similarity index 100% rename from spring-core/src/main/resources/factorybean-spring-ctx.xml rename to spring-core-2/src/main/resources/factorybean-spring-ctx.xml diff --git a/spring-core/src/test/resources/beanfactory-example.xml b/spring-core-2/src/test/resources/beanfactory-example.xml similarity index 100% rename from spring-core/src/test/resources/beanfactory-example.xml rename to spring-core-2/src/test/resources/beanfactory-example.xml From 2757d0a3ad27e9e8348077029945b283b4e51e61 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Tue, 24 Sep 2019 14:28:05 +0100 Subject: [PATCH 042/107] [BAEL-17697] - Fixed integration tests (#7859) --- spring-di/src/main/java/com/baeldung/sample/AppConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-di/src/main/java/com/baeldung/sample/AppConfig.java b/spring-di/src/main/java/com/baeldung/sample/AppConfig.java index c948011c69..d13023d89e 100644 --- a/spring-di/src/main/java/com/baeldung/sample/AppConfig.java +++ b/spring-di/src/main/java/com/baeldung/sample/AppConfig.java @@ -4,7 +4,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration -@ComponentScan("org.baeldung.sample") +@ComponentScan("com.baeldung.sample") public class AppConfig { } From 0a67756dee186b703bf96df3a3d211375f626dfa Mon Sep 17 00:00:00 2001 From: Dilip Date: Tue, 24 Sep 2019 15:56:43 -0500 Subject: [PATCH 043/107] Spring WebClient Mocking Code Repo (#7525) * adding complete code implementation of Hexagonal Architectute example * refactored the code * added the webclient mocking * removed the unwanted repo * updated the test cases * removed commented code * fixed the code review comments * fixed the test cases * removed unwanted dependencies * removed the unwanted project * fixed the code review comments * added the mock to the variable name * added the mock to the variable name * addressed the code review comments * removed the unnecessary semi colon * fixed the compilation issues * Update spring-5-reactive-client/pom.xml Co-Authored-By: KevinGilmore * Update spring-5-reactive-client/pom.xml Co-Authored-By: KevinGilmore * added the missing dependency * fixed the compilation issue in the pom.xml file --- spring-5-reactive-client/pom.xml | 50 +++++++- .../com/baeldung/reactive/enums/Role.java | 5 + .../com/baeldung/reactive/model/Employee.java | 64 +++++++++ .../reactive/service/EmployeeService.java | 55 ++++++++ .../EmployeeServiceIntegrationTest.java | 121 ++++++++++++++++++ .../service/EmployeeServiceUnitTest.java | 114 +++++++++++++++++ 6 files changed, 407 insertions(+), 2 deletions(-) create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java create mode 100644 spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java create mode 100644 spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index 70771f6832..9e574b2196 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -54,6 +54,18 @@ org.apache.commons commons-lang3 + + + com.squareup.okhttp3 + okhttp + 4.0.1 + + + com.squareup.okhttp3 + mockwebserver + 4.0.1 + test + @@ -88,14 +100,25 @@ org.projectlombok lombok - - + + org.mockito + mockito-junit-jupiter + 2.23.0 + test + + + io.projectreactor + reactor-test + 3.2.10.RELEASE + test + org.eclipse.jetty jetty-reactive-httpclient ${jetty-reactive-httpclient.version} test + @@ -108,6 +131,29 @@ JAR + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + maven-surefire-plugin + 2.22.0 + + + maven-surefire-plugin + 2.19.1 + + + org.junit.platform + junit-platform-surefire-provider + 1.0.1 + + + diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java new file mode 100644 index 0000000000..6b11f14734 --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/enums/Role.java @@ -0,0 +1,5 @@ +package com.baeldung.reactive.enums; + +public enum Role { + ENGINEER, SENIOR_ENGINEER, LEAD_ENGINEER +} diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java new file mode 100644 index 0000000000..6a8daaf6de --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/model/Employee.java @@ -0,0 +1,64 @@ +package com.baeldung.reactive.model; + + +import com.baeldung.reactive.enums.Role; + +public class Employee { + private Integer employeeId; + private String firstName; + private String lastName; + private Integer age; + private Role role; + + public Employee() { + } + + public Employee(Integer employeeId, String firstName, String lastName, Integer age, Role role) { + this.employeeId = employeeId; + this.firstName = firstName; + this.lastName = lastName; + this.age = age; + this.role = role; + } + + public Integer getEmployeeId() { + return employeeId; + } + + public void setEmployeeId(Integer employeeId) { + this.employeeId = employeeId; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Role getRole() { + return role; + } + + public void setRole(Role role) { + this.role = role; + } +} + diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java new file mode 100644 index 0000000000..b841dbfe3f --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/service/EmployeeService.java @@ -0,0 +1,55 @@ +package com.baeldung.reactive.service; +import com.baeldung.reactive.model.Employee; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; + +public class EmployeeService { + + private WebClient webClient; + public static String PATH_PARAM_BY_ID = "/employee/{id}"; + public static String ADD_EMPLOYEE = "/employee"; + + public EmployeeService(WebClient webClient) { + this.webClient = webClient; + } + + public EmployeeService(String baseUrl) { + this.webClient = WebClient.create(baseUrl); + } + + public Mono getEmployeeById(Integer employeeId) { + return webClient + .get() + .uri(PATH_PARAM_BY_ID, employeeId) + .retrieve() + .bodyToMono(Employee.class); + } + + public Mono addNewEmployee(Employee newEmployee) { + + return webClient + .post() + .uri(ADD_EMPLOYEE) + .syncBody(newEmployee) + .retrieve(). + bodyToMono(Employee.class); + } + + public Mono updateEmployee(Integer employeeId, Employee updateEmployee) { + + return webClient + .put() + .uri(PATH_PARAM_BY_ID,employeeId) + .syncBody(updateEmployee) + .retrieve() + .bodyToMono(Employee.class); + } + + public Mono deleteEmployeeById(Integer employeeId) { + return webClient + .delete() + .uri(PATH_PARAM_BY_ID,employeeId) + .retrieve() + .bodyToMono(String.class); + } +} diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java new file mode 100644 index 0000000000..f5d9529ada --- /dev/null +++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceIntegrationTest.java @@ -0,0 +1,121 @@ +package com.baeldung.reactive.service; + +import com.baeldung.reactive.model.Employee; +import com.baeldung.reactive.enums.Role; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.Rule; +import org.junit.jupiter.api.*; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.*; + +class EmployeeServiceIntegrationTest { + + public static MockWebServer mockBackEnd; + private EmployeeService employeeService; + private ObjectMapper MAPPER = new ObjectMapper(); + + @BeforeAll + static void setUp() throws IOException { + mockBackEnd = new MockWebServer(); + mockBackEnd.start(); + } + + @AfterAll + static void tearDown() throws IOException { + mockBackEnd.shutdown(); + } + + @BeforeEach + void initialize() { + + String baseUrl = String.format("http://localhost:%s", mockBackEnd.getPort()); + employeeService = new EmployeeService(baseUrl); + } + + @Test + void getEmployeeById() throws Exception { + + Employee mockEmployee = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER); + mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(mockEmployee)) + .addHeader("Content-Type", "application/json")); + + Mono employeeMono = employeeService.getEmployeeById(100); + + StepVerifier.create(employeeMono) + .expectNextMatches(employee -> employee.getRole().equals(Role.LEAD_ENGINEER)) + .verifyComplete(); + + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals("GET", recordedRequest.getMethod()); + assertEquals("/employee/100", recordedRequest.getPath()); + } + + @Test + void addNewEmployee() throws Exception { + + Employee newEmployee = new Employee(null, "Adam", "Sandler", 32, Role.LEAD_ENGINEER); + Employee webClientResponse = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER); + mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(webClientResponse)) + .addHeader("Content-Type", "application/json")); + + Mono employeeMono = employeeService.addNewEmployee(newEmployee); + + StepVerifier.create(employeeMono) + .expectNextMatches(employee -> employee.getEmployeeId().equals(100)) + .verifyComplete(); + + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals("POST", recordedRequest.getMethod()); + assertEquals("/employee", recordedRequest.getPath()); + } + + @Test + void updateEmployee() throws Exception { + + Integer newAge = 33; + String newLastName = "Sandler New"; + Employee updateEmployee = new Employee(100, "Adam", newLastName, newAge, Role.LEAD_ENGINEER); + mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(updateEmployee)) + .addHeader("Content-Type", "application/json")); + + Mono updatedEmploye = employeeService.updateEmployee(100, updateEmployee); + + StepVerifier.create(updatedEmploye) + .expectNextMatches(employee -> employee.getLastName().equals(newLastName) && employee.getAge() == newAge) + .verifyComplete(); + + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals("PUT", recordedRequest.getMethod()); + assertEquals("/employee/100", recordedRequest.getPath()); + + } + + + @Test + void deleteEmployee() throws Exception { + + String responseMessage = "Employee Deleted SuccessFully"; + Integer employeeId = 100; + mockBackEnd.enqueue(new MockResponse().setBody(MAPPER.writeValueAsString(responseMessage)) + .addHeader("Content-Type", "application/json")); + + Mono deletedEmployee = employeeService.deleteEmployeeById(employeeId); + + StepVerifier.create(deletedEmployee) + .expectNext("\"Employee Deleted SuccessFully\"") + .verifyComplete(); + + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals("DELETE", recordedRequest.getMethod()); + assertEquals("/employee/100", recordedRequest.getPath()); + } + +} \ No newline at end of file diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java new file mode 100644 index 0000000000..1d1a8fd2e4 --- /dev/null +++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/service/EmployeeServiceUnitTest.java @@ -0,0 +1,114 @@ +package com.baeldung.reactive.service; + + +import com.baeldung.reactive.model.Employee; +import com.baeldung.reactive.enums.Role; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.exceptions.base.MockitoException; +import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class EmployeeServiceUnitTest { + + EmployeeService employeeService; + @Mock + private WebClient webClientMock; + @Mock + private WebClient.RequestHeadersSpec requestHeadersMock; + @Mock + private WebClient.RequestHeadersUriSpec requestHeadersUriMock; + @Mock + private WebClient.RequestBodySpec requestBodyMock; + @Mock + private WebClient.RequestBodyUriSpec requestBodyUriMock; + @Mock + private WebClient.ResponseSpec responseMock; + + @BeforeEach + void setUp() { + employeeService = new EmployeeService(webClientMock); + } + + @Test + void givenEmployeeId_whenGetEmployeeById_thenReturnEmployee() { + + Integer employeeId = 100; + Employee mockEmployee = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER); + when(webClientMock.get()).thenReturn(requestHeadersUriMock); + when(requestHeadersUriMock.uri("/employee/{id}", employeeId)).thenReturn(requestHeadersMock); + when(requestHeadersMock.retrieve()).thenReturn(responseMock); + when(responseMock.bodyToMono(Employee.class)).thenReturn(Mono.just(mockEmployee)); + + Mono employeeMono = employeeService.getEmployeeById(employeeId); + + StepVerifier.create(employeeMono) + .expectNextMatches(employee -> employee.getRole().equals(Role.LEAD_ENGINEER)) + .verifyComplete(); + } + + @Test + void givenEmployee_whenAddEmployee_thenAddNewEmployee() { + + Employee newEmployee = new Employee(null, "Adam", "Sandler", 32, Role.LEAD_ENGINEER); + Employee webClientResponse = new Employee(100, "Adam", "Sandler", 32, Role.LEAD_ENGINEER); + when(webClientMock.post()).thenReturn(requestBodyUriMock); + when(requestBodyUriMock.uri(EmployeeService.ADD_EMPLOYEE)).thenReturn(requestBodyMock); + when(requestBodyMock.syncBody(newEmployee)).thenReturn(requestHeadersMock); + when(requestHeadersMock.retrieve()).thenReturn(responseMock); + when(responseMock.bodyToMono(Employee.class)).thenReturn(Mono.just(webClientResponse)); + + Mono employeeMono = employeeService.addNewEmployee(newEmployee); + + StepVerifier.create(employeeMono) + .expectNextMatches(employee -> employee.getEmployeeId().equals(100)) + .verifyComplete(); + } + + @Test + void givenEmployee_whenupdateEmployee_thenUpdatedEmployee() { + + Integer newAge = 33; + String newLastName = "Sandler New"; + Employee updateEmployee = new Employee(100, "Adam", newLastName, newAge, Role.LEAD_ENGINEER); + when(webClientMock.put()).thenReturn(requestBodyUriMock); + when(requestBodyUriMock.uri(EmployeeService.PATH_PARAM_BY_ID, 100)).thenReturn(requestBodyMock); + when(requestBodyMock.syncBody(updateEmployee)).thenReturn(requestHeadersMock); + when(requestHeadersMock.retrieve()).thenReturn(responseMock); + when(responseMock.bodyToMono(Employee.class)).thenReturn(Mono.just(updateEmployee)); + + Mono updatedEmployee = employeeService.updateEmployee(100, updateEmployee); + + StepVerifier.create(updatedEmployee) + .expectNextMatches(employee -> employee.getLastName().equals(newLastName) && employee.getAge() == newAge) + .verifyComplete(); + + } + + @Test + void givenEmployee_whenDeleteEmployeeById_thenDeleteSuccessful() { + + String responseMessage = "Employee Deleted SuccessFully"; + when(webClientMock.delete()).thenReturn(requestHeadersUriMock); + when(requestHeadersUriMock.uri(EmployeeService.PATH_PARAM_BY_ID, 100)).thenReturn(requestHeadersMock); + when(requestHeadersMock.retrieve()).thenReturn(responseMock); + when(responseMock.bodyToMono(String.class)).thenReturn(Mono.just(responseMessage)); + + Mono deletedEmployee = employeeService.deleteEmployeeById(100); + + StepVerifier.create(deletedEmployee) + .expectNext(responseMessage) + .verifyComplete(); + } +} \ No newline at end of file From 6f9c3399864afa1e5faeb29f2ed8508f24ff5b0f Mon Sep 17 00:00:00 2001 From: Alfred Samanga Date: Wed, 25 Sep 2019 08:13:00 +0200 Subject: [PATCH 044/107] BAEL-3321 Flogger Fluent Logging (#7872) * Added Flogger maven dependency * Implemented Flogger logging examples * Finished implementing Flogger logging examples * Changed Flogger Test to Integration tests * Adding examples on optimisation * Added support for Slf4j and Log4j backends * Added support for Slf4j and Log4j backends, uncommended dependencies in pom, removed log4j config file --- logging-modules/flogger/pom.xml | 39 +++++++++++++++++++ .../flogger/FloggerIntegrationTest.java | 23 +++++++++++ 2 files changed, 62 insertions(+) diff --git a/logging-modules/flogger/pom.xml b/logging-modules/flogger/pom.xml index 2b96332bf6..0bba719616 100644 --- a/logging-modules/flogger/pom.xml +++ b/logging-modules/flogger/pom.xml @@ -17,11 +17,50 @@ flogger 0.4 + com.google.flogger flogger-system-backend 0.4 runtime + + + com.google.flogger + flogger-slf4j-backend + 0.4 + + + + com.google.flogger + flogger-log4j-backend + 0.4 + + + com.sun.jmx + jmxri + + + com.sun.jdmk + jmxtools + + + javax.jms + jms + + + + + + log4j + log4j + 1.2.17 + + + log4j + apache-log4j-extras + 1.2.17 + + \ No newline at end of file diff --git a/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java b/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java index 69460dc045..80fa0edd96 100644 --- a/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java +++ b/logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerIntegrationTest.java @@ -12,6 +12,10 @@ import java.util.stream.IntStream; import static com.google.common.flogger.LazyArgs.lazy; public class FloggerIntegrationTest { + static { +// System.setProperty("flogger.backend_factory", "com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"); + System.setProperty("flogger.backend_factory", "com.google.common.flogger.backend.slf4j.Slf4jBackendFactory#getInstance"); + } private static final FluentLogger logger = FluentLogger.forEnclosingClass(); @Test @@ -28,6 +32,16 @@ public class FloggerIntegrationTest { }); } + @Test + public void givenAnObject_shouldLogTheObject() { + User user = new User(); + logger.atInfo().log("The user is: %s", user); //correct + + //The following ways of logging are not recommended + logger.atInfo().log("The user is: %s", user.toString()); + logger.atInfo().log("The user is: %s" + user); + } + @Test public void givenASimpleOperation_shouldLogTheResult() { int result = 45 / 3; @@ -70,4 +84,13 @@ public class FloggerIntegrationTest { int s = 30; return String.format("%d seconds elapsed so far. %d items pending processing", s, items); } + + private class User { + String name = "Test"; + + @Override + public String toString() { + return name; + } + } } From af75e04e5085a5e9a3ad4ede025275ebec43c750 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 25 Sep 2019 18:55:50 +0530 Subject: [PATCH 045/107] BAEL-9496 Fix failing context tests (#7855) * BAEL-9496 Fix failing context tests - Fixes for SpringContextIntegrationTest in several projects * BAEL-9496 Fix failing context tests -Fixed ContextTests for spring-jms and further fixes spring-session-mongodb * BAEL-9496 Fix failing context tests -Fixed context tests from spring-rest-angular project --- .../baeldung/SpringContextIntegrationTest.java | 17 ----------------- .../org/baeldung/SpringContextLiveTest.java | 9 +++++++++ .../gateway/SpringContextLiveTest.java | 9 +++++++++ .../SpringContextIntegrationTest.java | 15 --------------- .../vaultsample/SpringContextLiveTest.java | 9 +++++++++ .../src/test/resources/application.properties | 2 ++ .../baeldung/SpringContextIntegrationTest.java | 2 +- .../java/org/baeldung/SpringContextTest.java | 2 +- .../baeldung/web/main/PersistenceConfig.java | 2 +- .../src/main/resources/application.properties | 3 ++- .../src/main/resources/{db/sql => }/data.sql | 7 ------- .../baeldung/SpringContextIntegrationTest.java | 4 +++- .../java/com/baeldung/SpringContextTest.java | 9 +++++---- spring-session/spring-session-mongodb/pom.xml | 6 ++++++ .../baeldung/SpringContextIntegrationTest.java | 2 +- ...textLiveTest.java => SpringContextTest.java} | 4 ++-- .../src/test/resources/application.properties | 2 ++ .../baeldung/SpringContextIntegrationTest.java | 17 ----------------- .../org/baeldung/SpringContextLiveTest.java | 4 ++++ .../baeldung/SpringContextIntegrationTest.java | 16 ---------------- .../org/baeldung/SpringContextLiveTest.java | 9 +++++++++ .../src/test/resources/application.properties | 1 + .../src/main/resources/application.yml | 2 +- .../baeldung/SpringContextIntegrationTest.java | 16 ---------------- .../org/baeldung/SpringContextLiveTest.java | 9 +++++++++ 25 files changed, 77 insertions(+), 101 deletions(-) delete mode 100644 spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextIntegrationTest.java create mode 100644 spring-jenkins-pipeline/src/test/resources/application.properties rename spring-rest-angular/src/main/resources/{db/sql => }/data.sql (92%) rename spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextIntegrationTest.java => spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java (64%) rename spring-session/spring-session-mongodb/src/test/java/org/baeldung/{SpringContextLiveTest.java => SpringContextTest.java} (71%) create mode 100644 spring-session/spring-session-mongodb/src/test/resources/application.properties delete mode 100644 spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-vault/src/test/java/org/baeldung/SpringContextIntegrationTest.java create mode 100644 spring-vault/src/test/resources/application.properties delete mode 100644 spring-webflux-amqp/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 28dbc9a8d8..0000000000 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung; - -import org.baeldung.spring.cloud.DataFlowShellApplication; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = DataFlowShellApplication.class) -public class SpringContextIntegrationTest { - - @Test - public void contextLoads() { - } - -} diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextLiveTest.java index 5be4f9c077..1784eb772a 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextLiveTest.java +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/src/test/java/org/baeldung/SpringContextLiveTest.java @@ -6,6 +6,15 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +/** + * This live test requires: + * complete data-flow server and shell setup running + * + *
+ * For more info: + * https://www.baeldung.com/spring-cloud-data-flow-stream-processing + * + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = DataFlowShellApplication.class) public class SpringContextLiveTest { diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextLiveTest.java b/spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextLiveTest.java index a3cbb3310d..a5c6ab612a 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextLiveTest.java +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextLiveTest.java @@ -5,6 +5,15 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +/** + * This live test requires: + * Eureka server and Gateway application up and running + * + *
+ * For more info: + * https://www.baeldung.com/spring-cloud-netflix-eureka + * https://www.baeldung.com/spring-cloud-gateway-pattern + */ @RunWith(SpringRunner.class) @SpringBootTest public class SpringContextLiveTest { diff --git a/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextIntegrationTest.java b/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextIntegrationTest.java deleted file mode 100644 index e1eb2f8e24..0000000000 --- a/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextIntegrationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.baeldung.spring.cloud.vaultsample; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = VaultSampleApplication.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} \ No newline at end of file diff --git a/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextLiveTest.java b/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextLiveTest.java index 3be4d96964..82fe3d7a4a 100644 --- a/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextLiveTest.java +++ b/spring-cloud/spring-cloud-vault/src/test/java/org/baeldung/spring/cloud/vaultsample/SpringContextLiveTest.java @@ -5,6 +5,15 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +/** + * This live test requires: + * vault server up and running on the environment + * + *
+ * For more info on setting up the vault server: + * https://www.baeldung.com/vault + * + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = VaultSampleApplication.class) public class SpringContextLiveTest { diff --git a/spring-jenkins-pipeline/src/test/resources/application.properties b/spring-jenkins-pipeline/src/test/resources/application.properties new file mode 100644 index 0000000000..4ee830556a --- /dev/null +++ b/spring-jenkins-pipeline/src/test/resources/application.properties @@ -0,0 +1,2 @@ +#To use a randomly allocated free port during tests to avoid port conflict across tests +spring.data.mongodb.port=0 diff --git a/spring-jms/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-jms/src/test/java/org/baeldung/SpringContextIntegrationTest.java index e13809f571..483ffec208 100644 --- a/spring-jms/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-jms/src/test/java/org/baeldung/SpringContextIntegrationTest.java @@ -6,7 +6,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = {"classpath:applicationContext.xml", "classpath:EmbeddedActiveMQ.xml"}) +@ContextConfiguration(locations = { "classpath:applicationContext.xml" }) public class SpringContextIntegrationTest { @Test diff --git a/spring-jms/src/test/java/org/baeldung/SpringContextTest.java b/spring-jms/src/test/java/org/baeldung/SpringContextTest.java index e89faeebb7..11c9d9bca6 100644 --- a/spring-jms/src/test/java/org/baeldung/SpringContextTest.java +++ b/spring-jms/src/test/java/org/baeldung/SpringContextTest.java @@ -6,7 +6,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = {"classpath:applicationContext.xml", "classpath:EmbeddedActiveMQ.xml"}) +@ContextConfiguration(locations = { "classpath:applicationContext.xml" }) public class SpringContextTest { @Test diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java b/spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java index e0f6002733..0fc6b74892 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java +++ b/spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java @@ -26,7 +26,7 @@ public class PersistenceConfig { @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(); - EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript("db/sql/data.sql").build(); + EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).build(); return db; } diff --git a/spring-rest-angular/src/main/resources/application.properties b/spring-rest-angular/src/main/resources/application.properties index 2571d286a3..cfa27938c9 100644 --- a/spring-rest-angular/src/main/resources/application.properties +++ b/spring-rest-angular/src/main/resources/application.properties @@ -1,4 +1,5 @@ server.servlet.contextPath=/ spring.h2.console.enabled=true logging.level.org.hibernate.SQL=info -spring.jpa.hibernate.ddl-auto=none \ No newline at end of file +spring.jpa.generate-ddl=true +spring.jpa.hibernate.ddl-auto=create \ No newline at end of file diff --git a/spring-rest-angular/src/main/resources/db/sql/data.sql b/spring-rest-angular/src/main/resources/data.sql similarity index 92% rename from spring-rest-angular/src/main/resources/db/sql/data.sql rename to spring-rest-angular/src/main/resources/data.sql index 418381a681..71e54b29ce 100644 --- a/spring-rest-angular/src/main/resources/db/sql/data.sql +++ b/spring-rest-angular/src/main/resources/data.sql @@ -1,10 +1,3 @@ -CREATE TABLE student ( - id INTEGER PRIMARY KEY, - name VARCHAR(30), - gender VARCHAR(10), - age INTEGER -); - INSERT INTO student (id,name,gender,age) VALUES (1,'Bryan', 'Male',20); INSERT INTO student (id,name,gender,age) diff --git a/spring-security-mvc/src/test/java/com/baeldung/SpringContextIntegrationTest.java b/spring-security-mvc/src/test/java/com/baeldung/SpringContextIntegrationTest.java index 8e53a6371a..ac9da5ca60 100644 --- a/spring-security-mvc/src/test/java/com/baeldung/SpringContextIntegrationTest.java +++ b/spring-security-mvc/src/test/java/com/baeldung/SpringContextIntegrationTest.java @@ -5,8 +5,10 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import com.baeldung.session.SpringSessionApplication; + @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = SpringSessionApplication.class) public class SpringContextIntegrationTest { @Test diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextIntegrationTest.java b/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java similarity index 64% rename from spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextIntegrationTest.java rename to spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java index dc635cd003..f1c3801c8a 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/test/java/com/baeldung/spring/cloud/bootstrap/gateway/SpringContextIntegrationTest.java +++ b/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java @@ -1,16 +1,17 @@ -package com.baeldung.spring.cloud.bootstrap.gateway; +package com.baeldung; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import com.baeldung.session.SpringSessionApplication; + @RunWith(SpringRunner.class) -@SpringBootTest -public class SpringContextIntegrationTest { +@SpringBootTest(classes = SpringSessionApplication.class) +public class SpringContextTest { @Test public void whenSpringContextIsBootstrapped_thenNoExceptions() { } - } diff --git a/spring-session/spring-session-mongodb/pom.xml b/spring-session/spring-session-mongodb/pom.xml index dc055ff32d..b9e06615de 100644 --- a/spring-session/spring-session-mongodb/pom.xml +++ b/spring-session/spring-session-mongodb/pom.xml @@ -40,6 +40,12 @@ spring-boot-starter-test test + + + de.flapdoodle.embed + de.flapdoodle.embed.mongo + test + diff --git a/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java index 16b7404f57..1acc6a5cb1 100644 --- a/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java @@ -7,7 +7,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringSessionMongoDBApplication.class) +@SpringBootTest(classes = SpringSessionMongoDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class SpringContextIntegrationTest { @Test diff --git a/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextTest.java similarity index 71% rename from spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextLiveTest.java rename to spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextTest.java index b41f2b0338..cc935b8cfb 100644 --- a/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextLiveTest.java +++ b/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextTest.java @@ -7,8 +7,8 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringSessionMongoDBApplication.class) -public class SpringContextLiveTest { +@SpringBootTest(classes = SpringSessionMongoDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class SpringContextTest { @Test public void whenSpringContextIsBootstrapped_thenNoExceptions() { diff --git a/spring-session/spring-session-mongodb/src/test/resources/application.properties b/spring-session/spring-session-mongodb/src/test/resources/application.properties new file mode 100644 index 0000000000..4ee830556a --- /dev/null +++ b/spring-session/spring-session-mongodb/src/test/resources/application.properties @@ -0,0 +1,2 @@ +#To use a randomly allocated free port during tests to avoid port conflict across tests +spring.data.mongodb.port=0 diff --git a/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index a62e728826..0000000000 --- a/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.spring.session.SessionWebApplication; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = SessionWebApplication.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java index b23ce7dbbb..3a4f14e9e6 100644 --- a/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java +++ b/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java @@ -7,6 +7,10 @@ import org.springframework.test.context.junit4.SpringRunner; import com.baeldung.spring.session.SessionWebApplication; +/** + * This live test requires: + * redis instance running on the environment + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = SessionWebApplication.class) public class SpringContextLiveTest { diff --git a/spring-vault/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-vault/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index a2d727ea79..0000000000 --- a/spring-vault/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.springvault.SpringVaultApplication; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringVaultApplication.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-vault/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-vault/src/test/java/org/baeldung/SpringContextLiveTest.java index 1b3db59ecb..60dc119f13 100644 --- a/spring-vault/src/test/java/org/baeldung/SpringContextLiveTest.java +++ b/spring-vault/src/test/java/org/baeldung/SpringContextLiveTest.java @@ -6,6 +6,15 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +/** + * This live test requires: + * vault server up and running on the environment + * + *
+ * For more info on setting up the vault server: + * https://www.baeldung.com/vault + * + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = SpringVaultApplication.class) public class SpringContextLiveTest { diff --git a/spring-vault/src/test/resources/application.properties b/spring-vault/src/test/resources/application.properties new file mode 100644 index 0000000000..709574239b --- /dev/null +++ b/spring-vault/src/test/resources/application.properties @@ -0,0 +1 @@ +spring.main.allow-bean-definition-overriding=true \ No newline at end of file diff --git a/spring-webflux-amqp/src/main/resources/application.yml b/spring-webflux-amqp/src/main/resources/application.yml index 3f527ce4c5..702aaba357 100755 --- a/spring-webflux-amqp/src/main/resources/application.yml +++ b/spring-webflux-amqp/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: rabbitmq: - host: 192.168.99.100 + host: localhost port: 5672 username: guest password: guest diff --git a/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 35efff49c2..0000000000 --- a/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.spring.amqp.SpringWebfluxAmqpApplication; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringWebfluxAmqpApplication.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextLiveTest.java index effe8d2cfa..4d9f658cdc 100644 --- a/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextLiveTest.java +++ b/spring-webflux-amqp/src/test/java/org/baeldung/SpringContextLiveTest.java @@ -6,6 +6,15 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +/** + * This live test requires: + * rabbitmq instance running on the environment + * + *
+ * To run rabbitmq using docker image: + * (e.g. `docker run -d --name rabbitmq -p 5672:5672 rabbitmq:3`) + * + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = SpringWebfluxAmqpApplication.class) public class SpringContextLiveTest { From 9f18b6bcbe175f898295360d8a01ea51f9b46733 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Wed, 25 Sep 2019 14:28:28 +0100 Subject: [PATCH 046/107] [BAEL-17495] - Add README descriptions 11 (#7861) * [BAEL-17495] - Add README descriptions 11 * Changed wording for the REST modules --- spring-reactive-kotlin/README.md | 4 ++++ spring-reactor/README.md | 4 ++++ spring-remoting/README.md | 4 +++- spring-rest-angular/README.md | 4 +++- spring-rest-compress/README.md | 7 ++++--- spring-rest-full/README.md | 5 +++-- spring-rest-hal-browser/README.md | 4 ++++ spring-rest-query-language/README.md | 9 +++------ spring-rest-shell/README.md | 4 +++- spring-rest/README.md | 4 +++- 10 files changed, 34 insertions(+), 15 deletions(-) diff --git a/spring-reactive-kotlin/README.md b/spring-reactive-kotlin/README.md index cf5debc617..46f4b580fd 100644 --- a/spring-reactive-kotlin/README.md +++ b/spring-reactive-kotlin/README.md @@ -1,2 +1,6 @@ +## Spring Reactive Kotlin + +This module contains articles about reactive Kotlin + ### Relevant Articles: - [Spring Webflux with Kotlin](http://www.baeldung.com/spring-webflux-kotlin) diff --git a/spring-reactor/README.md b/spring-reactor/README.md index 0da2d6be51..e7d7eb927d 100644 --- a/spring-reactor/README.md +++ b/spring-reactor/README.md @@ -1,3 +1,7 @@ +## Spring Reactor + +This module contains articles about Spring Reactor + ## Relevant articles: - [Introduction to Spring Reactor](http://www.baeldung.com/spring-reactor) diff --git a/spring-remoting/README.md b/spring-remoting/README.md index 0898b9b002..247aa52db2 100644 --- a/spring-remoting/README.md +++ b/spring-remoting/README.md @@ -1,4 +1,6 @@ -## Spring Remoting Tutorials +## Spring Remoting + +This module contains articles about Spring Remoting ### Relevant Articles - [Intro to Spring Remoting with HTTP Invokers](http://www.baeldung.com/spring-remoting-http-invoker) diff --git a/spring-rest-angular/README.md b/spring-rest-angular/README.md index d2c2879649..5cd2570152 100644 --- a/spring-rest-angular/README.md +++ b/spring-rest-angular/README.md @@ -1,4 +1,6 @@ -## Spring REST Angular Example Project +## Spring REST Angular + +This module contains articles about REST APIs with Spring and Angular ### Relevant Articles: diff --git a/spring-rest-compress/README.md b/spring-rest-compress/README.md index 238c28e4b5..ce627d8595 100644 --- a/spring-rest-compress/README.md +++ b/spring-rest-compress/README.md @@ -1,5 +1,6 @@ -========================================================================= -## How to compress requests using the Spring RestTemplate Example Project +## Spring REST Compress + +This module contains articles about request compression with Spring ### Relevant Articles: -- [How to compress requests using the Spring RestTemplate]() +- [How to compress requests using the Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-compressing-requests) diff --git a/spring-rest-full/README.md b/spring-rest-full/README.md index b7b006d75e..a0e6e74179 100644 --- a/spring-rest-full/README.md +++ b/spring-rest-full/README.md @@ -1,8 +1,9 @@ -========= +## Spring REST Full -## REST Example Project with Spring +This module contains articles about REST APIs with Spring ### Courses + The "REST With Spring" Classes: http://bit.ly/restwithspring The "Learn Spring Security" Classes: http://github.learnspringsecurity.com diff --git a/spring-rest-hal-browser/README.md b/spring-rest-hal-browser/README.md index d9760c8295..027937f116 100644 --- a/spring-rest-hal-browser/README.md +++ b/spring-rest-hal-browser/README.md @@ -1,2 +1,6 @@ +## Spring REST HAL Browser + +This module contains articles about Spring REST with the HAL browser + ### Relevant Articles: - [Spring REST and HAL Browser](http://www.baeldung.com/spring-rest-hal) diff --git a/spring-rest-query-language/README.md b/spring-rest-query-language/README.md index 7677f96379..383cecec36 100644 --- a/spring-rest-query-language/README.md +++ b/spring-rest-query-language/README.md @@ -1,8 +1,9 @@ -========= +## Spring REST Query Language -## REST Example Project Query Language +This module contains articles about the REST query language with Spring ### Courses + The "REST With Spring" Classes: http://bit.ly/restwithspring The "Learn Spring Security" Classes: http://github.learnspringsecurity.com @@ -16,15 +17,11 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com - [REST Query Language with RSQL](http://www.baeldung.com/rest-api-search-language-rsql-fiql) - [REST Query Language – Implementing OR Operation](http://www.baeldung.com/rest-api-query-search-or-operation) - - - ### Build the Project ``` mvn clean install ``` - ### Set up MySQL ``` mysql -u root -p diff --git a/spring-rest-shell/README.md b/spring-rest-shell/README.md index b250f06a4b..0b126e6b1c 100644 --- a/spring-rest-shell/README.md +++ b/spring-rest-shell/README.md @@ -1,4 +1,6 @@ -## Spring REST Shell Project +## Spring REST Shell + +This module contains articles about Spring REST Shell ### Relevant Articles diff --git a/spring-rest/README.md b/spring-rest/README.md index 54b47604d4..1d713c05c0 100644 --- a/spring-rest/README.md +++ b/spring-rest/README.md @@ -1,4 +1,6 @@ -## Spring REST Example Project +## Spring REST + +This module contains articles about REST APIs with Spring ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring From 2a381c38aa30ce02d35a704bd4e1840cad5adbd0 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Wed, 25 Sep 2019 14:30:01 +0100 Subject: [PATCH 047/107] [BAEL-17496] - Add README descriptions 12 (#7862) * [BAEL-17496] - Add README descriptions 12 * Small changes --- spring-rest-simple/README.md | 4 ++++ spring-resttemplate/README.md | 4 +++- spring-roo/README.md | 4 ++++ spring-security-acl/README.md | 4 +++- spring-security-angular/README.md | 4 ++++ spring-security-cache-control/README.md | 4 ++-- spring-security-core/README.md | 18 +++++++++++------- .../{README.MD => README.md} | 4 ++++ spring-security-mvc-custom/README.md | 4 ++-- spring-security-mvc-digest-auth/README.md | 4 ++-- 10 files changed, 39 insertions(+), 15 deletions(-) rename spring-security-mvc-boot/{README.MD => README.md} (91%) diff --git a/spring-rest-simple/README.md b/spring-rest-simple/README.md index c01f27bd98..d60f57b227 100644 --- a/spring-rest-simple/README.md +++ b/spring-rest-simple/README.md @@ -1,3 +1,7 @@ +## Spring REST Simple + +This module contains articles about REST APIs in Spring + ## Relevant articles: - [Guide to UriComponentsBuilder in Spring](http://www.baeldung.com/spring-uricomponentsbuilder) diff --git a/spring-resttemplate/README.md b/spring-resttemplate/README.md index 97a89ff7aa..9b75e1aa81 100644 --- a/spring-resttemplate/README.md +++ b/spring-resttemplate/README.md @@ -1,4 +1,6 @@ -## Spring REST Example Project +## Spring RestTemplate + +This module contains articles about Spring RestTemplate ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring diff --git a/spring-roo/README.md b/spring-roo/README.md index b63b6f35d4..5a8ce6e30f 100644 --- a/spring-roo/README.md +++ b/spring-roo/README.md @@ -1,2 +1,6 @@ +## Spring Roo + +This module contains articles about Spring Roo + ### Relevant Articles: [Quick Guide to Spring Roo](http://www.baeldung.com/spring-roo) diff --git a/spring-security-acl/README.md b/spring-security-acl/README.md index fb3e8160ab..2f95793f8d 100644 --- a/spring-security-acl/README.md +++ b/spring-security-acl/README.md @@ -1,4 +1,6 @@ -## Spring Security ACL Project +## Spring Security ACL + +This module contains articles about Spring Security ACL ### Relevant Articles - [Introduction to Spring Security ACL](http://www.baeldung.com/spring-security-acl) diff --git a/spring-security-angular/README.md b/spring-security-angular/README.md index 80312c4bab..2b376a539f 100644 --- a/spring-security-angular/README.md +++ b/spring-security-angular/README.md @@ -1,2 +1,6 @@ +## Spring Security Angular + +This module contains articles about Spring Security with Angular + ### Relevant Articles: - [Spring Security Login Page with Angular](https://www.baeldung.com/spring-security-login-angular) diff --git a/spring-security-cache-control/README.md b/spring-security-cache-control/README.md index 4b0bab72cb..fc5bdda1f6 100644 --- a/spring-security-cache-control/README.md +++ b/spring-security-cache-control/README.md @@ -1,6 +1,6 @@ -========= - ## Spring Security Cache Control +This module contains articles about cache control with Spring Security + ### Relevant Articles: - [Spring Security – Cache Control Headers](http://www.baeldung.com/spring-security-cache-control-headers) diff --git a/spring-security-core/README.md b/spring-security-core/README.md index bc9a8afed7..3dfcb276d7 100644 --- a/spring-security-core/README.md +++ b/spring-security-core/README.md @@ -1,13 +1,17 @@ -## @PreFilter and @PostFilter annotations +## Spring Security Core -### Build the Project ### - -``` -mvn clean install -``` +This module contains articles about core Spring Security ### Relevant Articles: - [Spring Security – @PreFilter and @PostFilter](http://www.baeldung.com/spring-security-prefilter-postfilter) - [Spring Boot Authentication Auditing Support](http://www.baeldung.com/spring-boot-authentication-audit) - [Introduction to Spring Method Security](http://www.baeldung.com/spring-security-method-security) -- [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy) \ No newline at end of file +- [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy) + +### @PreFilter and @PostFilter annotations + +#### Build the Project + +`mvn clean install` + + diff --git a/spring-security-mvc-boot/README.MD b/spring-security-mvc-boot/README.md similarity index 91% rename from spring-security-mvc-boot/README.MD rename to spring-security-mvc-boot/README.md index 20036283a3..150ea3eee9 100644 --- a/spring-security-mvc-boot/README.MD +++ b/spring-security-mvc-boot/README.md @@ -1,3 +1,7 @@ +## Spring Boot Security MVC + +This module contains articles about Spring Security with Spring MVC in Boot applications + ### The Course The "REST With Spring" Classes: http://github.learnspringsecurity.com diff --git a/spring-security-mvc-custom/README.md b/spring-security-mvc-custom/README.md index ca0731a0c3..84bdec3c10 100644 --- a/spring-security-mvc-custom/README.md +++ b/spring-security-mvc-custom/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security MVC Custom -## Spring Security Login Example Project +This module contains articles about Spring Security with custom MVC applications ###The Course The "REST With Spring" Classes: http://github.learnspringsecurity.com diff --git a/spring-security-mvc-digest-auth/README.md b/spring-security-mvc-digest-auth/README.md index be0bf0a675..da612e273b 100644 --- a/spring-security-mvc-digest-auth/README.md +++ b/spring-security-mvc-digest-auth/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security with Digest Authentication -## Spring Security with Digest Authentication Example Project +This module contains articles about digest authentication with Spring Security ###The Course The "Learn Spring Security" Classes: http://github.learnspringsecurity.com From c2cf7ae969d2b070a132bb629e8e0613d922c98c Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Wed, 25 Sep 2019 14:30:51 +0100 Subject: [PATCH 048/107] [BAEL-17476] - Add README descriptions 13 (#7863) * [BAEL-17476] - Add README descriptions 13 * Changed the wording in some modules --- spring-security-mvc-jsonview/README.md | 4 ++++ spring-security-mvc-ldap/README.md | 3 ++- spring-security-mvc-login/README.md | 6 +++--- .../README.md | 4 ++-- spring-security-mvc-socket/README.md | 16 ++++++++++++---- spring-security-mvc/README.md | 4 ++-- spring-security-openid/README.md | 9 +++++++-- spring-security-react/README.md | 4 ++-- spring-security-rest-basic-auth/README.md | 5 +++-- spring-security-rest/README.md | 4 ++-- 10 files changed, 39 insertions(+), 20 deletions(-) diff --git a/spring-security-mvc-jsonview/README.md b/spring-security-mvc-jsonview/README.md index 35c806e856..0e28d4c292 100644 --- a/spring-security-mvc-jsonview/README.md +++ b/spring-security-mvc-jsonview/README.md @@ -1,3 +1,7 @@ +## Spring Security MVC Json View + +This module contains articles about Spring Security with JSON + ### Relevant Articles: - [Filtering Jackson JSON Output Based on Spring Security Role](https://www.baeldung.com/spring-security-role-filter-json) diff --git a/spring-security-mvc-ldap/README.md b/spring-security-mvc-ldap/README.md index 6f03143183..fe04cd23fa 100644 --- a/spring-security-mvc-ldap/README.md +++ b/spring-security-mvc-ldap/README.md @@ -1,5 +1,6 @@ +## Spring Security LDAP -## Spring Security with LDAP Example Project +This module contains articles about Spring Security LDAP ###The Course The "Learn Spring Security" Classes: http://github.learnspringsecurity.com diff --git a/spring-security-mvc-login/README.md b/spring-security-mvc-login/README.md index 983d949cb8..a20a04edec 100644 --- a/spring-security-mvc-login/README.md +++ b/spring-security-mvc-login/README.md @@ -1,8 +1,8 @@ -========= +## Spring Security Login -## Spring Security Login Example Project +This module contains articles about login mechanisms with Spring Security -###The Course +### The Course The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: diff --git a/spring-security-mvc-persisted-remember-me/README.md b/spring-security-mvc-persisted-remember-me/README.md index db2ae890f9..260e55198a 100644 --- a/spring-security-mvc-persisted-remember-me/README.md +++ b/spring-security-mvc-persisted-remember-me/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security Persisted Remember Me -## Spring Security Persisted Remember Me Example Project +This module contains articles about 'remember me' with Spring Security ###The Course The "Learn Spring Security" Classes: http://github.learnspringsecurity.com diff --git a/spring-security-mvc-socket/README.md b/spring-security-mvc-socket/README.md index d3f28af387..187bbe82b0 100644 --- a/spring-security-mvc-socket/README.md +++ b/spring-security-mvc-socket/README.md @@ -1,3 +1,15 @@ +## Spring Security MVC Socket + +This module contains articles about WebSockets with Spring Security + +### Relevant Articles: + +- [Intro to Security and WebSockets](http://www.baeldung.com/spring-security-websockets) +- [Spring WebSockets: Build an User Chat](https://www.baeldung.com/spring-websockets-send-message-to-user) +- [REST vs WebSockets](https://www.baeldung.com/rest-vs-websockets) + +### Running This Project: + To build the project, run the command: mvn clean install. This will build a war file in the target folder that you can deploye on a server like Tomcat. Alternatively, run the project from an IDE. @@ -5,7 +17,3 @@ Alternatively, run the project from an IDE. To login, use credentials from the data.sql file in src/main/resource, eg: user/password. -### Relevant Articles: -- [Intro to Security and WebSockets](http://www.baeldung.com/spring-security-websockets) -- [Spring WebSockets: Build an User Chat](https://www.baeldung.com/spring-websockets-send-message-to-user) -- [REST vs WebSockets](https://www.baeldung.com/rest-vs-websockets) diff --git a/spring-security-mvc/README.md b/spring-security-mvc/README.md index ce40ed5f5f..ad55e903c5 100644 --- a/spring-security-mvc/README.md +++ b/spring-security-mvc/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security MVC -## Spring Security Login Example Project +This module contains articles about Spring Security in MVC applications ###The Course The "Learn Spring Security" Classes: http://github.learnspringsecurity.com diff --git a/spring-security-openid/README.md b/spring-security-openid/README.md index 8c65c09f2f..1512ffbde5 100644 --- a/spring-security-openid/README.md +++ b/spring-security-openid/README.md @@ -1,16 +1,21 @@ +## Spring Security OpenID + +This module contains articles about OpenID with Spring Security + ### Relevant articles - [Spring Security and OpenID Connect](http://www.baeldung.com/spring-security-openid-connect) - -## OpenID Connect with Spring Security +### OpenID Connect with Spring Security ### Run the Project + ``` mvn spring-boot:run ``` ### Obtain Google App - Client ID, Secret + - You need to get client id and client secret by creating a new project at [Google Developer Console](https://console.developers.google.com/project/_/apiui/credential?pli=1) - Make sure to add OAuth2 credentials by selecting Add credentials > OAuth 2.0 client ID - Make sure you set redirect URI to http://localhost:8081/google-login diff --git a/spring-security-react/README.md b/spring-security-react/README.md index 1a845f0daa..4eb402c699 100644 --- a/spring-security-react/README.md +++ b/spring-security-react/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security React -## Spring Security React Example Project +This module contains articles about Spring Security with ReactJS ### The Course diff --git a/spring-security-rest-basic-auth/README.md b/spring-security-rest-basic-auth/README.md index b905824161..41d463f1e2 100644 --- a/spring-security-rest-basic-auth/README.md +++ b/spring-security-rest-basic-auth/README.md @@ -1,8 +1,9 @@ -========= +## Spring Security REST Basic Authentication -## REST API with Basic Authentication - Example Project +This module contains articles about basic authentication in RESTful APIs with Spring Security ###The Course + The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: diff --git a/spring-security-rest/README.md b/spring-security-rest/README.md index f450a514b2..c7ac45e38f 100644 --- a/spring-security-rest/README.md +++ b/spring-security-rest/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security REST -## Spring Security for REST Example Project +This module contains articles about REST APIs with Spring Security ### Courses The "REST With Spring" Classes: http://bit.ly/restwithspring From e45da12044b801a0342bc4d14455f211abf2f552 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Wed, 25 Sep 2019 14:37:18 +0100 Subject: [PATCH 049/107] [BAEL-17498] - Add README descriptions 14 (#7864) * [BAEL-17498] - Add README descriptions 14 * Changed wording in modules --- spring-security-rest-custom/README.md | 4 ++-- spring-security-sso/README.md | 4 ++++ spring-security-stormpath/README.md | 4 ++++ spring-security-thymeleaf/README.MD | 5 +++-- spring-security-x509/README.md | 6 +++++- spring-session/README.md | 4 ++-- spring-sleuth/README.md | 6 +++++- spring-soap/README.md | 6 +++++- spring-social-login/README.md | 4 ++++ spring-spel/README.md | 4 ++++ 10 files changed, 38 insertions(+), 9 deletions(-) diff --git a/spring-security-rest-custom/README.md b/spring-security-rest-custom/README.md index d7cb31e784..846093b554 100644 --- a/spring-security-rest-custom/README.md +++ b/spring-security-rest-custom/README.md @@ -1,6 +1,6 @@ -========= +## Spring Security REST Custom -## Spring Security for REST Example Project +This module contains articles about REST APIs with Spring Security ###The Course The "REST With Spring" Classes: http://github.learnspringsecurity.com diff --git a/spring-security-sso/README.md b/spring-security-sso/README.md index 88e3fbb2f7..31694bee45 100644 --- a/spring-security-sso/README.md +++ b/spring-security-sso/README.md @@ -1,3 +1,7 @@ +## Spring Security Single Sign On + +This module contains modules about single-sign-on with Spring Security + ### Relevant Articles: - [Simple Single Sign-On with Spring Security OAuth2](http://www.baeldung.com/sso-spring-security-oauth2) - [Spring Security Kerberos Integration](https://www.baeldung.com/spring-security-kerberos-integration) diff --git a/spring-security-stormpath/README.md b/spring-security-stormpath/README.md index f83882112f..abd65294a3 100644 --- a/spring-security-stormpath/README.md +++ b/spring-security-stormpath/README.md @@ -1,3 +1,7 @@ +## Spring Security Stormpath + +This module contains articles about Spring Security with Stormpath + ### Relevant articles - [Spring Security with Stormpath](http://www.baeldung.com/spring-security-stormpath) diff --git a/spring-security-thymeleaf/README.MD b/spring-security-thymeleaf/README.MD index 36007bce62..67b811fac8 100644 --- a/spring-security-thymeleaf/README.MD +++ b/spring-security-thymeleaf/README.MD @@ -1,5 +1,6 @@ -This module is for Spring Security Thymeleaf tutorial. -Jira BAEL-1556 +## Spring Security Thymeleaf + +This module contains articles about Spring Security with Thymeleaf ### Relevant Articles: diff --git a/spring-security-x509/README.md b/spring-security-x509/README.md index 2a4b84eae6..2c0e25a229 100644 --- a/spring-security-x509/README.md +++ b/spring-security-x509/README.md @@ -1,2 +1,6 @@ -Relevant Articles: +## Spring Security X.509 + +This module contains articles about X.509 authentication with Spring Security + +### Relevant Articles: - [X.509 Authentication in Spring Security](http://www.baeldung.com/x-509-authentication-in-spring-security) diff --git a/spring-session/README.md b/spring-session/README.md index c9875beadf..65040ec734 100644 --- a/spring-session/README.md +++ b/spring-session/README.md @@ -1,6 +1,6 @@ -========= +## Spring Session -## Spring Session Examples +This module contains articles about Spring Session ### Relevant Articles: - [Guide to Spring Session](https://www.baeldung.com/spring-session) diff --git a/spring-sleuth/README.md b/spring-sleuth/README.md index 47aa126939..692fbaa8b7 100644 --- a/spring-sleuth/README.md +++ b/spring-sleuth/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Spring Sleuth + +This module contains articles about Spring Cloud Sleuth + +### Relevant articles: - [Spring Cloud Sleuth in a Monolith Application](http://www.baeldung.com/spring-cloud-sleuth-single-application) diff --git a/spring-soap/README.md b/spring-soap/README.md index 8d96350e1e..c23f0bc6f0 100644 --- a/spring-soap/README.md +++ b/spring-soap/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Spring SOAP + +This module contains articles about SOAP APIs with Spring + +### Relevant articles: - [Creating a SOAP Web Service with Spring](https://www.baeldung.com/spring-boot-soap-web-service) diff --git a/spring-social-login/README.md b/spring-social-login/README.md index f745a90acb..c3ca867a95 100644 --- a/spring-social-login/README.md +++ b/spring-social-login/README.md @@ -1,2 +1,6 @@ +## Spring Social + +This module contains articles about Spring Social + ### Relevant Articles: - [A Secondary Facebook Login with Spring Social](http://www.baeldung.com/facebook-authentication-with-spring-security-and-social) diff --git a/spring-spel/README.md b/spring-spel/README.md index d7e69e114c..f81d304e1a 100644 --- a/spring-spel/README.md +++ b/spring-spel/README.md @@ -1,2 +1,6 @@ +## Spring Expression Language + +This module contains articles about the Spring Expression Language (SpEL) + ### Relevant Articles: - [Spring Expression Language Guide](http://www.baeldung.com/spring-expression-language) From d06b026a7be95841f644d48dc5d3984969eaf9e9 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Wed, 25 Sep 2019 14:39:31 +0100 Subject: [PATCH 050/107] [BAEL-17476] - Add Readme descriptions 15 (#7875) * [BAEL-17476] - Add Readme descriptions 15 * Added Spring Vert.X readme change --- spring-state-machine/README.md | 4 ++++ spring-static-resources/README.md | 4 ++++ spring-swagger-codegen/README.md | 4 ++++ spring-thymeleaf/README.md | 7 ++++--- spring-vault/README.md | 5 +++++ spring-vertx/README.md | 4 ++++ spring-webflux-amqp/README.md | 5 ++++- spring-zuul/README.md | 5 ++--- static-analysis/README.md | 4 ++++ stripe/README.md | 4 ++-- 10 files changed, 37 insertions(+), 9 deletions(-) diff --git a/spring-state-machine/README.md b/spring-state-machine/README.md index a2668fb650..f80ef34ef8 100644 --- a/spring-state-machine/README.md +++ b/spring-state-machine/README.md @@ -1,3 +1,7 @@ +## Spring State Machine + +This module contains articles about Spring State Machine + ### Relevant articles - [A Guide to the Spring State Machine Project](http://www.baeldung.com/spring-state-machine) diff --git a/spring-static-resources/README.md b/spring-static-resources/README.md index 64f017b5dd..8d77e6fe94 100644 --- a/spring-static-resources/README.md +++ b/spring-static-resources/README.md @@ -1,3 +1,7 @@ +## Spring Static Resources + +This module contains articles about static resources with Spring + ### Relevant Articles: - [Cachable Static Assets with Spring MVC](http://www.baeldung.com/cachable-static-assets-with-spring-mvc) - [Minification of JS and CSS Assets with Maven](http://www.baeldung.com/maven-minification-of-js-and-css-assets) diff --git a/spring-swagger-codegen/README.md b/spring-swagger-codegen/README.md index ee6b240c30..dbcf2b3e8d 100644 --- a/spring-swagger-codegen/README.md +++ b/spring-swagger-codegen/README.md @@ -1,3 +1,7 @@ +## Spring Swagger CodeGen + +This module contains articles about Spring with Swagger CodeGen + ### Relevant articles - [Generate Spring Boot REST Client with Swagger](http://www.baeldung.com/spring-boot-rest-client-swagger-codegen) diff --git a/spring-thymeleaf/README.md b/spring-thymeleaf/README.md index 082a65f55b..88f3e35f8c 100644 --- a/spring-thymeleaf/README.md +++ b/spring-thymeleaf/README.md @@ -1,6 +1,6 @@ -========= +## Spring Thymeleaf -## Spring Thymeleaf Example Project +This module contains articles about Spring with Thymeleaf ### Relevant Articles: - [Introduction to Using Thymeleaf in Spring](http://www.baeldung.com/thymeleaf-in-spring-mvc) @@ -19,13 +19,14 @@ - [Working with Select and Option in Thymeleaf](http://www.baeldung.com/thymeleaf-select-option) - [Working With Custom HTML Attributes in Thymeleaf](https://www.baeldung.com/thymeleaf-custom-html-attributes) - [Spring Request Parameters with Thymeleaf](https://www.baeldung.com/spring-thymeleaf-request-parameters) +- [[next -->]](/spring-thymeleaf-2) ### Build the Project mvn clean install - ### Run the Project + mvn cargo:run - **note**: starts on port '8082' diff --git a/spring-vault/README.md b/spring-vault/README.md index 8db065a3dd..9e1d14ba6b 100644 --- a/spring-vault/README.md +++ b/spring-vault/README.md @@ -1,2 +1,7 @@ +## Spring Vault + +This module contains articles about Spring Vault + ### Relevant Articles: + - [Spring Vault](https://www.baeldung.com/spring-vault) diff --git a/spring-vertx/README.md b/spring-vertx/README.md index 05d059e1b2..e9557f330b 100644 --- a/spring-vertx/README.md +++ b/spring-vertx/README.md @@ -1,2 +1,6 @@ +## Spring Vert.x + +This module contains articles about Spring with Vert.x + ### Relevant Articles: - [Vert.x Spring Integration](http://www.baeldung.com/spring-vertx) diff --git a/spring-webflux-amqp/README.md b/spring-webflux-amqp/README.md index 5cd3391c3e..b7ac73b53d 100644 --- a/spring-webflux-amqp/README.md +++ b/spring-webflux-amqp/README.md @@ -1,4 +1,7 @@ +## Spring WebFlux AMQP + +This module contains articles about Spring WebFlux with AMQP + ### Relevant Articles: -================================ - [Spring AMQP in Reactive Applications](http://www.baeldung.com/spring-amqp-reactive) diff --git a/spring-zuul/README.md b/spring-zuul/README.md index 41a77f70c8..a2ea211195 100644 --- a/spring-zuul/README.md +++ b/spring-zuul/README.md @@ -1,7 +1,6 @@ -========= - -## Spring REST with a Zuul +## Spring Zuul +This module contains articles about Spring with Netflix Zuul ### Relevant Articles: - [Spring REST with a Zuul Proxy](http://www.baeldung.com/spring-rest-with-zuul-proxy) diff --git a/static-analysis/README.md b/static-analysis/README.md index e4d4bc7bfc..e3710831cf 100644 --- a/static-analysis/README.md +++ b/static-analysis/README.md @@ -1,3 +1,7 @@ +## Static Analysis + +This module contains articles about static program analysis + ## Relevant articles: - [Introduction to PMD](http://www.baeldung.com/pmd) diff --git a/stripe/README.md b/stripe/README.md index 8a44ff9d33..a7134b9633 100644 --- a/stripe/README.md +++ b/stripe/README.md @@ -1,6 +1,6 @@ -### Stripe API for Java Sample Project +### Stripe -This is Spring Boot project that displays a checkout form and charges a credit card using the Stripe API for Java. +This module contains articles about Stripe ### Relevant articles From 6b18970f6e3febe797115b55a3486f6862f97533 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Wed, 25 Sep 2019 16:21:38 +0100 Subject: [PATCH 051/107] updated Querysdl --- spring-data-rest-querydsl/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-rest-querydsl/README.md b/spring-data-rest-querydsl/README.md index 88efaff35e..be47d05f8d 100644 --- a/spring-data-rest-querydsl/README.md +++ b/spring-data-rest-querydsl/README.md @@ -1,6 +1,6 @@ ## Spring Data REST Querydsl -This module contains articles about Spring Data REST Querydsl +This module contains articles about Querydsl with Spring Data REST ### Relevant Articles: - [REST Query Language Over Multiple Tables with Querydsl Web Support](http://www.baeldung.com/rest-querydsl-multiple-tables) From 9f2a86c79669d84a87d27e0639324d498d394d68 Mon Sep 17 00:00:00 2001 From: Maciej Andrearczyk Date: Wed, 25 Sep 2019 19:33:21 +0200 Subject: [PATCH 052/107] BAEL-3285 | Simultaneous Spring WebClient calls --- spring-5-reactive-client/pom.xml | 6 ++ .../simultaneouswebclient/Client.java | 66 +++++++++++++++++ .../reactive/simultaneouswebclient/Item.java | 17 +++++ .../reactive/simultaneouswebclient/User.java | 17 +++++ .../simultaneouswebclient/UserWithItem.java | 19 +++++ .../ClientIntegrationTest.java | 71 +++++++++++++++++++ 6 files changed, 196 insertions(+) create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java create mode 100644 spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java create mode 100644 spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index 1b71815eb4..2ef5741e84 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -77,6 +77,12 @@ spring-boot-starter-test test + + com.github.tomakehurst + wiremock + 2.24.1 + test + org.apache.commons diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java new file mode 100644 index 0000000000..4fbb904564 --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java @@ -0,0 +1,66 @@ +package com.baeldung.reactive.simultaneouswebclient; + +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; +import reactor.core.scheduler.Schedulers; + +import java.util.List; + +public class Client { + + private WebClient webClient; + + public Client(String uri) { + this.webClient = WebClient.create(uri); + } + + public Mono getUser(int id) { + return webClient + .get() + .uri("/user/{id}", id) + .retrieve() + .bodyToMono(User.class); + } + + public Mono getItem(int id) { + return webClient + .get() + .uri("/item/{id}", id) + .retrieve() + .bodyToMono(Item.class); + } + + public Mono getOtherUser(int id) { + return webClient + .get() + .uri("/otheruser/{id}", id) + .retrieve() + .bodyToMono(User.class); + } + + public List fetchUsers(List userIds) { + return Flux.fromIterable(userIds) + .parallel() + .runOn(Schedulers.elastic()) + .flatMap(this::getUser) + .collectSortedList((u1, u2) -> u2.id() - u1.id()) + .block(); + } + + public List fetchUserAndOtherUser(int id) { + return Flux.merge(getUser(id), getOtherUser(id)) + .parallel() + .runOn(Schedulers.elastic()) + .collectSortedList((u1, u2) -> u2.id() - u1.id()) + .block(); + } + + public UserWithItem fetchUserAndItem(int userId, int itemId) { + Mono user = getUser(userId).subscribeOn(Schedulers.elastic()); + Mono item = getItem(itemId).subscribeOn(Schedulers.elastic()); + + return Mono.zip(user, item, UserWithItem::new) + .block(); + } +} diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java new file mode 100644 index 0000000000..5584e1896d --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java @@ -0,0 +1,17 @@ +package com.baeldung.reactive.simultaneouswebclient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Item { + private int id; + + @JsonCreator + public Item(@JsonProperty("id") int id) { + this.id = id; + } + + public int id() { + return id; + } +} diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java new file mode 100644 index 0000000000..e080538227 --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java @@ -0,0 +1,17 @@ +package com.baeldung.reactive.simultaneouswebclient; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class User { + private int id; + + @JsonCreator + public User(@JsonProperty("id") int id) { + this.id = id; + } + + public int id() { + return id; + } +} diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java new file mode 100644 index 0000000000..d19a324e55 --- /dev/null +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java @@ -0,0 +1,19 @@ +package com.baeldung.reactive.simultaneouswebclient; + +public class UserWithItem { + private User user; + private Item item; + + public UserWithItem(User user, Item item) { + this.user = user; + this.item = item; + } + + public User user() { + return user; + } + + public Item item() { + return item; + } +} diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java new file mode 100644 index 0000000000..e5b707d384 --- /dev/null +++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java @@ -0,0 +1,71 @@ +package com.baeldung.reactive.simultaneouswebclient; + +import org.junit.Test; +import org.junit.Before; +import org.junit.After; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import com.github.tomakehurst.wiremock.WireMockServer; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ClientIntegrationTest { + + private WireMockServer wireMockServer; + + @Before + public void setup() { + wireMockServer = new WireMockServer(wireMockConfig().port(8089)); + wireMockServer.start(); + configureFor("localhost", wireMockServer.port()); + } + + @After + public void tearDown() { + wireMockServer.stop(); + } + + @Test + public void checkIfCallsAreExecutedSimultaneously() { + // Arrange + int requestsNumber = 5; + int singleRequestTime = 1000; + + for (int i = 1; i <= requestsNumber; i++) { + stubFor( + get(urlEqualTo("/user/" + i)).willReturn(aResponse() + .withFixedDelay(singleRequestTime) + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(String.format("{ \"id\": %d }", i)))); + } + + List userIds = IntStream.rangeClosed(1, requestsNumber) + .boxed() + .collect(Collectors.toList()); + + Client client = new Client("http://localhost:8089"); + + // Act + long start = System.currentTimeMillis(); + List users = client.fetchUsers(userIds); + long end = System.currentTimeMillis(); + + // Assert + long totalExecutionTime = end - start; + + assertEquals("Unexpected number of users", requestsNumber, users.size()); + assertTrue("Execution time is too big", 2 * singleRequestTime > totalExecutionTime); + } +} From 824acb9351121e6dc912402a943e87e7369f4bec Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Thu, 26 Sep 2019 11:08:01 +0530 Subject: [PATCH 053/107] BAEL-17703 Fix the integrations tests in mockito (#7871) * BAEL-17703 Fix the integrations tests in mockito - Upgraded power-mockito api 2 jar - Renamed many IntegrationTests back to UnitTests as they do not require any integration components * BAEL-17703 Fix the integrations tests in mockito -Renamed MockFinals to MockFinalsUnitTest so that it can be picked by builds --- testing-modules/mockito/pom.xml | 2 +- ...egrationTest.java => LuckyNumberGeneratorUnitTest.java} | 2 +- ...ckitoIntegrationTest.java => PowerMockitoUnitTest.java} | 7 +++---- ...MockitoIntegrationTest.java => BDDMockitoUnitTest.java} | 2 +- .../mockito/{MockFinals.java => MockFinalsUnitTest.java} | 2 +- ...IntegrationTest.java => MockitoAnnotationUnitTest.java} | 2 +- ...grationTest.java => MockitoConfigExamplesUnitTest.java} | 2 +- ...nIntegrationTest.java => MockitoExceptionUnitTest.java} | 2 +- ...toMockIntegrationTest.java => MockitoMockUnitTest.java} | 2 +- ...grationTest.java => MockitoVerifyExamplesUnitTest.java} | 2 +- ...kitoSpyIntegrationTest.java => MockitoSpyUnitTest.java} | 2 +- 11 files changed, 13 insertions(+), 14 deletions(-) rename testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/{LuckyNumberGeneratorIntegrationTest.java => LuckyNumberGeneratorUnitTest.java} (97%) rename testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/{PowerMockitoIntegrationTest.java => PowerMockitoUnitTest.java} (94%) rename testing-modules/mockito/src/test/java/org/baeldung/bddmockito/{BDDMockitoIntegrationTest.java => BDDMockitoUnitTest.java} (98%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/{MockFinals.java => MockFinalsUnitTest.java} (95%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/{MockitoAnnotationIntegrationTest.java => MockitoAnnotationUnitTest.java} (98%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/{MockitoConfigExamplesIntegrationTest.java => MockitoConfigExamplesUnitTest.java} (98%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/{MockitoExceptionIntegrationTest.java => MockitoExceptionUnitTest.java} (97%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/{MockitoMockIntegrationTest.java => MockitoMockUnitTest.java} (98%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/{MockitoVerifyExamplesIntegrationTest.java => MockitoVerifyExamplesUnitTest.java} (98%) rename testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/{MockitoSpyIntegrationTest.java => MockitoSpyUnitTest.java} (97%) diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml index 7b6d6e7735..f307b80370 100644 --- a/testing-modules/mockito/pom.xml +++ b/testing-modules/mockito/pom.xml @@ -96,7 +96,7 @@ 19.0 - 1.7.0 + 2.0.2 2.0.0.0 2.1.1 diff --git a/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/LuckyNumberGeneratorIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/LuckyNumberGeneratorUnitTest.java similarity index 97% rename from testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/LuckyNumberGeneratorIntegrationTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/LuckyNumberGeneratorUnitTest.java index 5e311c60f2..5b66aa0a9e 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/LuckyNumberGeneratorIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/LuckyNumberGeneratorUnitTest.java @@ -14,7 +14,7 @@ import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) @PrepareForTest(fullyQualifiedNames = "com.baeldung.powermockito.introduction.LuckyNumberGenerator") -public class LuckyNumberGeneratorIntegrationTest { +public class LuckyNumberGeneratorUnitTest { @Test public final void givenPrivateMethodWithReturn_whenUsingPowerMockito_thenCorrect() throws Exception { diff --git a/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/PowerMockitoIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/PowerMockitoUnitTest.java similarity index 94% rename from testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/PowerMockitoIntegrationTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/PowerMockitoUnitTest.java index 1b6431f0c2..4943b0486a 100644 --- a/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/PowerMockitoIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/powermockito/introduction/PowerMockitoUnitTest.java @@ -13,7 +13,7 @@ import static org.powermock.api.mockito.PowerMockito.*; @RunWith(PowerMockRunner.class) @PrepareForTest(fullyQualifiedNames = "com.baeldung.powermockito.introduction.*") -public class PowerMockitoIntegrationTest { +public class PowerMockitoUnitTest { @Test public void givenFinalMethods_whenUsingPowerMockito_thenCorrect() throws Exception { @@ -44,10 +44,10 @@ public class PowerMockitoIntegrationTest { assertEquals("Hello Baeldung!", firstWelcome); assertEquals("Hello Baeldung!", secondWelcome); - verifyStatic(times(2)); + verifyStatic(CollaboratorWithStaticMethods.class, times(2)); CollaboratorWithStaticMethods.firstMethod(Mockito.anyString()); - verifyStatic(Mockito.never()); + verifyStatic(CollaboratorWithStaticMethods.class, Mockito.never()); CollaboratorWithStaticMethods.secondMethod(); CollaboratorWithStaticMethods.thirdMethod(); @@ -60,7 +60,6 @@ public class PowerMockitoIntegrationTest { spy(CollaboratorForPartialMocking.class); when(CollaboratorForPartialMocking.staticMethod()).thenReturn("I am a static mock method."); returnValue = CollaboratorForPartialMocking.staticMethod(); - verifyStatic(); CollaboratorForPartialMocking.staticMethod(); assertEquals("I am a static mock method.", returnValue); diff --git a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoUnitTest.java index e0ca6f0a35..977a60933f 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoUnitTest.java @@ -10,7 +10,7 @@ import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; -public class BDDMockitoIntegrationTest { +public class BDDMockitoUnitTest { PhoneBookService phoneBookService; PhoneBookRepository phoneBookRepository; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinals.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinalsUnitTest.java similarity index 95% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinals.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinalsUnitTest.java index caa456c891..000774592c 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinals.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinalsUnitTest.java @@ -8,7 +8,7 @@ import static org.mockito.Mockito.when; import org.baeldung.mockito.voidmethods.MyList; -public class MockFinals { +public class MockFinalsUnitTest { @Test public void whenMockFinalClassMockWorks() { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationUnitTest.java index 5e083adbf5..6bc0e69e65 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationUnitTest.java @@ -11,7 +11,7 @@ import java.util.Map; import static org.junit.Assert.assertEquals; //@RunWith(MockitoJUnitRunner.class) -public class MockitoAnnotationIntegrationTest { +public class MockitoAnnotationUnitTest { @Mock private List mockedList; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesUnitTest.java index 096bbe1ed7..c065e164c5 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesUnitTest.java @@ -13,7 +13,7 @@ import static org.mockito.Mockito.*; import org.baeldung.mockito.voidmethods.MyList; -public class MockitoConfigExamplesIntegrationTest { +public class MockitoConfigExamplesUnitTest { // tests diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionUnitTest.java similarity index 97% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionUnitTest.java index 9a25ccb28c..88da16ae2b 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionUnitTest.java @@ -8,7 +8,7 @@ import static org.mockito.Mockito.when; import org.junit.Test; import org.mockito.Mockito; -public class MockitoExceptionIntegrationTest { +public class MockitoExceptionUnitTest { @Test(expected = NullPointerException.class) public void whenConfigNonVoidRetunMethodToThrowEx_thenExIsThrown() { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockUnitTest.java index de26642ede..30c843ff13 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockUnitTest.java @@ -17,7 +17,7 @@ import org.mockito.exceptions.verification.TooLittleActualInvocations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -public class MockitoMockIntegrationTest { +public class MockitoMockUnitTest { private static class CustomAnswer implements Answer { @Override diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesUnitTest.java index 9c71b1fc4f..a6e40b84e1 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesUnitTest.java @@ -16,7 +16,7 @@ import static org.junit.Assert.assertThat; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; -public class MockitoVerifyExamplesIntegrationTest { +public class MockitoVerifyExamplesUnitTest { // tests diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyUnitTest.java similarity index 97% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyIntegrationTest.java rename to testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyUnitTest.java index d0b838a789..068a4c6de9 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyUnitTest.java @@ -12,7 +12,7 @@ import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) -public class MockitoSpyIntegrationTest { +public class MockitoSpyUnitTest { @Spy private List aSpyList = new ArrayList(); From 327e46c239d5c1c19c56b7e79bf4f7e899e99d1e Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Thu, 26 Sep 2019 08:59:52 +0200 Subject: [PATCH 054/107] spelling fix --- .../java/com/baeldung/interpolation/ValidationExamples.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java index 30d770205e..6c9b924200 100644 --- a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java @@ -18,7 +18,7 @@ public class ValidationExamples { @Min( value = 1, - message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case" + message = "There must be at least {value} test{value > 1 ? 's' : ''} in the test case" ) private int testCount; From 6f7676c739806e22b51785f699abf52a7c373191 Mon Sep 17 00:00:00 2001 From: macroscopic64 Date: Thu, 26 Sep 2019 23:39:55 +0530 Subject: [PATCH 055/107] [BAEL-3288] - Graceful Shutdown of a Spring Boot Application --- .../gracefulshutdown/GracefulShutdownApplication.java | 6 +----- .../gracefulshutdown/config/SpringConfiguration.java | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java index b7a840b38c..9cb226a49f 100644 --- a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java +++ b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java @@ -1,13 +1,9 @@ package com.baeldung.gracefulshutdown; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -@SpringBootApplication -@EnableAutoConfiguration -@ComponentScan(basePackages = {"com.baeldung.gracefulshutdown"}) +@SpringBootApplication(scanBasePackages = {"com.baeldung.gracefulshutdown"}) public class GracefulShutdownApplication { public static void main(String args[]) { diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java index 1f27163215..b458f16206 100644 --- a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java +++ b/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java @@ -7,11 +7,9 @@ import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.task.TaskExecutor; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @Configuration -@EnableScheduling public class SpringConfiguration { private static final Logger LOG = LoggerFactory.getLogger(SpringConfiguration.class); From 9ad7ed0e2f9a107c28e0897ac214513a4262dd12 Mon Sep 17 00:00:00 2001 From: Jonathan Cook Date: Thu, 26 Sep 2019 21:08:17 +0200 Subject: [PATCH 056/107] BAEL-3110 - Linux Commands - Remove All Text After X (#7867) * BAEL-3132 - Linux Commands - Loop Through Directories/Folders * BAEL-3132 - Linux Commands - Loop Through Directories/Folders - update pom description. * BAEL-3132 - Linux Commands - Loop Through Directories/Folders - Add another example using find exec. * BAEL-3132 - Linux Commands - Loop Through Directories/Folders * BAEL-3110 - Linux Commands - Remove All Text After X --- .../text/src/main/bash/remove_characters.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 linux-bash/text/src/main/bash/remove_characters.sh diff --git a/linux-bash/text/src/main/bash/remove_characters.sh b/linux-bash/text/src/main/bash/remove_characters.sh new file mode 100755 index 0000000000..a8f51468f4 --- /dev/null +++ b/linux-bash/text/src/main/bash/remove_characters.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +my_var="Hola Mundo" +echo ${my_var} + +my_filename="interesting-text-file.txt" +echo ${my_filename:0:21} + +echo ${my_filename%.*} + +complicated_filename="hello-world.tar.gz" +echo ${complicated_filename%%.*} + +echo ${my_filename/.*/} + +echo 'interesting-text-file.txt' | sed 's/.txt*//' + +echo 'interesting-text-file.txt' | cut -f1 -d"." +echo ${complicated_filename} | cut -f1 -d"." From cc23ac598a3eb3aa8665eee0501b26810d4914ca Mon Sep 17 00:00:00 2001 From: wugangca Date: Thu, 26 Sep 2019 21:25:57 -0600 Subject: [PATCH 057/107] BAEL-2988 Make the code consistent with the article. (#7870) * BAEL-2988 Make the code consistent with the article. * BAEL-2988 Use @GetMapping annotation based on the feedback. --- .../src/main/java/com/baeldung/cors/EnumController.java | 5 +++-- .../src/main/java/com/baeldung/model/Modes.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java b/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java index 6bd5a16439..34ce4d3927 100644 --- a/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java +++ b/spring-rest-simple/src/main/java/com/baeldung/cors/EnumController.java @@ -1,6 +1,7 @@ package com.baeldung.cors; import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -13,12 +14,12 @@ import com.baeldung.model.Modes; @RequestMapping("/enums") public class EnumController { - @RequestMapping("/mode2str") + @GetMapping("/mode2str") public String getStringToMode(@RequestParam("mode") Modes mode) { return "good"; } - @RequestMapping("/findbymode/{mode}") + @GetMapping("/findbymode/{mode}") public String findByEnum(@PathVariable Modes mode) { return "good"; } diff --git a/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java b/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java index a82df17d7d..d3a1ab4a61 100644 --- a/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java +++ b/spring-rest-simple/src/main/java/com/baeldung/model/Modes.java @@ -1,5 +1,5 @@ package com.baeldung.model; public enum Modes { - ALPHA, DELTA + ALPHA, BETA; } From 957ad4587c9dd9b9ec271ff177e9bfd4b29bb371 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Fri, 27 Sep 2019 06:34:17 +0300 Subject: [PATCH 058/107] BAEL-3085 Using a slash character in Spring URLs (#7823) * slashes in Spring URLs * cleanup * restored format of pom * using more descriptive names * using more descriptive names * slash in urls code moved to spring-mvc-simple-2 module --- spring-mvc-simple-2/pom.xml | 5 ++ .../baeldung/spring/slash/Application.java | 14 +++ .../spring/slash/SlashParsingController.java | 31 +++++++ .../slash/SlashParsingControllerIntTest.java | 87 +++++++++++++++++++ 4 files changed, 137 insertions(+) create mode 100644 spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/Application.java create mode 100644 spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/SlashParsingController.java create mode 100644 spring-mvc-simple-2/src/test/java/com/baeldung/spring/slash/SlashParsingControllerIntTest.java diff --git a/spring-mvc-simple-2/pom.xml b/spring-mvc-simple-2/pom.xml index 74302cff78..ca911b2719 100644 --- a/spring-mvc-simple-2/pom.xml +++ b/spring-mvc-simple-2/pom.xml @@ -18,6 +18,11 @@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/Application.java b/spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/Application.java new file mode 100644 index 0000000000..7db6ac3755 --- /dev/null +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/Application.java @@ -0,0 +1,14 @@ +package com.baeldung.spring.slash; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@SpringBootApplication +public class Application implements WebMvcConfigurer { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/SlashParsingController.java b/spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/SlashParsingController.java new file mode 100644 index 0000000000..635587ee5b --- /dev/null +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/spring/slash/SlashParsingController.java @@ -0,0 +1,31 @@ +package com.baeldung.spring.slash; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("slash") +public class SlashParsingController { + + @GetMapping("mypaths/{anything}") + public String pathVariable(@PathVariable("anything") String anything) { + return anything; + } + + @GetMapping("all/**") + public String allDirectories(HttpServletRequest request) { + return request.getRequestURI() + .split(request.getContextPath() + "/all/")[1]; + } + + @GetMapping("all") + public String queryParameter(@RequestParam("param") String param) { + return param; + } + +} diff --git a/spring-mvc-simple-2/src/test/java/com/baeldung/spring/slash/SlashParsingControllerIntTest.java b/spring-mvc-simple-2/src/test/java/com/baeldung/spring/slash/SlashParsingControllerIntTest.java new file mode 100644 index 0000000000..d81b34f7bf --- /dev/null +++ b/spring-mvc-simple-2/src/test/java/com/baeldung/spring/slash/SlashParsingControllerIntTest.java @@ -0,0 +1,87 @@ +package com.baeldung.spring.slash; + +import static org.junit.Assert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import java.net.URI; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +@AutoConfigureMockMvc +@ExtendWith(SpringExtension.class) +@SpringBootTest +public class SlashParsingControllerIntTest { + + @Autowired + private MockMvc mockMvc; + + @Test + public void whenUsingPathVariablemWithoutSlashes_thenStatusOk() throws Exception { + final String stringWithoutSlashes = "noslash"; + + MvcResult mvcResult = mockMvc.perform(get("/slash/mypaths/" + stringWithoutSlashes)) + .andExpect(status().isOk()) + .andReturn(); + + assertEquals(stringWithoutSlashes, mvcResult.getResponse() + .getContentAsString()); + } + + @Test + public void whenUsingPathVariableWithSlashes_thenStatusNotFound() throws Exception { + final String stringWithSlashes = "url/with/slashes"; + + mockMvc.perform(get("/slash/mypaths/" + stringWithSlashes)) + .andExpect(status().isNotFound()); + } + + @Test + public void givenAllFallbackEndpoint_whenUsingPathWithSlashes_thenStatusOk() throws Exception { + final String stringWithSlashes = "url/for/testing/purposes"; + + MvcResult mvcResult = mockMvc.perform(get("/slash/all/" + stringWithSlashes)) + .andExpect(status().isOk()) + .andReturn(); + + assertEquals(stringWithSlashes, mvcResult.getResponse() + .getContentAsString()); + } + + @Test + public void givenAllFallbackEndpoint_whenUsingConsecutiveSlashes_thenPathNormalized() throws Exception { + final String stringWithSlashes = "http://myurl.com"; + + MvcResult mvcResult = mockMvc.perform(get("/slash/all/" + stringWithSlashes)) + .andExpect(status().isOk()) + .andReturn(); + + String stringWithSlashesNormalized = URI.create("/slash/all/" + stringWithSlashes) + .normalize() + .toString() + .split("/slash/all/")[1]; + + assertEquals(stringWithSlashesNormalized, mvcResult.getResponse() + .getContentAsString()); + } + + @Test + public void whenUsingSlashesInQueryParam_thenParameterAccepted() throws Exception { + final String stringWithSlashes = "url/for////testing/purposes"; + + MvcResult mvcResult = mockMvc.perform(get("/slash/all").param("param", stringWithSlashes)) + .andExpect(status().isOk()) + .andReturn(); + + assertEquals(stringWithSlashes, mvcResult.getResponse() + .getContentAsString()); + } + +} From 0677a0627145940bdf5554574ff00ce2ba6fab01 Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Fri, 27 Sep 2019 16:31:36 +0300 Subject: [PATCH 059/107] Split or move core-java-collections module (#7842) --- .../core-java-collections-2/README.md | 15 ++++ .../core-java-collections-2/pom.xml | 58 +++++++++++++ .../combiningcollections/CombiningArrays.java | 2 +- .../combiningcollections/CombiningLists.java | 2 +- .../combiningcollections/CombiningMaps.java | 2 +- .../combiningcollections/CombiningSets.java | 2 +- .../CollectionUtilsCollectionFilter.java | 2 +- .../EclipseCollectionsCollectionFilter.java | 2 +- .../filtering/GuavaCollectionFilter.java | 2 +- .../filtering/StreamsCollectionFilter.java | 2 +- .../iterablesize}/IterableSize.java | 2 +- ...lectionStreamsUsingCommonsEmptyIfNull.java | 2 +- ...ionStreamsUsingJava8OptionalContainer.java | 2 +- ...ctionStreamsUsingNullDereferenceCheck.java | 2 +- .../removal/CollectionRemoveIf.java | 2 +- .../collections}/removal/Iterators.java | 2 +- .../removal/StreamFilterAndCollector.java | 2 +- .../removal/StreamPartitioningBy.java | 2 +- .../CombiningArraysUnitTest.java | 2 +- .../CombiningListsUnitTest.java | 2 +- .../CombiningMapsUnitTest.java | 2 +- .../CombiningSetsUnitTest.java | 2 +- .../filtering/CollectionFiltersUnitTest.java | 2 +- .../iterablesize}/IterableSizeUnitTest.java | 2 +- .../CollectionsJoinAndSplitJUnitTest.java | 2 +- .../JoinSplitCollectionsUnitTest.java | 2 +- .../CombineMultipleCollectionsUnitTest.java} | 4 +- ...treamsUsingCommonsEmptyIfNullUnitTest.java | 2 +- ...msUsingJava8OptionalContainerUnitTest.java | 2 +- ...eamsUsingNullDereferenceCheckUnitTest.java | 2 +- .../collections}/removal/RemovalUnitTest.java | 2 +- .../ShufflingCollectionsUnitTest.java | 2 +- .../collections}/sorting/Employee.java | 2 +- .../sorting/JavaSortingUnitTest.java | 2 +- .../core-java-collections-3/README.md | 11 +++ .../core-java-collections-3/pom.xml | 34 ++++++++ .../ArrayListBenchmark.java | 2 +- .../arraylistvsvector/Employee.java | 55 ++++++++++++ .../arraylistvsvector}/VectorExample.java | 2 +- .../CollectionsBenchmark.java | 2 +- .../containsperformance/Employee.java | 55 ++++++++++++ .../collections}/iterators/Iterators.java | 2 +- .../ArraySortBenchmark.java | 2 +- .../CollectionsSortCompare.java | 2 +- .../ClearVsRemoveAllUnitTest.java | 2 +- .../HashmapVsHashtableDifferenceUnitTest.java | 2 +- .../iterators/IteratorsUnitTest.java | 8 +- .../core-java-collections-list/README.md | 3 +- .../core-java-collections/README.md | 28 ++----- .../core-java-collections/pom.xml | 33 -------- .../{application => }/Application.java | 2 +- ...ncurrentModificationExceptionUnitTest.java | 83 ------------------- .../SynchronizedCollectionUnitTest.java | 2 +- .../{test => }/SynchronizedListUnitTest.java | 2 +- .../{test => }/SynchronizedMapUnitTest.java | 2 +- .../{test => }/SynchronizedSetUnitTest.java | 2 +- .../SynchronizedSortedMapUnitTest.java | 2 +- .../SynchronizedSortedSetUnitTest.java | 2 +- .../org/baeldung/java/collections/README.md | 3 - pom.xml | 4 + 60 files changed, 292 insertions(+), 194 deletions(-) create mode 100644 core-java-modules/core-java-collections-2/README.md create mode 100644 core-java-modules/core-java-collections-2/pom.xml rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/combiningcollections/CombiningArrays.java (95%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/combiningcollections/CombiningLists.java (96%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/combiningcollections/CombiningMaps.java (96%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/combiningcollections/CombiningSets.java (96%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java => core-java-collections-2/src/main/java/com/baeldung/collections}/filtering/CollectionUtilsCollectionFilter.java (91%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java => core-java-collections-2/src/main/java/com/baeldung/collections}/filtering/EclipseCollectionsCollectionFilter.java (96%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java => core-java-collections-2/src/main/java/com/baeldung/collections}/filtering/GuavaCollectionFilter.java (91%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java => core-java-collections-2/src/main/java/com/baeldung/collections}/filtering/StreamsCollectionFilter.java (95%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java/iterable => core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize}/IterableSize.java (97%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java (92%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java (92%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java (91%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/removal/CollectionRemoveIf.java (91%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/removal/Iterators.java (93%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/removal/StreamFilterAndCollector.java (93%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-2/src/main/java/com/baeldung/collections}/removal/StreamPartitioningBy.java (95%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/combiningcollections/CombiningArraysUnitTest.java (96%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/combiningcollections/CombiningListsUnitTest.java (96%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/combiningcollections/CombiningMapsUnitTest.java (96%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/combiningcollections/CombiningSetsUnitTest.java (96%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung/java => core-java-collections-2/src/test/java/com/baeldung/collections}/filtering/CollectionFiltersUnitTest.java (98%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung/java/iterable => core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize}/IterableSizeUnitTest.java (96%) rename core-java-modules/{core-java-collections/src/test/java/org/baeldung/java/collections => core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit}/CollectionsJoinAndSplitJUnitTest.java (97%) rename core-java-modules/{core-java-collections/src/test/java/org/baeldung/java/collections => core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit}/JoinSplitCollectionsUnitTest.java (99%) rename core-java-modules/{core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java => core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java} (98%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java (95%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java (95%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java (95%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/removal/RemovalUnitTest.java (98%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-2/src/test/java/com/baeldung/collections}/shufflingcollections/ShufflingCollectionsUnitTest.java (97%) rename core-java-modules/{core-java-collections/src/test/java/org/baeldung/java => core-java-collections-2/src/test/java/com/baeldung/collections}/sorting/Employee.java (96%) rename core-java-modules/{core-java-collections/src/test/java/org/baeldung/java => core-java-collections-2/src/test/java/com/baeldung/collections}/sorting/JavaSortingUnitTest.java (99%) create mode 100644 core-java-modules/core-java-collections-3/README.md create mode 100644 core-java-modules/core-java-collections-3/pom.xml rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/performance => core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector}/ArrayListBenchmark.java (98%) create mode 100644 core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java/list => core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector}/VectorExample.java (92%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/performance => core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance}/CollectionsBenchmark.java (96%) create mode 100644 core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java rename core-java-modules/{core-java-collections/src/main/java/com/baeldung => core-java-collections-3/src/main/java/com/baeldung/collections}/iterators/Iterators.java (97%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/performance => core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison}/ArraySortBenchmark.java (97%) rename core-java-modules/{core-java-collections/src/main/java/com/baeldung/java/sort => core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison}/CollectionsSortCompare.java (94%) rename core-java-modules/{core-java-collections-list/src/test/java/com/baeldung/collection => core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall}/ClearVsRemoveAllUnitTest.java (95%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-3/src/test/java/com/baeldung/collections}/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java (98%) rename core-java-modules/{core-java-collections/src/test/java/com/baeldung => core-java-collections-3/src/test/java/com/baeldung/collections}/iterators/IteratorsUnitTest.java (77%) rename core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/{application => }/Application.java (90%) delete mode 100644 core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java rename core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/{test => }/SynchronizedCollectionUnitTest.java (94%) rename core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/{test => }/SynchronizedListUnitTest.java (97%) rename core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/{test => }/SynchronizedMapUnitTest.java (94%) rename core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/{test => }/SynchronizedSetUnitTest.java (93%) rename core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/{test => }/SynchronizedSortedMapUnitTest.java (94%) rename core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/{test => }/SynchronizedSortedSetUnitTest.java (94%) delete mode 100644 core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md diff --git a/core-java-modules/core-java-collections-2/README.md b/core-java-modules/core-java-collections-2/README.md new file mode 100644 index 0000000000..13ca191edb --- /dev/null +++ b/core-java-modules/core-java-collections-2/README.md @@ -0,0 +1,15 @@ +========= + +## Core Java Collections Cookbooks and Examples + +### Relevant Articles: +- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements) +- [How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering) +- [Join and Split Arrays and Collections in Java](https://www.baeldung.com/java-join-and-split) +- [Java – Combine Multiple Collections](https://www.baeldung.com/java-combine-multiple-collections) +- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections) +- [Shuffling Collections In Java](https://www.baeldung.com/java-shuffle-collection) +- [Sorting in Java](https://www.baeldung.com/java-sorting) +- [Getting the Size of an Iterable in Java](https://www.baeldung.com/java-iterable-size) +- [Java Null-Safe Streams from Collections](https://www.baeldung.com/java-null-safe-streams-from-collections) + diff --git a/core-java-modules/core-java-collections-2/pom.xml b/core-java-modules/core-java-collections-2/pom.xml new file mode 100644 index 0000000000..0ac53ec180 --- /dev/null +++ b/core-java-modules/core-java-collections-2/pom.xml @@ -0,0 +1,58 @@ + + 4.0.0 + core-java-collections-2 + 0.0.1-SNAPSHOT + core-java-collections-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.eclipse.collections + eclipse-collections + ${eclipse.collections.version} + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + org.apache.commons + commons-exec + ${commons-exec.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + + + + 7.1.0 + 4.1 + 3.11.1 + 1.2.0 + 1.3 + + diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java similarity index 95% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java index 2ad48033c0..5f63123f6a 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.Arrays; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java index 3fdf672758..a45e9cdfe8 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java index d8bbd01ed3..d4d21d0dad 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.Collection; import java.util.HashMap; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java index 5f531c1d43..27a5681eee 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.Collection; import java.util.HashSet; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java index 58f9f6af54..de5158e147 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java index 981d6ca241..a7b78b1f9b 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java index 88338fd6d4..0a2a782c33 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java similarity index 95% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java index f074f74199..a9fb8481e5 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; import java.util.function.Predicate; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java similarity index 97% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java index 03864f16f2..b96e2bb571 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java @@ -1,4 +1,4 @@ -package com.baeldung.java.iterable; +package com.baeldung.collections.iterablesize; import java.util.Collection; import java.util.stream.StreamSupport; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java similarity index 92% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java index 2405c26aac..ce5cbb39d6 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Collection; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java similarity index 92% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java index da767d4563..68d51c2d87 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Collection; import java.util.Optional; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java index 0c10f1cebc..6c606ebedd 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Collection; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java index 2f5e91596f..4089382376 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java similarity index 93% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java index 86b91b3fdc..d551b04eae 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java similarity index 93% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java index bf6db68bae..e0dc75f428 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java similarity index 95% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java index c77e996616..c01c334f01 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java index 3b80d773ad..312f5582ba 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.junit.Assert.*; import org.junit.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java index c5851d7daf..5443e56e5f 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java index 3fa9cc7dc4..644f178f80 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java index 330827bdc2..c9976eb6de 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java @@ -1,5 +1,5 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java index b30805d471..db387818b8 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java index 4bc413dee0..35702a74b3 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.iterable; +package com.baeldung.collections.iterablesize; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java index c288cf499d..1904fd1587 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections.joinsplit; import java.util.ArrayList; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java similarity index 99% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java index c594529f41..1fbe210ad4 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections.joinsplit; import org.junit.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java index d43075c925..ebef8d6875 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections.multiplecollections; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -14,7 +14,7 @@ import java.util.stream.Stream; import static java.util.Arrays.asList; -public class CollectionsConcatenateUnitTest { +public class CombineMultipleCollectionsUnitTest { @Test public void givenUsingJava8_whenConcatenatingUsingConcat_thenCorrect() { diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java index 875045946d..42cda7926c 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Arrays; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java index 402f1a6a19..666d5e7d04 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Arrays; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java index bb6152371d..2e8eeb35ad 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Arrays; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java index 1b379f32de..998dbe6cca 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import org.junit.Before; import org.junit.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java index d013907c9a..041e67ba7f 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.shufflingcollections; +package com.baeldung.collections.shufflingcollections; import org.junit.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java index 99af49c8d3..e838dbea18 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java @@ -1,4 +1,4 @@ -package org.baeldung.java.sorting; +package com.baeldung.collections.sorting; public class Employee implements Comparable { diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java similarity index 99% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java index ca9c9b4b5d..2505adcea7 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.sorting; +package com.baeldung.collections.sorting; import com.google.common.primitives.Ints; import org.apache.commons.lang3.ArrayUtils; diff --git a/core-java-modules/core-java-collections-3/README.md b/core-java-modules/core-java-collections-3/README.md new file mode 100644 index 0000000000..9218384640 --- /dev/null +++ b/core-java-modules/core-java-collections-3/README.md @@ -0,0 +1,11 @@ +========= + +## Core Java Collections Cookbooks and Examples + +### Relevant Articles: +- [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint) +- [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector) +- [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences) +- [Differences Between Collection.clear() and Collection.removeAll()](https://www.baeldung.com/java-collection-clear-vs-removeall) +- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance) +- [Fail-Safe Iterator vs Fail-Fast Iterator](https://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator) diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml new file mode 100644 index 0000000000..84c7865e68 --- /dev/null +++ b/core-java-modules/core-java-collections-3/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + core-java-collections-3 + 0.1.0-SNAPSHOT + core-java-collections-3 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.openjdk.jmh + jmh-core + ${openjdk.jmh.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 1.19 + 3.11.1 + + diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java similarity index 98% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java index 331ae8d908..7fcadf019c 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java @@ -1,4 +1,4 @@ -package com.baeldung.performance; +package com.baeldung.collections.arraylistvsvector; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.runner.Runner; diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java new file mode 100644 index 0000000000..02f25a7558 --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java @@ -0,0 +1,55 @@ +package com.baeldung.collections.arraylistvsvector; + +public class Employee { + + private Long id; + private String name; + + public Employee(Long id, String name) { + this.name = name; + this.id = id; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Employee employee = (Employee) o; + + if (!id.equals(employee.id)) return false; + return name.equals(employee.name); + + } + + @Override + public int hashCode() { + int result = id.hashCode(); + result = 31 * result + name.hashCode(); + return result; + } + + @Override + public String toString() { + return "Employee{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java similarity index 92% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java index 7debc07911..e82e47cdbb 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java @@ -1,4 +1,4 @@ -package com.baeldung.java.list; +package com.baeldung.collections.arraylistvsvector; import java.util.Enumeration; import java.util.Iterator; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java index 921e1608ea..76edd10e92 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java @@ -1,4 +1,4 @@ -package com.baeldung.performance; +package com.baeldung.collections.containsperformance; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.runner.Runner; diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java new file mode 100644 index 0000000000..6c60f8772c --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java @@ -0,0 +1,55 @@ +package com.baeldung.collections.containsperformance; + +public class Employee { + + private Long id; + private String name; + + public Employee(Long id, String name) { + this.name = name; + this.id = id; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Employee employee = (Employee) o; + + if (!id.equals(employee.id)) return false; + return name.equals(employee.name); + + } + + @Override + public int hashCode() { + int result = id.hashCode(); + result = 31 * result + name.hashCode(); + return result; + } + + @Override + public String toString() { + return "Employee{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java similarity index 97% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java index 5e7cfdb54f..23e6bbda77 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java @@ -1,4 +1,4 @@ -package com.baeldung.iterators; +package com.baeldung.collections.iterators; import java.util.ArrayList; import java.util.Iterator; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java similarity index 97% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java index b93f8e9cc2..1cd56aa29d 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java @@ -1,4 +1,4 @@ -package com.baeldung.performance; +package com.baeldung.collections.sortingcomparison; import java.util.Arrays; import java.util.concurrent.TimeUnit; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java similarity index 94% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java index 1eff522877..abe7a12a00 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java @@ -1,4 +1,4 @@ -package com.baeldung.java.sort; +package com.baeldung.collections.sortingcomparison; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java index 8b0a7ef0db..9cd9c6aa50 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.collection; +package com.baeldung.collections.clearvsremoveall; import org.junit.jupiter.api.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java index 5218332d60..b00a7fd953 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.hashmapvshashtable; +package com.baeldung.collections.hashmapvshashtable; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java similarity index 77% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java index 36e1f4a83c..95cf590857 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java @@ -1,8 +1,8 @@ -package com.baeldung.iterators; +package com.baeldung.collections.iterators; -import static com.baeldung.iterators.Iterators.failFast1; -import static com.baeldung.iterators.Iterators.failFast2; -import static com.baeldung.iterators.Iterators.failSafe1; +import static com.baeldung.collections.iterators.Iterators.failFast1; +import static com.baeldung.collections.iterators.Iterators.failFast2; +import static com.baeldung.collections.iterators.Iterators.failSafe1; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/core-java-modules/core-java-collections-list/README.md b/core-java-modules/core-java-collections-list/README.md index e83fcce5ff..1542a352fe 100644 --- a/core-java-modules/core-java-collections-list/README.md +++ b/core-java-modules/core-java-collections-list/README.md @@ -11,4 +11,5 @@ - [Remove the First Element from a List](http://www.baeldung.com/java-remove-first-element-from-list) - [How to Find an Element in a List with Java](http://www.baeldung.com/find-list-element-java) - [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max) -- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list) \ No newline at end of file +- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list) +- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element) diff --git a/core-java-modules/core-java-collections/README.md b/core-java-modules/core-java-collections/README.md index b34293769d..7be7d02b3f 100644 --- a/core-java-modules/core-java-collections/README.md +++ b/core-java-modules/core-java-collections/README.md @@ -3,29 +3,13 @@ ## Core Java Collections Cookbooks and Examples ### Relevant Articles: -- [Java – Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections) -- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection) -- [Introduction to the Java ArrayDeque](http://www.baeldung.com/java-array-deque) -- [Getting the Size of an Iterable in Java](http://www.baeldung.com/java-iterable-size) -- [How to Filter a Collection in Java](http://www.baeldung.com/java-collection-filtering) -- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element) -- [Fail-Safe Iterator vs Fail-Fast Iterator](http://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator) -- [Shuffling Collections In Java](http://www.baeldung.com/java-shuffle-collection) -- [An Introduction to Java.util.Hashtable Class](http://www.baeldung.com/java-hash-table) -- [Java Null-Safe Streams from Collections](https://www.baeldung.com/java-null-safe-streams-from-collections) +- [Collect a Java Stream to an Immutable Collection](https://www.baeldung.com/java-stream-immutable-collection) +- [Introduction to the Java ArrayDeque](https://www.baeldung.com/java-array-deque) +- [An Introduction to Java.util.Hashtable Class](https://www.baeldung.com/java-hash-table) - [Thread Safe LIFO Data Structure Implementations](https://www.baeldung.com/java-lifo-thread-safe) -- [Differences Between Collection.clear() and Collection.removeAll()](https://www.baeldung.com/java-collection-clear-vs-removeall) -- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance) - [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity) -- [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) -- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) -- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements) -- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections) -- [Sorting in Java](http://www.baeldung.com/java-sorting) -- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) - [A Guide to EnumMap](https://www.baeldung.com/java-enum-map) -- [A Guide to Iterator in Java](http://www.baeldung.com/java-iterator) -- [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences) -- [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector) +- [A Guide to Iterator in Java](https://www.baeldung.com/java-iterator) - [Defining a Char Stack in Java](https://www.baeldung.com/java-char-stack) -- [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint) +- [Guide to the Java Queue Interface](https://www.baeldung.com/java-queue) +- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) diff --git a/core-java-modules/core-java-collections/pom.xml b/core-java-modules/core-java-collections/pom.xml index e5b89c3d16..7fd702845b 100644 --- a/core-java-modules/core-java-collections/pom.xml +++ b/core-java-modules/core-java-collections/pom.xml @@ -14,33 +14,12 @@ - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.eclipse.collections - eclipse-collections - ${eclipse.collections.version} - org.assertj assertj-core ${assertj.version} test - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - org.openjdk.jmh jmh-core @@ -51,11 +30,6 @@ jmh-generator-annprocess ${openjdk.jmh.version} - - org.apache.commons - commons-exec - ${commons-exec.version} - org.projectlombok lombok @@ -66,13 +40,6 @@ 1.19 - 1.2.0 - 3.8.1 - 4.1 - 4.01 - 1.7.0 3.11.1 - 7.1.0 - 1.3 diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java similarity index 90% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java rename to core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java index 093308a34a..f974a24839 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java +++ b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.application; +package com.baeldung.synchronizedcollections; import java.util.Arrays; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java deleted file mode 100644 index d0d8c3923c..0000000000 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.baeldung.java.collections; - -import org.junit.Test; - -import java.util.*; -import java.util.concurrent.CopyOnWriteArrayList; - -import static java.util.Arrays.asList; -import static org.junit.Assert.assertEquals; - -public class ConcurrentModificationExceptionUnitTest { - - @Test - public void changingContentWithSetDoesNotThrowConcurrentModificationException() throws Exception { - ArrayList array = new ArrayList<>(asList(0, "one", 2, "three")); - - for (Object item : array) { - array.set(3, 3); - } - } - - @Test - public void removingElementUsingIteratorAPI() throws Exception { - List originalList = new ArrayList<>(asList("zero", "one", "two", "three")); - - Iterator iterator = originalList.iterator(); - - while (iterator.hasNext()) { - String next = iterator.next(); - if (Objects.equals(next, "one")) iterator.remove(); - } - - assertEquals(originalList, asList("zero", "two", "three")); - } - - @Test - public void modifyingContentAndIteratingUsingListIteratorAPI() throws Exception { - List originalList = new ArrayList<>(asList("zero", "one", "two", "three")); - - ListIterator iterator = originalList.listIterator(); - - while (iterator.hasNext()) { - String next = iterator.next(); - if (Objects.equals(next, "one")) { - iterator.set("another"); - } - - if (Objects.equals(next, "two")) { - iterator.remove(); - } - - if (Objects.equals(next, "three")) { - iterator.add("four"); - } - } - - assertEquals(originalList, asList("zero", "another", "three", "four")); - } - - @Test - public void removingElementUsingCopyAndListAPI() throws Exception { - List originalList = new ArrayList<>(asList("zero", "one", "two", "three")); - - List listCopy = new ArrayList<>(originalList); - - for (String next : listCopy) { - if (Objects.equals(next, "one")) originalList.remove(originalList.indexOf(next) - 1); - } - - assertEquals(originalList, asList("one", "two", "three")); - } - - @Test - public void copyOnWriteList() throws Exception { - List originalList = new CopyOnWriteArrayList<>(asList("zero", "one", "two", "three")); - - for (String next : originalList) { - if (Objects.equals(next, "one")) originalList.remove(originalList.indexOf(next) - 1); - } - - assertEquals(originalList, asList("one", "two", "three")); - } -} diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedCollectionUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedCollectionUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedCollectionUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedCollectionUnitTest.java index fd84503226..29b1ab9e70 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedCollectionUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedCollectionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedListUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedListUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedListUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedListUnitTest.java index 72354622ae..0e3c9cd217 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedListUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedListUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedMapUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedMapUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedMapUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedMapUnitTest.java index 842e253e9e..9a4d80b403 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedMapUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Collections; import java.util.HashMap; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSetUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSetUnitTest.java similarity index 93% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSetUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSetUnitTest.java index f88f58a55b..88fd343f56 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSetUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSetUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Arrays; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedMapUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedMapUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedMapUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedMapUnitTest.java index 23933b2b4b..7cbfa9bfa9 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedMapUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Collections; import java.util.Map; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedSetUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedSetUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedSetUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedSetUnitTest.java index 3ce1e6ed26..98820665c1 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedSetUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedSetUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Arrays; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md b/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md deleted file mode 100644 index 317d81fae7..0000000000 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: -- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) -- [Introduction to Java Servlets](http://www.baeldung.com/intro-to-servlets) diff --git a/pom.xml b/pom.xml index 6972736288..89786496c7 100644 --- a/pom.xml +++ b/pom.xml @@ -401,6 +401,8 @@ core-java-modules/core-java-arrays core-java-modules/core-java-arrays-2 core-java-modules/core-java-collections + core-java-modules/core-java-collections-2 + core-java-modules/core-java-collections-3 core-java-modules/core-java-collections-list core-java-modules/core-java-collections-list-2 core-java-modules/core-java-collections-list-3 @@ -1141,6 +1143,8 @@ core-java-modules/core-java-arrays core-java-modules/core-java-arrays-2 core-java-modules/core-java-collections + core-java-modules/core-java-collections-2 + core-java-modules/core-java-collections-3 core-java-modules/core-java-collections-list core-java-modules/core-java-collections-list-2 core-java-modules/core-java-collections-list-3 From 7f56b97a7dd7c805ad8b2c2cc1aea739dad7706b Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 27 Sep 2019 19:20:31 +0530 Subject: [PATCH 060/107] BAEL-11102 Fix the integrations tests in spring-5-reactive (#7869) --- .../reactive/errorhandling/ErrorHandlingIntegrationTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java index 42da90ecd5..3bbbed0d77 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/errorhandling/ErrorHandlingIntegrationTest.java @@ -12,11 +12,13 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; @RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) +@DirtiesContext @WithMockUser @AutoConfigureWebTestClient(timeout = "10000") public class ErrorHandlingIntegrationTest { From 6d499542a1ee22c2201d584efa58aad18c808b91 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 27 Sep 2019 19:21:32 +0530 Subject: [PATCH 061/107] BAEL-17355 Fix the integrations tests in spring-boot-properties (#7865) - Committing initial value correctly --- spring-boot-properties/extra.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-properties/extra.properties b/spring-boot-properties/extra.properties index 51874a0415..8e28a6f889 100644 --- a/spring-boot-properties/extra.properties +++ b/spring-boot-properties/extra.properties @@ -1 +1 @@ -application.theme.color=red \ No newline at end of file +application.theme.color=blue \ No newline at end of file From afda4464417d905d051cce5c2125a3fd3248f81c Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 27 Sep 2019 19:22:22 +0530 Subject: [PATCH 062/107] BAEL-17701 Fix the integrations tests in spring-jooq (#7868) --- spring-jooq/src/test/resources/application.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-jooq/src/test/resources/application.properties b/spring-jooq/src/test/resources/application.properties index dc5d81acfb..ef37552bf0 100644 --- a/spring-jooq/src/test/resources/application.properties +++ b/spring-jooq/src/test/resources/application.properties @@ -1,2 +1,4 @@ -spring.datasource.url=jdbc:h2:tcp:~/jooq;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE +spring.datasource.url=jdbc:h2:~/jooq;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE +spring.datasource.username=sa +spring.datasource.password= spring.jpa.hibernate.ddl-auto=update From 80a30cf9c6380bbd736db3925de6506855cde9c5 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 27 Sep 2019 14:54:57 +0100 Subject: [PATCH 063/107] [BAEL-17492] Add README descriptions 8 (#7840) * [BAEL-17492] Add README descriptions 8 * Small changes * monospaced the word --- spring-di/README.md | 4 ++++ spring-drools/README.md | 4 ++++ spring-ehcache/README.md | 5 +++-- spring-ejb/README.md | 4 ++++ spring-exceptions/README.md | 7 ++----- spring-freemarker/README.md | 5 ++--- spring-groovy/README.md | 4 ++++ spring-integration/README.md | 4 ++++ spring-jenkins-pipeline/README.md | 13 +++++++++---- spring-jersey/README.md | 4 +++- 10 files changed, 39 insertions(+), 15 deletions(-) diff --git a/spring-di/README.md b/spring-di/README.md index 59651751ee..17f50ba410 100644 --- a/spring-di/README.md +++ b/spring-di/README.md @@ -1,3 +1,7 @@ +## Spring Dependency Injection + +This module contains articles about dependency injection with Spring + ### Relevant Articles - [The Spring @Qualifier Annotation](https://www.baeldung.com/spring-qualifier-annotation) diff --git a/spring-drools/README.md b/spring-drools/README.md index 00b35a4624..3685a399bc 100644 --- a/spring-drools/README.md +++ b/spring-drools/README.md @@ -1,3 +1,7 @@ +## Spring Drools + +This modules contains articles about Spring with Drools + ## Relevant articles: - [Drools Spring Integration](http://www.baeldung.com/drools-spring-integration) diff --git a/spring-ehcache/README.md b/spring-ehcache/README.md index ecf96cd7c7..da7376e476 100644 --- a/spring-ehcache/README.md +++ b/spring-ehcache/README.md @@ -1,7 +1,8 @@ -## Spring Ehcache Example Project +## Spring Ehcache -A simple example of using ehcache with spring-boot. +This module contains articles about Spring with Ehcache ### Relevant Articles: + - [Spring Boot Ehcache Example](https://www.baeldung.com/spring-boot-ehcache) diff --git a/spring-ejb/README.md b/spring-ejb/README.md index 58ccb20e70..f475aafc7f 100644 --- a/spring-ejb/README.md +++ b/spring-ejb/README.md @@ -1,3 +1,7 @@ +## Spring EJB + +This module contains articles about Spring with EJB + ### Relevant Articles - [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro) diff --git a/spring-exceptions/README.md b/spring-exceptions/README.md index b9472c4cca..026e8485c8 100644 --- a/spring-exceptions/README.md +++ b/spring-exceptions/README.md @@ -1,10 +1,7 @@ -========= +## Spring `Exception`s -## Spring Exceptions Example Project +This module contains articles about Spring `Exception`s -This project is used to replicate Spring Exceptions only. - - ### Relevant articles: - [Spring BeanCreationException](http://www.baeldung.com/spring-beancreationexception) - [Spring DataIntegrityViolationException](http://www.baeldung.com/spring-dataIntegrityviolationexception) diff --git a/spring-freemarker/README.md b/spring-freemarker/README.md index bd939d11e9..ce8fb78f4d 100644 --- a/spring-freemarker/README.md +++ b/spring-freemarker/README.md @@ -1,7 +1,6 @@ -========= - -## Using FreeMarker in Spring MVC +## Spring FreeMarker +This module contains articles about Spring with FreeMarker ### Relevant Articles: - [Introduction to Using FreeMarker in Spring MVC](http://www.baeldung.com/freemarker-in-spring-mvc-tutorial) diff --git a/spring-groovy/README.md b/spring-groovy/README.md index 36404230a9..c3bb5636ba 100644 --- a/spring-groovy/README.md +++ b/spring-groovy/README.md @@ -1,3 +1,7 @@ +## Spring Groovy + +This module contains articles about Spring with Groovy + ## Relevant Articles: - [Groovy Bean Definitions](https://www.baeldung.com/spring-groovy-beans) diff --git a/spring-integration/README.md b/spring-integration/README.md index 244cf1fb14..f2fbfe48b5 100644 --- a/spring-integration/README.md +++ b/spring-integration/README.md @@ -1,3 +1,7 @@ +## Spring Integration + +This module contains articles about Spring Integration + ### Relevant Articles: - [Introduction to Spring Integration](http://www.baeldung.com/spring-integration) - [Security In Spring Integration](http://www.baeldung.com/spring-integration-security) diff --git a/spring-jenkins-pipeline/README.md b/spring-jenkins-pipeline/README.md index 8c10e85da2..0086ae256d 100644 --- a/spring-jenkins-pipeline/README.md +++ b/spring-jenkins-pipeline/README.md @@ -1,5 +1,12 @@ -BASIC CRUD API with Spring Boot -================================ +## Spring Jenkins + +This module contains articles about Spring with Jenkins + +### Relevant articles + +- [Intro to Jenkins 2 and the Power of Pipelines](http://www.baeldung.com/jenkins-pipelines) + +## Basic CRUD API with Spring Boot This is the code of a simple API for some CRUD operations build using Spring Boot. @@ -21,6 +28,4 @@ Now with default configurations it will be available at: [http://localhost:8080] Enjoy it :) -### Relevant articles -- [Intro to Jenkins 2 and the Power of Pipelines](http://www.baeldung.com/jenkins-pipelines) diff --git a/spring-jersey/README.md b/spring-jersey/README.md index 37928620d3..6adc5f1375 100644 --- a/spring-jersey/README.md +++ b/spring-jersey/README.md @@ -1,4 +1,6 @@ -========= +## Spring Jersey + +This module contains articles about Spring with Jersey ## REST API with Jersey & Spring Example Project - [REST API with Jersey and Spring](http://www.baeldung.com/jersey-rest-api-with-spring) From 950226e8f00e5c3da60f666e0c11b07037937a91 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 27 Sep 2019 14:58:00 +0100 Subject: [PATCH 064/107] [BAEL-17476] Add README descriptions 17 (#7877) * [BAEL-17476] Add README descriptions 17 * Removed 'with' in spring security kerberos readme --- java-blockchain/README.md | 7 ++++--- spring-boot-di/README.MD | 4 ++++ spring-boot-flowable/README.md | 4 ++++ spring-boot-nashorn/README.md | 9 +++++++-- spring-security-kerberos/README.md | 17 ++++++++++------- tensorflow-java/README.md | 4 ++++ wicket/README.md | 15 ++++++++++----- xml/README.md | 4 ++++ xstream/README.md | 4 ++++ 9 files changed, 51 insertions(+), 17 deletions(-) diff --git a/java-blockchain/README.md b/java-blockchain/README.md index 600f4dd610..5afd0d356b 100644 --- a/java-blockchain/README.md +++ b/java-blockchain/README.md @@ -1,6 +1,7 @@ -========= +## Java Blockchain -## Basic Implementation of Blockchian in Java +This module contains articles about Blockchain in Java ### Relevant Articles: -- []() + +- [Implementing a Simple Blockchain in Java](https://www.baeldung.com/java-blockchain) diff --git a/spring-boot-di/README.MD b/spring-boot-di/README.MD index 78cd163668..6e2c495b88 100644 --- a/spring-boot-di/README.MD +++ b/spring-boot-di/README.MD @@ -1,3 +1,7 @@ +## Spring Boot Dependency Inject + +This module contains articles about dependency injection with Spring Boot + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring diff --git a/spring-boot-flowable/README.md b/spring-boot-flowable/README.md index 8fb90d953b..884ddb7ec6 100644 --- a/spring-boot-flowable/README.md +++ b/spring-boot-flowable/README.md @@ -1,3 +1,7 @@ +## Spring Boot Flowable + +This module contains articles about Flowable in Boot applications + ### Relevant articles - [Introduction to Flowable](http://www.baeldung.com/flowable) diff --git a/spring-boot-nashorn/README.md b/spring-boot-nashorn/README.md index 1ca43927ee..f24adfe8e8 100644 --- a/spring-boot-nashorn/README.md +++ b/spring-boot-nashorn/README.md @@ -1,3 +1,8 @@ -### Relevant Articles: -- []() +## Spring Boot Nashorn + +This module contains articles about Spring Boot with Nashorn + +### Relevant Articles: + +- [Isomorphic Application with React and Nashorn](https://www.baeldung.com/react-nashorn-isomorphic-app) diff --git a/spring-security-kerberos/README.md b/spring-security-kerberos/README.md index 1b77c380db..a868fb86b7 100644 --- a/spring-security-kerberos/README.md +++ b/spring-security-kerberos/README.md @@ -1,10 +1,13 @@ -## @PreFilter and @PostFilter annotations +## Spring Security Kerberos + +This module contains articles about Spring Security Kerberos + +### Relevant Articles: + +- [Introduction to SPNEGO/Kerberos Authentication in Spring](https://www.baeldung.com/spring-security-kerberos) + +### @PreFilter and @PostFilter annotations ### Build the Project ### -``` -mvn clean install -``` - -### Relevant Articles: -- [Introduction to SPNEGO/Kerberos Authentication in Spring](https://www.baeldung.com/spring-security-kerberos) +`mvn clean install` \ No newline at end of file diff --git a/tensorflow-java/README.md b/tensorflow-java/README.md index f826375ac1..b96e4a83db 100644 --- a/tensorflow-java/README.md +++ b/tensorflow-java/README.md @@ -1,3 +1,7 @@ +## Tensorflow + +This module contains articles about Tensorflow + ## Relevant articles: - [Introduction to Tensorflow for Java](https://www.baeldung.com/tensorflow-java) diff --git a/wicket/README.md b/wicket/README.md index e873ee1ba1..91fab2a364 100644 --- a/wicket/README.md +++ b/wicket/README.md @@ -1,8 +1,13 @@ +## Wicket + +This module contains articles about Wicket + +### Relevant Articles + +- [Introduction to the Wicket Framework](http://www.baeldung.com/intro-to-the-wicket-framework) + +### Execution From the same directory where pom.xml is, execute the following command to run the project: -mvn jetty:run - - -###Relevant Articles: -- [Introduction to the Wicket Framework](http://www.baeldung.com/intro-to-the-wicket-framework) +mvn jetty:run \ No newline at end of file diff --git a/xml/README.md b/xml/README.md index c24fe3e785..f125955089 100644 --- a/xml/README.md +++ b/xml/README.md @@ -1,3 +1,7 @@ +## XML + +This module contains articles about eXtensible Markup Language (XML) + ### Relevant Articles: - [Intro to XPath with Java](http://www.baeldung.com/java-xpath) - [Introduction to JiBX](http://www.baeldung.com/jibx) diff --git a/xstream/README.md b/xstream/README.md index bf917e81fb..62996132c8 100644 --- a/xstream/README.md +++ b/xstream/README.md @@ -1,3 +1,7 @@ +## XStream + +This module contains articles about XStream + ## Relevant Articles: - [XStream User Guide: JSON](http://www.baeldung.com/xstream-json-processing) From 3604e6096da853e2ad1dc5a1a95b7a0fe76d95f1 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 27 Sep 2019 14:59:13 +0100 Subject: [PATCH 065/107] [BAEL-17476] - Add README descriptions 16 (#7876) * [BAEL-17476] - Add README descriptions 16 * Updated VRaptor --- structurizr/README.md | 4 ++++ struts-2/README.md | 4 ++++ testing-modules/README.md | 3 +-- twilio/README.md | 2 ++ twitter4j/README.md | 4 ++++ undertow/README.md | 4 ++++ vertx-and-rxjava/README.md | 4 ++++ vertx/README.md | 4 ++++ vraptor/README.md | 24 +++++++++++++++++++----- 9 files changed, 46 insertions(+), 7 deletions(-) diff --git a/structurizr/README.md b/structurizr/README.md index e596dfa458..90ce49b482 100644 --- a/structurizr/README.md +++ b/structurizr/README.md @@ -1,2 +1,6 @@ +## Structurizr + +This module contains articles about Structurizr + ### Relevant Articles: - [Intro to Structurizr](http://www.baeldung.com/structurizr) diff --git a/struts-2/README.md b/struts-2/README.md index 8a1425ccb5..6121ab3166 100644 --- a/struts-2/README.md +++ b/struts-2/README.md @@ -1,3 +1,7 @@ +## Struts 2 + +This module contains articles about Struts 2 + ### Relevant articles - [A Quick Struts 2 Intro](http://www.baeldung.com/struts-2-intro) diff --git a/testing-modules/README.md b/testing-modules/README.md index 21fc87a67f..c6098d1210 100644 --- a/testing-modules/README.md +++ b/testing-modules/README.md @@ -1,4 +1,3 @@ - ## Testing Modules -This is a aggregator module containing several modules focused on testing libraries. +This is an aggregator module containing multiple modules focused on testing libraries. diff --git a/twilio/README.md b/twilio/README.md index 9d230610c7..b098473fa9 100644 --- a/twilio/README.md +++ b/twilio/README.md @@ -1,4 +1,6 @@ +## Twilio +This module contains articles about Twilio ### Relevant Articles: diff --git a/twitter4j/README.md b/twitter4j/README.md index 3057c1c4b2..0f58240538 100644 --- a/twitter4j/README.md +++ b/twitter4j/README.md @@ -1,3 +1,7 @@ +## Twitter4J + +This module contains articles about Twitter4J + ### Relevant articles - [Introduction to Twitter4J](http://www.baeldung.com/twitter4j) diff --git a/undertow/README.md b/undertow/README.md index 8bfb4832e2..ceec806bd4 100644 --- a/undertow/README.md +++ b/undertow/README.md @@ -1,2 +1,6 @@ +## Undertow + +This module contains articles about JBoss Undertow + ### Relevant Articles: - [Introduction to JBoss Undertow](http://www.baeldung.com/jboss-undertow) diff --git a/vertx-and-rxjava/README.md b/vertx-and-rxjava/README.md index ccd4ce3457..6d217426e0 100644 --- a/vertx-and-rxjava/README.md +++ b/vertx-and-rxjava/README.md @@ -1,2 +1,6 @@ +## Vert.x and RxJava + +This module contains articles about RxJava with Vert.x + ### Relevant articles - [Example of Vertx and RxJava Integration](http://www.baeldung.com/vertx-rx-java) diff --git a/vertx/README.md b/vertx/README.md index e710df362d..fffc0afd62 100644 --- a/vertx/README.md +++ b/vertx/README.md @@ -1,3 +1,7 @@ +## Vert.x + +This module contains articles about Vert.x + ### Relevant articles - [Introduction to Vert.x](http://www.baeldung.com/vertx) diff --git a/vraptor/README.md b/vraptor/README.md index 0dc531ba8d..c5a7128922 100644 --- a/vraptor/README.md +++ b/vraptor/README.md @@ -1,18 +1,32 @@ +## VRaptor + +This module contains articles about VRaptor + +### Relevant Article: + +- [Introduction to VRaptor in Java](http://www.baeldung.com/vraptor) + # VRaptor blank project This is a blank project to help you to use VRaptor. You can easily import in you IDE as Maven project. +### Instructions + +After creating your project, you can run it using Tomcat 7 or higher: + +`mvn tomcat7:run` + +Take care to never run `mvn tomcat:run` since that will use Tomcat 6, which isn't compatible with VRaptor. + +### Em Português + Este é um projeto em branco para ajudar você a usar o VRaptor. Você pode facilmente importá-lo na sua IDE favorita como um projeto Maven. Após criar seu projeto você pode rodá-lo com um tomcat7 ou +: -``` -mvn tomcat7:run -``` +`mvn tomcat7:run` Cuidado para *jamais* executar `mvn tomcat:run` pois ele usará um tomcat6 (incompatível). -### Relevant Article: -- [Introduction to VRaptor in Java](http://www.baeldung.com/vraptor) From cd032c9d73a9a7b27c337273005fc7ac79ada0cd Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 27 Sep 2019 15:01:25 +0100 Subject: [PATCH 066/107] [BAEL-17476] - Add README descriptions 1 (#7881) --- parent-boot-1/README.md | 1 + parent-boot-2/README.md | 1 + parent-java/README.md | 4 +++- parent-kotlin/README.md | 3 ++- parent-spring-4/README.md | 4 +++- parent-spring-5/README.md | 4 +++- saas/README.md | 4 ++++ spark-java/README.md | 4 ++-- spring-4/README.md | 4 ++++ spring-5/README.md | 4 +++- 10 files changed, 26 insertions(+), 7 deletions(-) diff --git a/parent-boot-1/README.md b/parent-boot-1/README.md index 8b312c348a..5ad14c6519 100644 --- a/parent-boot-1/README.md +++ b/parent-boot-1/README.md @@ -1,2 +1,3 @@ +## Parent Boot 1 This is a parent module for all projects using Spring Boot 1. diff --git a/parent-boot-2/README.md b/parent-boot-2/README.md index 3f18bdf38e..7afe447a66 100644 --- a/parent-boot-2/README.md +++ b/parent-boot-2/README.md @@ -1,2 +1,3 @@ +## Parent Boot 2 This is a parent module for all projects using Spring Boot 2. diff --git a/parent-java/README.md b/parent-java/README.md index 729105e3fd..1b14b7cfc1 100644 --- a/parent-java/README.md +++ b/parent-java/README.md @@ -1 +1,3 @@ -## Relevant Articles: +## Parent Java + +This is a parent module for all projects using Java \ No newline at end of file diff --git a/parent-kotlin/README.md b/parent-kotlin/README.md index 6c17a6ac29..c78ecbac42 100644 --- a/parent-kotlin/README.md +++ b/parent-kotlin/README.md @@ -1,2 +1,3 @@ +## Parent Kotlin -Parent module for Kotlin projects. +This is a parent module for all projects using Kotlin diff --git a/parent-spring-4/README.md b/parent-spring-4/README.md index 729105e3fd..f14d003dd5 100644 --- a/parent-spring-4/README.md +++ b/parent-spring-4/README.md @@ -1 +1,3 @@ -## Relevant Articles: +## Parent Spring 4 + +This is a parent module for all projects using Spring 4 diff --git a/parent-spring-5/README.md b/parent-spring-5/README.md index 729105e3fd..791a6ca197 100644 --- a/parent-spring-5/README.md +++ b/parent-spring-5/README.md @@ -1 +1,3 @@ -## Relevant Articles: +## Parent Spring 5 + +This is a parent module for all projects using Spring 5 diff --git a/saas/README.md b/saas/README.md index 4e0eeea974..f537c7ff95 100644 --- a/saas/README.md +++ b/saas/README.md @@ -1,3 +1,7 @@ +## SAAS + +This module contains articles about software as a service (SAAS) + ## Relevant articles: - [JIRA REST API Integration](http://www.baeldung.com/jira-rest-api) diff --git a/spark-java/README.md b/spark-java/README.md index 5abe78263c..3f16b29b9f 100644 --- a/spark-java/README.md +++ b/spark-java/README.md @@ -1,6 +1,6 @@ -========= +## Spark Java -## Spark Java Framework Tutorial Sample Project +This module contains articles about Spark ### Relevant Articles - [Building an API With the Spark Java Framework](http://www.baeldung.com/spark-framework-rest-api) diff --git a/spring-4/README.md b/spring-4/README.md index 57cb8c3eeb..5bc38d4a9d 100644 --- a/spring-4/README.md +++ b/spring-4/README.md @@ -1,3 +1,7 @@ +## Spring 4 + +This module contains articles about Spring 4 + ### Relevant Articles: - [A Guide to Flips for Spring](http://www.baeldung.com/flips-spring) - [Configuring a Hikari Connection Pool with Spring Boot](https://www.baeldung.com/spring-boot-hikari) diff --git a/spring-5/README.md b/spring-5/README.md index d3c1decbc7..7f4c643b7a 100644 --- a/spring-5/README.md +++ b/spring-5/README.md @@ -1,4 +1,6 @@ -## Spring REST Example Project +## Spring 5 + +This module contains articles about Spring 5 ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring From 5373bc17196d4353aad55588a905ad8b6c8194fa Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 27 Sep 2019 19:32:22 +0530 Subject: [PATCH 067/107] BAEL-17950 Fix the integrations tests in xml (#7882) -Fixed integration test issue and renamed the class back to *UnitTest as its not an integration test at all --- xml/pom.xml | 81 ++++++++++++++----- ...grationTest.java => CustomerUnitTest.java} | 4 +- 2 files changed, 64 insertions(+), 21 deletions(-) rename xml/src/test/java/com/baeldung/xml/jibx/{CustomerIntegrationTest.java => CustomerUnitTest.java} (94%) diff --git a/xml/pom.xml b/xml/pom.xml index d500d72454..bbd607f9b5 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -137,25 +137,68 @@ - - xml - - - src/main/resources - true - - - - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - + + xml + + + src/main/resources + true + + + + + + org.jibx + maven-jibx-plugin + + + + + + org.jibx + maven-jibx-plugin + ${maven-jibx-plugin.version} + + src/main/resources + + *-binding.xml + + + template-binding.xml + + src/main/resources + + *-binding.xml + + true + + + + process-classes + process-classes + + bind + + + + process-test-classes + process-test-classes + + test-bind + + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + diff --git a/xml/src/test/java/com/baeldung/xml/jibx/CustomerIntegrationTest.java b/xml/src/test/java/com/baeldung/xml/jibx/CustomerUnitTest.java similarity index 94% rename from xml/src/test/java/com/baeldung/xml/jibx/CustomerIntegrationTest.java rename to xml/src/test/java/com/baeldung/xml/jibx/CustomerUnitTest.java index be28dfe00a..9a4b5bc14b 100644 --- a/xml/src/test/java/com/baeldung/xml/jibx/CustomerIntegrationTest.java +++ b/xml/src/test/java/com/baeldung/xml/jibx/CustomerUnitTest.java @@ -11,7 +11,7 @@ import java.io.InputStream; import static junit.framework.Assert.assertEquals; -public class CustomerIntegrationTest { +public class CustomerUnitTest { @Test public void whenUnmarshalXML_ThenFieldsAreMapped() throws JiBXException, FileNotFoundException { @@ -21,7 +21,7 @@ public class CustomerIntegrationTest { InputStream inputStream = classLoader.getResourceAsStream("Customer1.xml"); Customer customer = (Customer) uctx.unmarshalDocument(inputStream, null); - assertEquals("Stefan Jaegar", customer.getPerson().getName()); + assertEquals("Stefan Jaeger", customer.getPerson().getName()); assertEquals("Davos Dorf", customer.getCity()); } From 2202f38699c8407b195d21fdaa94b8bbed9db269 Mon Sep 17 00:00:00 2001 From: Alessio Stalla Date: Fri, 27 Sep 2019 16:19:48 +0200 Subject: [PATCH 068/107] [BAEL-17489] Adding README descriptions to the following modules: (#7829) * [BAEL-17489] Adding README descriptions to the following modules: spring-boot-custom-starter spring-boot-disable-console-logging spring-boot-gradle spring-boot-jasypt spring-boot-keycloak spring-boot-kotlin spring-boot-logging-log4j2 spring-boot-management spring-boot-mvc spring-boot-mvc-birt * Change description of management module and add prev/next links as per new template. --- spring-boot-custom-starter/README.md | 4 ++++ spring-boot-disable-console-logging/README.md | 4 ++++ spring-boot-gradle/README.md | 4 ++++ spring-boot-jasypt/README.md | 3 +++ spring-boot-keycloak/README.md | 4 ++++ spring-boot-kotlin/README.md | 4 ++++ spring-boot-logging-log4j2/README.md | 4 ++++ spring-boot-management/README.md | 7 +++++++ spring-boot-mvc-2/README.md | 5 +++++ spring-boot-mvc-birt/README.md | 4 ++++ spring-boot-mvc/README.md | 5 +++++ 11 files changed, 48 insertions(+) create mode 100644 spring-boot-management/README.md diff --git a/spring-boot-custom-starter/README.md b/spring-boot-custom-starter/README.md index f983441ca0..9a62884ecb 100644 --- a/spring-boot-custom-starter/README.md +++ b/spring-boot-custom-starter/README.md @@ -1,3 +1,7 @@ +## Spring Boot Custom Starter + +This module contains articles about writing Spring Boot [starters](https://www.baeldung.com/spring-boot-starters). + ### Relevant Articles: - [Creating a Custom Starter with Spring Boot](http://www.baeldung.com/spring-boot-custom-starter) diff --git a/spring-boot-disable-console-logging/README.md b/spring-boot-disable-console-logging/README.md index 3d75fddc8e..7f1c06042f 100644 --- a/spring-boot-disable-console-logging/README.md +++ b/spring-boot-disable-console-logging/README.md @@ -1,2 +1,6 @@ +## Spring Boot Disable Console Logging + +This module contains articles about disabling Spring Boot console logging. + ### Relevant Articles: - [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) diff --git a/spring-boot-gradle/README.md b/spring-boot-gradle/README.md index 76b82dce02..3a64cca553 100644 --- a/spring-boot-gradle/README.md +++ b/spring-boot-gradle/README.md @@ -1,3 +1,7 @@ +## Spring Boot Gradle + +This module contains articles about Gradle in Spring Boot projects. + ### Relevant Articles: - [Spring Boot: Configuring a Main Class](http://www.baeldung.com/spring-boot-main-class) diff --git a/spring-boot-jasypt/README.md b/spring-boot-jasypt/README.md index 5df2a4a6e5..a07ca19790 100644 --- a/spring-boot-jasypt/README.md +++ b/spring-boot-jasypt/README.md @@ -1,3 +1,6 @@ +## Spring Boot Jasypt + +This module contains articles about Jasypt in Spring Boot projects. ### Relevant Articles: diff --git a/spring-boot-keycloak/README.md b/spring-boot-keycloak/README.md index cfe82c6cf7..15f0f1459c 100644 --- a/spring-boot-keycloak/README.md +++ b/spring-boot-keycloak/README.md @@ -1,2 +1,6 @@ +## Spring Boot Keycloak + +This module contains articles about Keycloak in Spring Boot projects. + ## Relevant articles: - [A Quick Guide to Using Keycloak with Spring Boot](http://www.baeldung.com/spring-boot-keycloak) diff --git a/spring-boot-kotlin/README.md b/spring-boot-kotlin/README.md index dc50c24aa0..73c312040d 100644 --- a/spring-boot-kotlin/README.md +++ b/spring-boot-kotlin/README.md @@ -1,2 +1,6 @@ +## Spring Boot Kotlin + +This module contains articles about Kotlin in Spring Boot projects. + ### Relevant Articles: - [Non-blocking Spring Boot with Kotlin Coroutines](http://www.baeldung.com/non-blocking-spring-boot-with-kotlin-coroutines) diff --git a/spring-boot-logging-log4j2/README.md b/spring-boot-logging-log4j2/README.md index ea968d7fae..2d72ab6f97 100644 --- a/spring-boot-logging-log4j2/README.md +++ b/spring-boot-logging-log4j2/README.md @@ -1,3 +1,7 @@ +## Spring Boot Logging with Log4j 2 + +This module contains articles about logging in Spring Boot projects with Log4j 2. + ### Relevant Articles: - [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging) - [Logging to Graylog with Spring Boot](https://www.baeldung.com/graylog-with-spring-boot) diff --git a/spring-boot-management/README.md b/spring-boot-management/README.md new file mode 100644 index 0000000000..53d4c439ff --- /dev/null +++ b/spring-boot-management/README.md @@ -0,0 +1,7 @@ +## Spring Boot Logging HTTP Requests + +This module contains articles about the management of Spring Boot applications. + +### Relevant Articles: +- [Logging HTTP Requests with Spring Boot Actuator HTTP Tracing](https://www.baeldung.com/spring-boot-actuator-http) + diff --git a/spring-boot-mvc-2/README.md b/spring-boot-mvc-2/README.md index f8e26f218b..0ff0f1f156 100644 --- a/spring-boot-mvc-2/README.md +++ b/spring-boot-mvc-2/README.md @@ -1,3 +1,8 @@ +## Spring Boot MVC + +This module contains articles about Spring Web MVC in Spring Boot projects. + ### Relevant Articles: - [Functional Controllers in Spring MVC](https://www.baeldung.com/spring-mvc-functional-controllers) +- More articles: [[prev -->]](/spring-boot-mvc) diff --git a/spring-boot-mvc-birt/README.md b/spring-boot-mvc-birt/README.md index 9fe3d94e2a..2c3804c745 100644 --- a/spring-boot-mvc-birt/README.md +++ b/spring-boot-mvc-birt/README.md @@ -1,3 +1,7 @@ +## Spring Boot MVC BIRT + +This module contains articles about BIRT Reporting in Spring Boot MVC projects. + ### Relevant Articles - [BIRT Reporting with Spring Boot](https://www.baeldung.com/birt-reports-spring-boot) diff --git a/spring-boot-mvc/README.md b/spring-boot-mvc/README.md index e3e3dbdb74..444d91b0e7 100644 --- a/spring-boot-mvc/README.md +++ b/spring-boot-mvc/README.md @@ -1,3 +1,7 @@ +## Spring Boot MVC + +This module contains articles about Spring Web MVC in Spring Boot projects. + ### Relevant Articles: - [Guide to the Favicon in Spring Boot](http://www.baeldung.com/spring-boot-favicon) @@ -14,3 +18,4 @@ - [Accessing Spring MVC Model Objects in JavaScript](https://www.baeldung.com/spring-mvc-model-objects-js) - [Using Spring ResponseEntity to Manipulate the HTTP Response](http://www.baeldung.com/spring-response-entity) - [Spring Bean Annotations](http://www.baeldung.com/spring-bean-annotations) +- More articles: [[next -->]](/spring-boot-mvc-2) From 9346659bbfaedc4804335e3864ccd94c512c370e Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Fri, 27 Sep 2019 15:23:20 +0100 Subject: [PATCH 069/107] re-run failing test --- spring-cloud/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud/README.md b/spring-cloud/README.md index 1cc9d9d3cf..2727aec08c 100644 --- a/spring-cloud/README.md +++ b/spring-cloud/README.md @@ -1,3 +1,3 @@ -## Spring Cloud +## Spring Cloud This module contains modules about Spring Cloud \ No newline at end of file From 2a6a8024cd1f2d362b66ae0d2b2198ad2ccf92f0 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 27 Sep 2019 15:26:02 +0100 Subject: [PATCH 070/107] [BAEL-17487] Added readme descriptions (#7796) * [BAEL-17487] Added readme descriptions * Updated descriptions * Updated spring-apache-camel readme * changed 'article' to 'articles' --- spring-5-security-cognito/README.md | 4 +++ spring-activiti/README.md | 4 +++ spring-akka/README.md | 4 +++ spring-all/README.md | 2 -- spring-amqp/README.md | 4 +++ spring-aop/README.md | 4 +++ spring-apache-camel/README.md | 39 +++++++++++------------------ spring-batch/README.md | 3 +-- spring-bom/README.md | 3 +++ spring-boot/README.MD | 4 +++ 10 files changed, 43 insertions(+), 28 deletions(-) diff --git a/spring-5-security-cognito/README.md b/spring-5-security-cognito/README.md index 0825882c05..ff2784f410 100644 --- a/spring-5-security-cognito/README.md +++ b/spring-5-security-cognito/README.md @@ -1,3 +1,7 @@ +## Spring 5 Security Cognito + +This module contains articles about Spring 5 with Amazon Cognito + ## Relevant articles: - [Authenticating with Amazon Cognito Using Spring Security](https://www.baeldung.com/spring-security-oauth-cognito) diff --git a/spring-activiti/README.md b/spring-activiti/README.md index 703dfeec52..75f3ea51e5 100644 --- a/spring-activiti/README.md +++ b/spring-activiti/README.md @@ -1,3 +1,7 @@ +## Spring Activiti + +This module contains articles about Spring with Activiti + ### Relevant articles - [A Guide to Activiti with Java](http://www.baeldung.com/java-activiti) diff --git a/spring-akka/README.md b/spring-akka/README.md index 0f1c013214..035551d459 100644 --- a/spring-akka/README.md +++ b/spring-akka/README.md @@ -1,2 +1,6 @@ +## Spring Akka + +This module contains articles about Spring with Akka + ### Relevant Articles: - [Introduction to Spring with Akka](http://www.baeldung.com/akka-with-spring) diff --git a/spring-all/README.md b/spring-all/README.md index c5825b47fb..8a4e8fa18f 100644 --- a/spring-all/README.md +++ b/spring-all/README.md @@ -1,5 +1,3 @@ -========= - ## Spring General Example Project This project is used to replicate Spring Exceptions only. diff --git a/spring-amqp/README.md b/spring-amqp/README.md index 5e29011995..0ae4eda12e 100644 --- a/spring-amqp/README.md +++ b/spring-amqp/README.md @@ -1,3 +1,7 @@ +## Spring AMQP + +This module contains articles about Spring with the AMQP messaging system + ## Relevant articles: - [Messaging With Spring AMQP](https://www.baeldung.com/spring-amqp) diff --git a/spring-aop/README.md b/spring-aop/README.md index af8ab71da0..915299a073 100644 --- a/spring-aop/README.md +++ b/spring-aop/README.md @@ -1,3 +1,7 @@ +## Spring AOP + +This module contains articles about Spring aspect oriented programming (AOP) + ### Relevant articles - [Implementing a Custom Spring AOP Annotation](http://www.baeldung.com/spring-aop-annotation) diff --git a/spring-apache-camel/README.md b/spring-apache-camel/README.md index e72e18b198..e89eb4fe6c 100644 --- a/spring-apache-camel/README.md +++ b/spring-apache-camel/README.md @@ -1,35 +1,26 @@ +## Spring Apache Camel -

Configure and Use Apache Camel with Spring

+This module contains articles about Spring with Apache Camel -This article will demonstrate how to configure and use Apache Camel with Spring Framework. +### Relevant Articles -

Relevant Articles

+- [Apache Camel](http://camel.apache.org/) +- [Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/patterns/messaging/toc.html) +- [Introduction To Apache Camel](http://www.baeldung.com/apache-camel-intro) +- [Integration Patterns With Apache Camel](http://www.baeldung.com/camel-integration-patterns) +- [Using Apache Camel with Spring](http://www.baeldung.com/spring-apache-camel-tutorial) - +### Framework Versions: -

Framework Versions:

+- Spring 4.2.4 +- Apache Camel 2.16.1 -
    -
  • Spring 4.2.4
  • -
  • Apache Camel 2.16.1
  • -
+### Build and Run Application -

Build and Run Application

+To build this application execute: -To build this application execute following maven command in ApacheCamelFileProcessor directory. - -mvn clean install +`mvn clean install` To run this application you can either run our main class App from your IDE or you can execute following maven command: -mvn exec:java -Dexec.mainClass="App" - -

Relevant Articles on Baeldung

- +`mvn exec:java -Dexec.mainClass="com.baeldung.camel.main.App"` \ No newline at end of file diff --git a/spring-batch/README.md b/spring-batch/README.md index ddd830cd47..c100835948 100644 --- a/spring-batch/README.md +++ b/spring-batch/README.md @@ -1,7 +1,6 @@ -========= - ## Spring Batch +This module contains articles about Spring Batch ### Relevant Articles: - [Introduction to Spring Batch](http://www.baeldung.com/introduction-to-spring-batch) diff --git a/spring-bom/README.md b/spring-bom/README.md index d056216a2e..60e7d75340 100644 --- a/spring-bom/README.md +++ b/spring-bom/README.md @@ -1,3 +1,6 @@ +## Spring BOM + +This module contains articles about Spring with Maven BOM (Bill Of Materials) ### Relevant Articles: - [Spring with Maven BOM](http://www.baeldung.com/spring-maven-bom) diff --git a/spring-boot/README.MD b/spring-boot/README.MD index 04d76e438e..522a1f7120 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -1,3 +1,7 @@ +## Spring Boot + +This module contains articles about Spring Boot + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring From eb6ced2100c0e9c38b2585e1480d7b4c74920305 Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Fri, 27 Sep 2019 17:36:49 +0300 Subject: [PATCH 071/107] Split or move libraries-apache-commons module (#7873) --- .../README.md | 13 + libraries-apache-commons-collections/pom.xml | 40 ++ .../collections/collectionutils}/Address.java | 2 +- .../collectionutils}/Customer.java | 2 +- .../commons/collections}/BagUnitTest.java | 2 +- .../commons/collections/BidiMapUnitTest.java | 0 .../commons/collections/MapUtilsUnitTest.java | 0 .../commons/collections/SetUtilsUnitTest.java | 0 .../CircularFifoQueueUnitTest.java | 2 +- .../CollectionUtilsGuideUnitTest.java | 6 +- .../orderedmap/OrderedMapUnitTest.java | 422 +++++++++--------- libraries-apache-commons-io/README.md | 7 + libraries-apache-commons-io/pom.xml | 31 ++ .../com/baeldung/commons/io/FileMonitor.java | 0 .../commons/io/CommonsIOUnitTest.java | 0 .../io}/csv/CSVReaderWriterUnitTest.java | 2 +- .../src/test/resources/aaa.txt | 0 .../src/test/resources/book.csv | 0 .../src/test/resources/fileTest.txt | 0 .../src/test/resources/sample.txt | 0 libraries-apache-commons/.gitignore | 9 - libraries-apache-commons/README.md | 25 +- libraries-apache-commons/pom.xml | 25 -- pom.xml | 4 + 24 files changed, 322 insertions(+), 270 deletions(-) create mode 100644 libraries-apache-commons-collections/README.md create mode 100644 libraries-apache-commons-collections/pom.xml rename {libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil => libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils}/Address.java (94%) rename {libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil => libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils}/Customer.java (97%) rename {libraries-apache-commons/src/test/java/com/baeldung/commons/collections4 => libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections}/BagUnitTest.java (98%) rename {libraries-apache-commons => libraries-apache-commons-collections}/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java (100%) rename {libraries-apache-commons => libraries-apache-commons-collections}/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java (100%) rename {libraries-apache-commons => libraries-apache-commons-collections}/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java (100%) rename {libraries-apache-commons/src/test/java/com/baeldung => libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections}/circularfifoqueue/CircularFifoQueueUnitTest.java (98%) rename {libraries-apache-commons/src/test/java/com/baeldung/commons/collections => libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils}/CollectionUtilsGuideUnitTest.java (96%) rename {libraries-apache-commons => libraries-apache-commons-collections}/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java (97%) create mode 100644 libraries-apache-commons-io/README.md create mode 100644 libraries-apache-commons-io/pom.xml rename {libraries-apache-commons => libraries-apache-commons-io}/src/main/java/com/baeldung/commons/io/FileMonitor.java (100%) rename {libraries-apache-commons => libraries-apache-commons-io}/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java (100%) rename {libraries-apache-commons/src/test/java/com/baeldung/commons => libraries-apache-commons-io/src/test/java/com/baeldung/commons/io}/csv/CSVReaderWriterUnitTest.java (98%) rename {libraries-apache-commons => libraries-apache-commons-io}/src/test/resources/aaa.txt (100%) rename {libraries-apache-commons => libraries-apache-commons-io}/src/test/resources/book.csv (100%) rename {libraries-apache-commons => libraries-apache-commons-io}/src/test/resources/fileTest.txt (100%) rename {libraries-apache-commons => libraries-apache-commons-io}/src/test/resources/sample.txt (100%) delete mode 100644 libraries-apache-commons/.gitignore diff --git a/libraries-apache-commons-collections/README.md b/libraries-apache-commons-collections/README.md new file mode 100644 index 0000000000..998ad1da09 --- /dev/null +++ b/libraries-apache-commons-collections/README.md @@ -0,0 +1,13 @@ +## Apache Commons Collections + +This module contains articles about Apache Commons Collections + +### Relevant articles + +- [Apache Commons Collections SetUtils](https://www.baeldung.com/apache-commons-setutils) +- [Apache Commons Collections OrderedMap](https://www.baeldung.com/apache-commons-ordered-map) +- [Guide to Apache Commons CircularFifoQueue](https://www.baeldung.com/commons-circular-fifo-queue) +- [Apache Commons Collections Bag](https://www.baeldung.com/apache-commons-bag) +- [A Guide to Apache Commons Collections CollectionUtils](https://www.baeldung.com/apache-commons-collection-utils) +- [Apache Commons Collections BidiMap](https://www.baeldung.com/commons-collections-bidi-map) +- [Apache Commons Collections MapUtils](https://www.baeldung.com/apache-commons-map-utils) \ No newline at end of file diff --git a/libraries-apache-commons-collections/pom.xml b/libraries-apache-commons-collections/pom.xml new file mode 100644 index 0000000000..eba0ad331e --- /dev/null +++ b/libraries-apache-commons-collections/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + libraries-apache-commons-collections + libraries-apache-commons-collections + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-collections4 + ${commons.collections.version} + + + org.hamcrest + java-hamcrest + ${org.hamcrest.java-hamcrest.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 4.1 + 3.6.2 + 2.0.0.0 + + + diff --git a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Address.java b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Address.java similarity index 94% rename from libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Address.java rename to libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Address.java index a1e231ec85..02c36a46f9 100644 --- a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Address.java +++ b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Address.java @@ -1,4 +1,4 @@ -package com.baeldung.commons.collectionutil; +package com.baeldung.commons.collections.collectionutils; public class Address { diff --git a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Customer.java b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Customer.java similarity index 97% rename from libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Customer.java rename to libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Customer.java index 1c6a8dc4f1..7d6db68474 100644 --- a/libraries-apache-commons/src/main/java/com/baeldung/commons/collectionutil/Customer.java +++ b/libraries-apache-commons-collections/src/main/java/com/baeldung/commons/collections/collectionutils/Customer.java @@ -1,4 +1,4 @@ -package com.baeldung.commons.collectionutil; +package com.baeldung.commons.collections.collectionutils; public class Customer implements Comparable { diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections4/BagUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BagUnitTest.java similarity index 98% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections4/BagUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BagUnitTest.java index ebad4093f0..0877e6d4ac 100644 --- a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections4/BagUnitTest.java +++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BagUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.commons.collections4; +package com.baeldung.commons.collections; import org.apache.commons.collections4.Bag; import org.apache.commons.collections4.SortedBag; diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java similarity index 100% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java similarity index 100% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/MapUtilsUnitTest.java diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java similarity index 100% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java diff --git a/libraries-apache-commons/src/test/java/com/baeldung/circularfifoqueue/CircularFifoQueueUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/circularfifoqueue/CircularFifoQueueUnitTest.java similarity index 98% rename from libraries-apache-commons/src/test/java/com/baeldung/circularfifoqueue/CircularFifoQueueUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/circularfifoqueue/CircularFifoQueueUnitTest.java index 39384a7442..5664c7b44e 100644 --- a/libraries-apache-commons/src/test/java/com/baeldung/circularfifoqueue/CircularFifoQueueUnitTest.java +++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/circularfifoqueue/CircularFifoQueueUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.circularfifoqueue; +package com.baeldung.commons.collections.circularfifoqueue; import java.util.ArrayList; import java.util.List; diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils/CollectionUtilsGuideUnitTest.java similarity index 96% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils/CollectionUtilsGuideUnitTest.java index 448c5b0729..e9a4612280 100644 --- a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideUnitTest.java +++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/collectionutils/CollectionUtilsGuideUnitTest.java @@ -1,7 +1,7 @@ -package com.baeldung.commons.collections; +package com.baeldung.commons.collections.collectionutils; -import com.baeldung.commons.collectionutil.Address; -import com.baeldung.commons.collectionutil.Customer; +import com.baeldung.commons.collections.collectionutils.Address; +import com.baeldung.commons.collections.collectionutils.Customer; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.Predicate; import org.apache.commons.collections4.Transformer; diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java similarity index 97% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java rename to libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java index c64143cba7..1ffc4a825f 100644 --- a/libraries-apache-commons/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java +++ b/libraries-apache-commons-collections/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java @@ -1,211 +1,211 @@ -package com.baeldung.commons.collections.orderedmap; - -import org.apache.commons.collections4.OrderedMap; -import org.apache.commons.collections4.OrderedMapIterator; -import org.apache.commons.collections4.map.LinkedMap; -import org.apache.commons.collections4.map.ListOrderedMap; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; - -public class OrderedMapUnitTest { - - private String[] names = { "Emily", "Mathew", "Rose", "John", "Anna" }; - private Integer[] ages = { 37, 28, 40, 36, 21 }; - - private int RUNNERS_COUNT = names.length; - - private OrderedMap runnersLinkedMap; - private OrderedMap runnersListOrderedMap; - - @Before - public void createRunners() { - // First implementation: ListOrderedMap - this.runnersListOrderedMap = new ListOrderedMap<>(); - this.loadOrderedMapOfRunners(this.runnersListOrderedMap); - - // Second implementation: LinkedMap - this.runnersLinkedMap = new LinkedMap<>(); - this.loadOrderedMapOfRunners(this.runnersLinkedMap); - } - - private void loadOrderedMapOfRunners(OrderedMap runners) { - for (int i = 0; i < RUNNERS_COUNT; i++) { - runners.put(this.names[i], this.ages[i]); - } - } - - @Test - public void givenALinkedMap_whenIteratedWithMapIterator_thenPreservesOrder() { - // Tests that the order in map iterator is the same - // as defined in the constant arrays of names and ages: - - OrderedMapIterator runnersIterator = this.runnersLinkedMap.mapIterator(); - int i = 0; - while (runnersIterator.hasNext()) { - runnersIterator.next(); - assertEquals(runnersIterator.getKey(), this.names[i]); - assertEquals(runnersIterator.getValue(), this.ages[i]); - i++; - } - } - - @Test - public void givenAListOrderedMap_whenIteratedWithMapIterator_thenPreservesOrder() { - // Tests that the order in map iterator is the same - // as defined in the constant arrays of names and ages: - - OrderedMapIterator runnersIterator = this.runnersListOrderedMap.mapIterator(); - int i = 0; - while (runnersIterator.hasNext()) { - runnersIterator.next(); - assertEquals(runnersIterator.getKey(), this.names[i]); - assertEquals(runnersIterator.getValue(), this.ages[i]); - i++; - } - } - - @Test - public void givenALinkedMap_whenIteratedForwards_thenPreservesOrder() { - // Tests that the order in the forward iteration is the same - // as defined in the constant arrays of names and ages - - String name = this.runnersLinkedMap.firstKey(); - int i = 0; - while (name != null) { - assertEquals(name, this.names[i]); - name = this.runnersLinkedMap.nextKey(name); - i++; - } - } - - @Test - public void givenAListOrderedMap_whenIteratedForwards_thenPreservesOrder() { - // Tests that the order in the forward iteration is the same - // as defined in the constant arrays of names and ages - - String name = this.runnersListOrderedMap.firstKey(); - int i = 0; - while (name != null) { - assertEquals(name, this.names[i]); - name = this.runnersListOrderedMap.nextKey(name); - i++; - } - } - - @Test - public void givenALinkedMap_whenIteratedBackwards_thenPreservesOrder() { - // Tests that the order in the backwards iteration is the same - // as defined in the constant arrays of names and ages - - String name = this.runnersLinkedMap.lastKey(); - int i = RUNNERS_COUNT - 1; - while (name != null) { - assertEquals(name, this.names[i]); - name = this.runnersLinkedMap.previousKey(name); - i--; - } - } - - @Test - public void givenAListOrderedMap_whenIteratedBackwards_thenPreservesOrder() { - // Tests that the order in the backwards iteration is the same - // as defined in the constant arrays of names and ages - - String name = this.runnersListOrderedMap.lastKey(); - int i = RUNNERS_COUNT - 1; - while (name != null) { - assertEquals(name, this.names[i]); - name = this.runnersListOrderedMap.previousKey(name); - i--; - } - } - - @Test - public void givenALinkedMap_whenObjectIsSearched_thenMatchesConstantArray() { - assertEquals(ages[4], this.runnersLinkedMap.get("Anna")); - } - - @Test - public void givenALinkedMap_whenConvertedToList_thenMatchesKeySet() { - // Casting the OrderedMap to a LinkedMap we can use asList() method - - LinkedMap lmap = (LinkedMap) this.runnersLinkedMap; - List listKeys = new ArrayList<>(); - listKeys.addAll(this.runnersLinkedMap.keySet()); - List linkedMap = lmap.asList(); - assertEquals(listKeys, linkedMap); - } - - @Test - public void givenALinkedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() { - LinkedMap lmap = (LinkedMap) this.runnersLinkedMap; - - for (int i = 0; i < RUNNERS_COUNT; i++) { - // accessed by index: - String name = lmap.get(i); - assertEquals(name, this.names[i]); - - // index of key concides with position in array - assertEquals(lmap.indexOf(this.names[i]), i); - } - } - - @Test - public void givenALinkedMap_whenElementRemoved_thenSizeDecrease() { - LinkedMap lmap = (LinkedMap) this.runnersLinkedMap; - Integer johnAge = lmap.remove("John");// by object - assertEquals(johnAge, new Integer(36)); - assertEquals(lmap.size(), RUNNERS_COUNT - 1); - - Integer emilyAge = lmap.remove(0);// by index - assertEquals(emilyAge, new Integer(37)); - assertEquals(lmap.size(), RUNNERS_COUNT - 2); - } - - @Test - public void givenAListOrderedMap_whenObjectIsSearched_thenMatchesConstantArray() { - assertEquals(ages[4], this.runnersListOrderedMap.get("Anna")); - } - - @Test - public void givenAListOrderedMap_whenConvertedToList_thenMatchesKeySet() { - ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap; - List listKeys = new ArrayList<>(); - listKeys.addAll(this.runnersListOrderedMap.keySet()); - List lomapList = lomap.asList(); - assertEquals(listKeys, lomapList); - } - - @Test - public void givenAListOrderedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() { - ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap; - - for (int i = 0; i < RUNNERS_COUNT; i++) { - // accessed by index: - String name = lomap.get(i); - assertEquals(name, this.names[i]); - - // index of key concides with position in array - assertEquals(lomap.indexOf(this.names[i]), i); - } - } - - @Test - public void givenAListOrderedMap_whenElementRemoved_thenSizeDecrease() { - ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap; - - Integer johnAge = lomap.remove("John");// by object - - assertEquals(johnAge, new Integer(36)); - assertEquals(lomap.size(), RUNNERS_COUNT - 1); - - Integer emilyAge = lomap.remove(0);// by index - assertEquals(emilyAge, new Integer(37)); - assertEquals(lomap.size(), RUNNERS_COUNT - 2); - } -} +package com.baeldung.commons.collections.orderedmap; + +import org.apache.commons.collections4.OrderedMap; +import org.apache.commons.collections4.OrderedMapIterator; +import org.apache.commons.collections4.map.LinkedMap; +import org.apache.commons.collections4.map.ListOrderedMap; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class OrderedMapUnitTest { + + private String[] names = { "Emily", "Mathew", "Rose", "John", "Anna" }; + private Integer[] ages = { 37, 28, 40, 36, 21 }; + + private int RUNNERS_COUNT = names.length; + + private OrderedMap runnersLinkedMap; + private OrderedMap runnersListOrderedMap; + + @Before + public void createRunners() { + // First implementation: ListOrderedMap + this.runnersListOrderedMap = new ListOrderedMap<>(); + this.loadOrderedMapOfRunners(this.runnersListOrderedMap); + + // Second implementation: LinkedMap + this.runnersLinkedMap = new LinkedMap<>(); + this.loadOrderedMapOfRunners(this.runnersLinkedMap); + } + + private void loadOrderedMapOfRunners(OrderedMap runners) { + for (int i = 0; i < RUNNERS_COUNT; i++) { + runners.put(this.names[i], this.ages[i]); + } + } + + @Test + public void givenALinkedMap_whenIteratedWithMapIterator_thenPreservesOrder() { + // Tests that the order in map iterator is the same + // as defined in the constant arrays of names and ages: + + OrderedMapIterator runnersIterator = this.runnersLinkedMap.mapIterator(); + int i = 0; + while (runnersIterator.hasNext()) { + runnersIterator.next(); + assertEquals(runnersIterator.getKey(), this.names[i]); + assertEquals(runnersIterator.getValue(), this.ages[i]); + i++; + } + } + + @Test + public void givenAListOrderedMap_whenIteratedWithMapIterator_thenPreservesOrder() { + // Tests that the order in map iterator is the same + // as defined in the constant arrays of names and ages: + + OrderedMapIterator runnersIterator = this.runnersListOrderedMap.mapIterator(); + int i = 0; + while (runnersIterator.hasNext()) { + runnersIterator.next(); + assertEquals(runnersIterator.getKey(), this.names[i]); + assertEquals(runnersIterator.getValue(), this.ages[i]); + i++; + } + } + + @Test + public void givenALinkedMap_whenIteratedForwards_thenPreservesOrder() { + // Tests that the order in the forward iteration is the same + // as defined in the constant arrays of names and ages + + String name = this.runnersLinkedMap.firstKey(); + int i = 0; + while (name != null) { + assertEquals(name, this.names[i]); + name = this.runnersLinkedMap.nextKey(name); + i++; + } + } + + @Test + public void givenAListOrderedMap_whenIteratedForwards_thenPreservesOrder() { + // Tests that the order in the forward iteration is the same + // as defined in the constant arrays of names and ages + + String name = this.runnersListOrderedMap.firstKey(); + int i = 0; + while (name != null) { + assertEquals(name, this.names[i]); + name = this.runnersListOrderedMap.nextKey(name); + i++; + } + } + + @Test + public void givenALinkedMap_whenIteratedBackwards_thenPreservesOrder() { + // Tests that the order in the backwards iteration is the same + // as defined in the constant arrays of names and ages + + String name = this.runnersLinkedMap.lastKey(); + int i = RUNNERS_COUNT - 1; + while (name != null) { + assertEquals(name, this.names[i]); + name = this.runnersLinkedMap.previousKey(name); + i--; + } + } + + @Test + public void givenAListOrderedMap_whenIteratedBackwards_thenPreservesOrder() { + // Tests that the order in the backwards iteration is the same + // as defined in the constant arrays of names and ages + + String name = this.runnersListOrderedMap.lastKey(); + int i = RUNNERS_COUNT - 1; + while (name != null) { + assertEquals(name, this.names[i]); + name = this.runnersListOrderedMap.previousKey(name); + i--; + } + } + + @Test + public void givenALinkedMap_whenObjectIsSearched_thenMatchesConstantArray() { + assertEquals(ages[4], this.runnersLinkedMap.get("Anna")); + } + + @Test + public void givenALinkedMap_whenConvertedToList_thenMatchesKeySet() { + // Casting the OrderedMap to a LinkedMap we can use asList() method + + LinkedMap lmap = (LinkedMap) this.runnersLinkedMap; + List listKeys = new ArrayList<>(); + listKeys.addAll(this.runnersLinkedMap.keySet()); + List linkedMap = lmap.asList(); + assertEquals(listKeys, linkedMap); + } + + @Test + public void givenALinkedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() { + LinkedMap lmap = (LinkedMap) this.runnersLinkedMap; + + for (int i = 0; i < RUNNERS_COUNT; i++) { + // accessed by index: + String name = lmap.get(i); + assertEquals(name, this.names[i]); + + // index of key concides with position in array + assertEquals(lmap.indexOf(this.names[i]), i); + } + } + + @Test + public void givenALinkedMap_whenElementRemoved_thenSizeDecrease() { + LinkedMap lmap = (LinkedMap) this.runnersLinkedMap; + Integer johnAge = lmap.remove("John");// by object + assertEquals(johnAge, new Integer(36)); + assertEquals(lmap.size(), RUNNERS_COUNT - 1); + + Integer emilyAge = lmap.remove(0);// by index + assertEquals(emilyAge, new Integer(37)); + assertEquals(lmap.size(), RUNNERS_COUNT - 2); + } + + @Test + public void givenAListOrderedMap_whenObjectIsSearched_thenMatchesConstantArray() { + assertEquals(ages[4], this.runnersListOrderedMap.get("Anna")); + } + + @Test + public void givenAListOrderedMap_whenConvertedToList_thenMatchesKeySet() { + ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap; + List listKeys = new ArrayList<>(); + listKeys.addAll(this.runnersListOrderedMap.keySet()); + List lomapList = lomap.asList(); + assertEquals(listKeys, lomapList); + } + + @Test + public void givenAListOrderedMap_whenSearchByIndexIsUsed_thenMatchesConstantArray() { + ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap; + + for (int i = 0; i < RUNNERS_COUNT; i++) { + // accessed by index: + String name = lomap.get(i); + assertEquals(name, this.names[i]); + + // index of key concides with position in array + assertEquals(lomap.indexOf(this.names[i]), i); + } + } + + @Test + public void givenAListOrderedMap_whenElementRemoved_thenSizeDecrease() { + ListOrderedMap lomap = (ListOrderedMap) this.runnersListOrderedMap; + + Integer johnAge = lomap.remove("John");// by object + + assertEquals(johnAge, new Integer(36)); + assertEquals(lomap.size(), RUNNERS_COUNT - 1); + + Integer emilyAge = lomap.remove(0);// by index + assertEquals(emilyAge, new Integer(37)); + assertEquals(lomap.size(), RUNNERS_COUNT - 2); + } +} diff --git a/libraries-apache-commons-io/README.md b/libraries-apache-commons-io/README.md new file mode 100644 index 0000000000..d5f29499d2 --- /dev/null +++ b/libraries-apache-commons-io/README.md @@ -0,0 +1,7 @@ +## Apache Commons Collections + +This module contains articles about Apache Commons IO + +### Relevant articles +- [Apache Commons IO](https://www.baeldung.com/apache-commons-io) +- [Introduction to Apache Commons CSV](https://www.baeldung.com/apache-commons-csv) diff --git a/libraries-apache-commons-io/pom.xml b/libraries-apache-commons-io/pom.xml new file mode 100644 index 0000000000..7ec71d8264 --- /dev/null +++ b/libraries-apache-commons-io/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + libraries-apache-commons-io + libraries-apache-commons-io + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-csv + ${commons-csv.version} + + + commons-io + commons-io + ${commons-io.version} + + + + + 1.4 + + + diff --git a/libraries-apache-commons/src/main/java/com/baeldung/commons/io/FileMonitor.java b/libraries-apache-commons-io/src/main/java/com/baeldung/commons/io/FileMonitor.java similarity index 100% rename from libraries-apache-commons/src/main/java/com/baeldung/commons/io/FileMonitor.java rename to libraries-apache-commons-io/src/main/java/com/baeldung/commons/io/FileMonitor.java diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java b/libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java similarity index 100% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java rename to libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/CommonsIOUnitTest.java diff --git a/libraries-apache-commons/src/test/java/com/baeldung/commons/csv/CSVReaderWriterUnitTest.java b/libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/csv/CSVReaderWriterUnitTest.java similarity index 98% rename from libraries-apache-commons/src/test/java/com/baeldung/commons/csv/CSVReaderWriterUnitTest.java rename to libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/csv/CSVReaderWriterUnitTest.java index f93e59ed75..b99f4e8bc3 100644 --- a/libraries-apache-commons/src/test/java/com/baeldung/commons/csv/CSVReaderWriterUnitTest.java +++ b/libraries-apache-commons-io/src/test/java/com/baeldung/commons/io/csv/CSVReaderWriterUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.commons.csv; +package com.baeldung.commons.io.csv; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; diff --git a/libraries-apache-commons/src/test/resources/aaa.txt b/libraries-apache-commons-io/src/test/resources/aaa.txt similarity index 100% rename from libraries-apache-commons/src/test/resources/aaa.txt rename to libraries-apache-commons-io/src/test/resources/aaa.txt diff --git a/libraries-apache-commons/src/test/resources/book.csv b/libraries-apache-commons-io/src/test/resources/book.csv similarity index 100% rename from libraries-apache-commons/src/test/resources/book.csv rename to libraries-apache-commons-io/src/test/resources/book.csv diff --git a/libraries-apache-commons/src/test/resources/fileTest.txt b/libraries-apache-commons-io/src/test/resources/fileTest.txt similarity index 100% rename from libraries-apache-commons/src/test/resources/fileTest.txt rename to libraries-apache-commons-io/src/test/resources/fileTest.txt diff --git a/libraries-apache-commons/src/test/resources/sample.txt b/libraries-apache-commons-io/src/test/resources/sample.txt similarity index 100% rename from libraries-apache-commons/src/test/resources/sample.txt rename to libraries-apache-commons-io/src/test/resources/sample.txt diff --git a/libraries-apache-commons/.gitignore b/libraries-apache-commons/.gitignore deleted file mode 100644 index e594daf27a..0000000000 --- a/libraries-apache-commons/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -*.class - -# Folders # -/gensrc -/target - -# Packaged files # -*.jar -/bin/ diff --git a/libraries-apache-commons/README.md b/libraries-apache-commons/README.md index 01f2379588..ae424cb6c5 100644 --- a/libraries-apache-commons/README.md +++ b/libraries-apache-commons/README.md @@ -1,20 +1,11 @@ ### Relevant articles -- [Array Processing with Apache Commons Lang 3](http://www.baeldung.com/array-processing-commons-lang) -- [String Processing with Apache Commons Lang 3](http://www.baeldung.com/string-processing-commons-lang) -- [Introduction to Apache Commons Math](http://www.baeldung.com/apache-commons-math) -- [Apache Commons Collections SetUtils](http://www.baeldung.com/apache-commons-setutils) -- [Apache Commons Collections OrderedMap](http://www.baeldung.com/apache-commons-ordered-map) -- [Introduction to Apache Commons Text](http://www.baeldung.com/java-apache-commons-text) -- [A Guide to Apache Commons DbUtils](http://www.baeldung.com/apache-commons-dbutils) -- [Guide to Apache Commons CircularFifoQueue](http://www.baeldung.com/commons-circular-fifo-queue) -- [Apache Commons Chain](http://www.baeldung.com/apache-commons-chain) -- [Introduction to Apache Commons CSV](http://www.baeldung.com/apache-commons-csv) -- [Apache Commons IO](http://www.baeldung.com/apache-commons-io) -- [Apache Commons Collections Bag](http://www.baeldung.com/apache-commons-bag) -- [A Guide to Apache Commons Collections CollectionUtils](http://www.baeldung.com/apache-commons-collection-utils) -- [Apache Commons BeanUtils](http://www.baeldung.com/apache-commons-beanutils) -- [Apache Commons Collections BidiMap](http://www.baeldung.com/commons-collections-bidi-map) -- [Apache Commons Collections MapUtils](http://www.baeldung.com/apache-commons-map-utils) -- [Histograms with Apache Commons Frequency](http://www.baeldung.com/apache-commons-frequency) +- [Array Processing with Apache Commons Lang 3](https://www.baeldung.com/array-processing-commons-lang) +- [String Processing with Apache Commons Lang 3](https://www.baeldung.com/string-processing-commons-lang) +- [Introduction to Apache Commons Math](https://www.baeldung.com/apache-commons-math) +- [Introduction to Apache Commons Text](https://www.baeldung.com/java-apache-commons-text) +- [A Guide to Apache Commons DbUtils](https://www.baeldung.com/apache-commons-dbutils) +- [Apache Commons Chain](https://www.baeldung.com/apache-commons-chain) +- [Apache Commons BeanUtils](https://www.baeldung.com/apache-commons-beanutils) +- [Histograms with Apache Commons Frequency](https://www.baeldung.com/apache-commons-frequency) - [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3) \ No newline at end of file diff --git a/libraries-apache-commons/pom.xml b/libraries-apache-commons/pom.xml index 05d11d83fe..f83a8c7304 100644 --- a/libraries-apache-commons/pom.xml +++ b/libraries-apache-commons/pom.xml @@ -32,21 +32,11 @@ commons-text ${commons-text.version} - - commons-io - commons-io - ${commons-io.version} - commons-chain commons-chain ${commons-chain.version} - - org.apache.commons - commons-csv - ${commons-csv.version} - commons-dbutils commons-dbutils @@ -72,18 +62,6 @@ xchart ${xchart-version} - - org.apache.commons - commons-collections4 - ${commons.collections.version} - - - org.hamcrest - java-hamcrest - ${org.hamcrest.java-hamcrest.version} - test - - @@ -91,11 +69,8 @@ 1.1 1.9.3 1.2 - 1.4 3.6.2 1.6 - 4.1 - 2.0.0.0 1.10.L001 3.5.2 3.6 diff --git a/pom.xml b/pom.xml index 89786496c7..3c335f82bd 100644 --- a/pom.xml +++ b/pom.xml @@ -530,6 +530,8 @@ libraries-data libraries-data-2 libraries-apache-commons + libraries-apache-commons-collections + libraries-apache-commons-io libraries-primitive libraries-testing libraries-security @@ -1266,6 +1268,8 @@ libraries-data libraries-data-2 libraries-apache-commons + libraries-apache-commons-collections + libraries-apache-commons-io libraries-testing libraries-security libraries-server From ceba5408ec81de8c1e8ae03676dcfafe36ad27c9 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 27 Sep 2019 20:16:06 +0530 Subject: [PATCH 072/107] BAEL-17945 Fix the integrations tests in libraries (#7880) -Fixing serenity tests failing due to mismatching libraries --- libraries-testing/pom.xml | 12 +++++++++--- .../src/test/java/com/baeldung/hamcrest/Animal.java | 2 +- .../src/test/java/com/baeldung/hamcrest/Cat.java | 2 +- .../baeldung/hamcrest/HamcrestMatcherUnitTest.java | 4 ++-- .../com/baeldung/hamcrest/IsPositiveInteger.java | 2 +- .../src/test/java/com/baeldung/hamcrest/Person.java | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libraries-testing/pom.xml b/libraries-testing/pom.xml index 7cc5a8f775..a2fbed31b2 100644 --- a/libraries-testing/pom.xml +++ b/libraries-testing/pom.xml @@ -43,6 +43,12 @@ serenity-rest-assured ${serenity.version} test + + + io.rest-assured + rest-assured + + net.serenity-bdd @@ -162,15 +168,15 @@ - 1.9.26 - 1.41.0 + 1.9.9 + 1.9.0 1.9.0 1.9.27 1.5.0 3.0.0 0.8.1 4.3.8.RELEASE - 3.0.3 + 4.1.1 3.6.2 2.0.0.0 diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java index 1a0266f5a3..1d37eef59b 100644 --- a/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java +++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/Animal.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; public class Animal { String name; diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java index 892e5b6e30..b15a3628da 100644 --- a/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java +++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/Cat.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; public class Cat extends Animal { diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java index cf9fde7114..f5887ba79b 100644 --- a/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java +++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/HamcrestMatcherUnitTest.java @@ -1,10 +1,10 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; import org.junit.Test; import java.util.*; -import static org.baeldung.hamcrest.IsPositiveInteger.isAPositiveInteger; +import static com.baeldung.hamcrest.IsPositiveInteger.isAPositiveInteger; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.hamcrest.beans.HasProperty.hasProperty; diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java index 0d8d262538..4d2ef8a8e5 100644 --- a/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java +++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/IsPositiveInteger.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; import org.hamcrest.Description; import org.hamcrest.Factory; diff --git a/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java b/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java index 0053c98043..417daa866e 100644 --- a/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java +++ b/libraries-testing/src/test/java/com/baeldung/hamcrest/Person.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; public class Person { String name; From 8f06ddfa33a1511dad1265d4087d7ad18a5f76d2 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Fri, 27 Sep 2019 16:39:57 +0100 Subject: [PATCH 073/107] [BAEL-17651] - spring-boot-angular & spring-boot-angular-ecommerce merge (#7866) * [BAEL-17651] - angular merge * Added article link the readme * added colon * removed spring-boot-angular-ecommerce from parent pom --- pom.xml | 2 - spring-boot-angular-ecommerce/README.md | 6 -- spring-boot-angular-ecommerce/pom.xml | 81 ------------------ spring-boot-angular/README.md | 5 +- spring-boot-angular/pom.xml | 3 +- .../ecommerce/EcommerceApplication.java | 0 .../ecommerce/controller/OrderController.java | 0 .../controller/ProductController.java | 0 .../ecommerce/dto/OrderProductDto.java | 0 .../exception/ApiExceptionHandler.java | 0 .../exception/ResourceNotFoundException.java | 0 .../com/baeldung/ecommerce/model/Order.java | 0 .../ecommerce/model/OrderProduct.java | 0 .../ecommerce/model/OrderProductPK.java | 0 .../baeldung/ecommerce/model/OrderStatus.java | 0 .../com/baeldung/ecommerce/model/Product.java | 0 .../repository/OrderProductRepository.java | 0 .../ecommerce/repository/OrderRepository.java | 0 .../repository/ProductRepository.java | 0 .../service/OrderProductService.java | 0 .../service/OrderProductServiceImpl.java | 0 .../ecommerce/service/OrderService.java | 0 .../ecommerce/service/OrderServiceImpl.java | 0 .../ecommerce/service/ProductService.java | 0 .../ecommerce/service/ProductServiceImpl.java | 0 .../main/js/application}/.angular-cli.json | 0 .../main/js/application}/.editorconfig | 0 .../main/js/application}/.gitignore | 4 +- .../main/js/application}/README.md | 0 .../main/js/application}/e2e/app.e2e-spec.ts | 0 .../src/main/js/application/e2e}/app.po.ts | 0 .../js/application}/e2e/tsconfig.e2e.json | 0 .../main/js/application}/karma.conf.js | 0 .../main/js/application}/package-lock.json | 0 .../main/js/application}/package.json | 0 .../main/js/application}/protractor.conf.js | 0 .../src/app/app-routing.module.ts | 0 .../js/application}/src/app/app.component.css | 0 .../application}/src/app/app.component.html | 0 .../src/app/app.component.spec.ts | 0 .../js/application}/src/app/app.component.ts | 0 .../js/application}/src/app/app.module.ts | 0 .../js/application}/src/app/model/user.ts | 0 .../src/app/service/user.service.spec.ts | 0 .../src/app/service/user.service.ts | 0 .../src/app/user-form/user-form.component.css | 0 .../app/user-form/user-form.component.html | 0 .../app/user-form/user-form.component.spec.ts | 0 .../src/app/user-form/user-form.component.ts | 0 .../src/app/user-list/user-list.component.css | 0 .../app/user-list/user-list.component.html | 0 .../app/user-list/user-list.component.spec.ts | 0 .../src/app/user-list/user-list.component.ts | 0 .../main/js/application}/src/assets/.gitkeep | 0 .../src/environments/environment.prod.ts | 0 .../src/environments/environment.ts | 0 .../src/main/js/application}/src/favicon.ico | Bin .../main/js/application}/src/index.html | 0 .../src/main/js/application}/src/main.ts | 0 .../main/js/application}/src/polyfills.ts | 0 .../src/main/js/application}/src/styles.css | 0 .../js/application}/src/tsconfig.app.json | 0 .../js/application}/src/tsconfig.spec.json | 0 .../main/js/application}/src/typings.d.ts | 0 .../main/js/application}/tsconfig.json | 0 .../main/js/application}/tslint.json | 0 .../src/main/js/ecommerce}/.editorconfig | 0 .../src/main/js/ecommerce}/README.md | 0 .../src/main/js/ecommerce}/angular.json | 0 .../main/js/ecommerce}/e2e/protractor.conf.js | 0 .../js/ecommerce}/e2e/src/app.e2e-spec.ts | 0 .../main/js/ecommerce/e2e/src}/app.po.ts | 0 .../main/js/ecommerce}/e2e/tsconfig.e2e.json | 0 .../src/main/js/ecommerce}/package-lock.json | 0 .../src/main/js/ecommerce}/package.json | 0 .../src/main/js/ecommerce}/proxy-conf.json | 0 .../js/ecommerce}/src/app/app.component.css | 0 .../js/ecommerce}/src/app/app.component.html | 0 .../ecommerce}/src/app/app.component.spec.ts | 0 .../js/ecommerce}/src/app/app.component.ts | 0 .../main/js/ecommerce}/src/app/app.module.ts | 0 .../src/app/ecommerce/ecommerce.component.css | 0 .../app/ecommerce/ecommerce.component.html | 0 .../app/ecommerce/ecommerce.component.spec.ts | 0 .../src/app/ecommerce/ecommerce.component.ts | 0 .../ecommerce/models/product-order.model.ts | 0 .../ecommerce/models/product-orders.model.ts | 0 .../src/app/ecommerce/models/product.model.ts | 0 .../app/ecommerce/orders/orders.component.css | 0 .../ecommerce/orders/orders.component.html | 0 .../ecommerce/orders/orders.component.spec.ts | 0 .../app/ecommerce/orders/orders.component.ts | 0 .../ecommerce/products/products.component.css | 0 .../products/products.component.html | 0 .../products/products.component.spec.ts | 0 .../ecommerce/products/products.component.ts | 0 .../ecommerce/services/EcommerceService.ts | 0 .../shopping-cart/shopping-cart.component.css | 0 .../shopping-cart.component.html | 0 .../shopping-cart.component.spec.ts | 0 .../shopping-cart/shopping-cart.component.ts | 0 .../main/js/ecommerce}/src/assets/.gitkeep | 0 .../src/main/js/ecommerce}/src/browserslist | 0 .../src/environments/environment.prod.ts | 0 .../src/environments/environment.ts | 0 .../main/js/ecommerce}/src/favicon.ico | Bin .../src/main/js/ecommerce}/src/index.html | 0 .../src/main/js/ecommerce}/src/karma.conf.js | 0 .../main/js/ecommerce}/src/main.ts | 0 .../src/main/js/ecommerce}/src/polyfills.ts | 0 .../main/js/ecommerce}/src/styles.css | 0 .../src/main/js/ecommerce}/src/test.ts | 0 .../main/js/ecommerce}/src/tsconfig.app.json | 0 .../main/js/ecommerce}/src/tsconfig.spec.json | 0 .../src/main/js/ecommerce}/src/tslint.json | 0 .../src/main/js/ecommerce}/tsconfig.json | 0 .../src/main/js/ecommerce}/tslint.json | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback.xml | 0 .../EcommerceApplicationIntegrationTest.java | 0 .../SpringContextIntegrationTest.java | 0 .../java/org/baeldung/SpringContextTest.java | 0 122 files changed, 7 insertions(+), 94 deletions(-) delete mode 100644 spring-boot-angular-ecommerce/README.md delete mode 100644 spring-boot-angular-ecommerce/pom.xml rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/controller/OrderController.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/controller/ProductController.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/model/Order.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/model/Product.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/service/OrderService.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/service/ProductService.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/.angular-cli.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/.editorconfig (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/.gitignore (82%) rename spring-boot-angular/{angularclient => src/main/js/application}/README.md (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/e2e/app.e2e-spec.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend/e2e/src => spring-boot-angular/src/main/js/application/e2e}/app.po.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/e2e/tsconfig.e2e.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/karma.conf.js (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/package-lock.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/package.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/protractor.conf.js (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/app-routing.module.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/app.component.css (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/app.component.html (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/app.component.spec.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/app.component.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/app.module.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/model/user.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/service/user.service.spec.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/service/user.service.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-form/user-form.component.css (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-form/user-form.component.html (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-form/user-form.component.spec.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-form/user-form.component.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-list/user-list.component.css (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-list/user-list.component.html (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-list/user-list.component.spec.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/app/user-list/user-list.component.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/application}/src/assets/.gitkeep (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/application}/src/environments/environment.prod.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/environments/environment.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/application}/src/favicon.ico (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/index.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/application}/src/main.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/polyfills.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/application}/src/styles.css (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/tsconfig.app.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/tsconfig.spec.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/src/typings.d.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/tsconfig.json (100%) rename spring-boot-angular/{angularclient => src/main/js/application}/tslint.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/.editorconfig (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/README.md (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/angular.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/e2e/protractor.conf.js (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/e2e/src/app.e2e-spec.ts (100%) rename spring-boot-angular/{angularclient/e2e => src/main/js/ecommerce/e2e/src}/app.po.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/e2e/tsconfig.e2e.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/package-lock.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/package.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/proxy-conf.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/app.component.css (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/app.component.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/app.component.spec.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/app.component.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/app.module.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/ecommerce.component.css (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/ecommerce.component.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/ecommerce.component.spec.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/ecommerce.component.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/models/product-order.model.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/models/product-orders.model.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/models/product.model.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/orders/orders.component.css (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/orders/orders.component.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/orders/orders.component.spec.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/orders/orders.component.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/products/products.component.css (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/products/products.component.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/products/products.component.spec.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/products/products.component.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/services/EcommerceService.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/shopping-cart/shopping-cart.component.css (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/shopping-cart/shopping-cart.component.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/app/ecommerce/shopping-cart/shopping-cart.component.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/ecommerce}/src/assets/.gitkeep (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/browserslist (100%) rename spring-boot-angular/{angularclient => src/main/js/ecommerce}/src/environments/environment.prod.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/environments/environment.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/ecommerce}/src/favicon.ico (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/index.html (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/karma.conf.js (100%) rename spring-boot-angular/{angularclient => src/main/js/ecommerce}/src/main.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/polyfills.ts (100%) rename spring-boot-angular/{angularclient => src/main/js/ecommerce}/src/styles.css (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/test.ts (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/tsconfig.app.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/tsconfig.spec.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/src/tslint.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/tsconfig.json (100%) rename {spring-boot-angular-ecommerce/src/main/frontend => spring-boot-angular/src/main/js/ecommerce}/tslint.json (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/resources/application.properties (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/main/resources/logback.xml (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-boot-angular-ecommerce => spring-boot-angular}/src/test/java/org/baeldung/SpringContextTest.java (100%) diff --git a/pom.xml b/pom.xml index 3c335f82bd..79e5194ee8 100644 --- a/pom.xml +++ b/pom.xml @@ -671,7 +671,6 @@ spring-boot spring-boot-admin spring-boot-angular - spring-boot-angular-ecommerce spring-boot-autoconfiguration spring-boot-bootstrap spring-boot-camel @@ -1389,7 +1388,6 @@ spring-boot spring-boot-admin spring-boot-angular - spring-boot-angular-ecommerce spring-boot-autoconfiguration spring-boot-bootstrap spring-boot-camel diff --git a/spring-boot-angular-ecommerce/README.md b/spring-boot-angular-ecommerce/README.md deleted file mode 100644 index 9b592de9cc..0000000000 --- a/spring-boot-angular-ecommerce/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Spring Boot Angular Ecommerce - -This module contains articles about Spring Boot with Angular in regards to ecommerce applications. - -### Relevant Articles: -- [A Simple E-Commerce Implementation with Spring](https://www.baeldung.com/spring-angular-ecommerce) diff --git a/spring-boot-angular-ecommerce/pom.xml b/spring-boot-angular-ecommerce/pom.xml deleted file mode 100644 index 510e6c6ec3..0000000000 --- a/spring-boot-angular-ecommerce/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - spring-boot-angular-ecommerce - 0.0.1-SNAPSHOT - spring-boot-angular-ecommerce - jar - Spring Boot Angular E-commerce Appliciation - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - - org.springframework.boot - spring-boot-dependencies - ${spring.boot.version} - pom - import - - - - - - - org.springframework.boot - spring-boot-starter-data-jpa - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-devtools - ${spring.boot.version} - runtime - - - com.h2database - h2 - 1.4.197 - runtime - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - 2.9.6 - - - org.springframework.boot - spring-boot-starter-test - ${spring.boot.version} - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - - - UTF-8 - UTF-8 - 2.0.3.RELEASE - 2.0.4.RELEASE - - diff --git a/spring-boot-angular/README.md b/spring-boot-angular/README.md index a1904c2c17..027b23202e 100644 --- a/spring-boot-angular/README.md +++ b/spring-boot-angular/README.md @@ -1,7 +1,8 @@ ## Spring Boot Angular -This module contains articles about Spring Boot with Angular +This module contains articles about Spring Boot with Angular ### Relevant Articles: -- [Building a Web Application with Spring Boot and Angular](https://www.baeldung.com/spring-boot-angular-web) +- [Building a Web Application with Spring Boot and Angular](https://www.baeldung.com/spring-boot-angular-web) +- [A Simple E-Commerce Implementation with Spring](https://www.baeldung.com/spring-angular-ecommerce) diff --git a/spring-boot-angular/pom.xml b/spring-boot-angular/pom.xml index 71c46cb7f5..8c26668752 100644 --- a/spring-boot-angular/pom.xml +++ b/spring-boot-angular/pom.xml @@ -7,11 +7,12 @@ 1.0 jar + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../../parent-boot-2 + ../parent-boot-2 diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/controller/OrderController.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/OrderController.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/controller/OrderController.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/OrderController.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/controller/ProductController.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/ProductController.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/controller/ProductController.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/ProductController.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/Order.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Order.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/Order.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Order.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/Product.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Product.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/model/Product.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Product.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderService.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderService.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderService.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderService.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/ProductService.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductService.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/ProductService.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductService.java diff --git a/spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java b/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java similarity index 100% rename from spring-boot-angular-ecommerce/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java rename to spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java diff --git a/spring-boot-angular/angularclient/.angular-cli.json b/spring-boot-angular/src/main/js/application/.angular-cli.json similarity index 100% rename from spring-boot-angular/angularclient/.angular-cli.json rename to spring-boot-angular/src/main/js/application/.angular-cli.json diff --git a/spring-boot-angular/angularclient/.editorconfig b/spring-boot-angular/src/main/js/application/.editorconfig similarity index 100% rename from spring-boot-angular/angularclient/.editorconfig rename to spring-boot-angular/src/main/js/application/.editorconfig diff --git a/spring-boot-angular/angularclient/.gitignore b/spring-boot-angular/src/main/js/application/.gitignore similarity index 82% rename from spring-boot-angular/angularclient/.gitignore rename to spring-boot-angular/src/main/js/application/.gitignore index eabf65e51a..0537fca516 100644 --- a/spring-boot-angular/angularclient/.gitignore +++ b/spring-boot-angular/src/main/js/application/.gitignore @@ -36,8 +36,8 @@ testem.log /typings # e2e -/e2e/*.js -/e2e/*.map +/spring-boot-angular/src/main/js/application/e2e/*.js +/spring-boot-angular/src/main/js/application/e2e/*.map # System Files .DS_Store diff --git a/spring-boot-angular/angularclient/README.md b/spring-boot-angular/src/main/js/application/README.md similarity index 100% rename from spring-boot-angular/angularclient/README.md rename to spring-boot-angular/src/main/js/application/README.md diff --git a/spring-boot-angular/angularclient/e2e/app.e2e-spec.ts b/spring-boot-angular/src/main/js/application/e2e/app.e2e-spec.ts similarity index 100% rename from spring-boot-angular/angularclient/e2e/app.e2e-spec.ts rename to spring-boot-angular/src/main/js/application/e2e/app.e2e-spec.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/e2e/src/app.po.ts b/spring-boot-angular/src/main/js/application/e2e/app.po.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/e2e/src/app.po.ts rename to spring-boot-angular/src/main/js/application/e2e/app.po.ts diff --git a/spring-boot-angular/angularclient/e2e/tsconfig.e2e.json b/spring-boot-angular/src/main/js/application/e2e/tsconfig.e2e.json similarity index 100% rename from spring-boot-angular/angularclient/e2e/tsconfig.e2e.json rename to spring-boot-angular/src/main/js/application/e2e/tsconfig.e2e.json diff --git a/spring-boot-angular/angularclient/karma.conf.js b/spring-boot-angular/src/main/js/application/karma.conf.js similarity index 100% rename from spring-boot-angular/angularclient/karma.conf.js rename to spring-boot-angular/src/main/js/application/karma.conf.js diff --git a/spring-boot-angular/angularclient/package-lock.json b/spring-boot-angular/src/main/js/application/package-lock.json similarity index 100% rename from spring-boot-angular/angularclient/package-lock.json rename to spring-boot-angular/src/main/js/application/package-lock.json diff --git a/spring-boot-angular/angularclient/package.json b/spring-boot-angular/src/main/js/application/package.json similarity index 100% rename from spring-boot-angular/angularclient/package.json rename to spring-boot-angular/src/main/js/application/package.json diff --git a/spring-boot-angular/angularclient/protractor.conf.js b/spring-boot-angular/src/main/js/application/protractor.conf.js similarity index 100% rename from spring-boot-angular/angularclient/protractor.conf.js rename to spring-boot-angular/src/main/js/application/protractor.conf.js diff --git a/spring-boot-angular/angularclient/src/app/app-routing.module.ts b/spring-boot-angular/src/main/js/application/src/app/app-routing.module.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/app-routing.module.ts rename to spring-boot-angular/src/main/js/application/src/app/app-routing.module.ts diff --git a/spring-boot-angular/angularclient/src/app/app.component.css b/spring-boot-angular/src/main/js/application/src/app/app.component.css similarity index 100% rename from spring-boot-angular/angularclient/src/app/app.component.css rename to spring-boot-angular/src/main/js/application/src/app/app.component.css diff --git a/spring-boot-angular/angularclient/src/app/app.component.html b/spring-boot-angular/src/main/js/application/src/app/app.component.html similarity index 100% rename from spring-boot-angular/angularclient/src/app/app.component.html rename to spring-boot-angular/src/main/js/application/src/app/app.component.html diff --git a/spring-boot-angular/angularclient/src/app/app.component.spec.ts b/spring-boot-angular/src/main/js/application/src/app/app.component.spec.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/app.component.spec.ts rename to spring-boot-angular/src/main/js/application/src/app/app.component.spec.ts diff --git a/spring-boot-angular/angularclient/src/app/app.component.ts b/spring-boot-angular/src/main/js/application/src/app/app.component.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/app.component.ts rename to spring-boot-angular/src/main/js/application/src/app/app.component.ts diff --git a/spring-boot-angular/angularclient/src/app/app.module.ts b/spring-boot-angular/src/main/js/application/src/app/app.module.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/app.module.ts rename to spring-boot-angular/src/main/js/application/src/app/app.module.ts diff --git a/spring-boot-angular/angularclient/src/app/model/user.ts b/spring-boot-angular/src/main/js/application/src/app/model/user.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/model/user.ts rename to spring-boot-angular/src/main/js/application/src/app/model/user.ts diff --git a/spring-boot-angular/angularclient/src/app/service/user.service.spec.ts b/spring-boot-angular/src/main/js/application/src/app/service/user.service.spec.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/service/user.service.spec.ts rename to spring-boot-angular/src/main/js/application/src/app/service/user.service.spec.ts diff --git a/spring-boot-angular/angularclient/src/app/service/user.service.ts b/spring-boot-angular/src/main/js/application/src/app/service/user.service.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/service/user.service.ts rename to spring-boot-angular/src/main/js/application/src/app/service/user.service.ts diff --git a/spring-boot-angular/angularclient/src/app/user-form/user-form.component.css b/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.css similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-form/user-form.component.css rename to spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.css diff --git a/spring-boot-angular/angularclient/src/app/user-form/user-form.component.html b/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.html similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-form/user-form.component.html rename to spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.html diff --git a/spring-boot-angular/angularclient/src/app/user-form/user-form.component.spec.ts b/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.spec.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-form/user-form.component.spec.ts rename to spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.spec.ts diff --git a/spring-boot-angular/angularclient/src/app/user-form/user-form.component.ts b/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-form/user-form.component.ts rename to spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.ts diff --git a/spring-boot-angular/angularclient/src/app/user-list/user-list.component.css b/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.css similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-list/user-list.component.css rename to spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.css diff --git a/spring-boot-angular/angularclient/src/app/user-list/user-list.component.html b/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.html similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-list/user-list.component.html rename to spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.html diff --git a/spring-boot-angular/angularclient/src/app/user-list/user-list.component.spec.ts b/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.spec.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-list/user-list.component.spec.ts rename to spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.spec.ts diff --git a/spring-boot-angular/angularclient/src/app/user-list/user-list.component.ts b/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.ts similarity index 100% rename from spring-boot-angular/angularclient/src/app/user-list/user-list.component.ts rename to spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/assets/.gitkeep b/spring-boot-angular/src/main/js/application/src/assets/.gitkeep similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/assets/.gitkeep rename to spring-boot-angular/src/main/js/application/src/assets/.gitkeep diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/environments/environment.prod.ts b/spring-boot-angular/src/main/js/application/src/environments/environment.prod.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/environments/environment.prod.ts rename to spring-boot-angular/src/main/js/application/src/environments/environment.prod.ts diff --git a/spring-boot-angular/angularclient/src/environments/environment.ts b/spring-boot-angular/src/main/js/application/src/environments/environment.ts similarity index 100% rename from spring-boot-angular/angularclient/src/environments/environment.ts rename to spring-boot-angular/src/main/js/application/src/environments/environment.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/favicon.ico b/spring-boot-angular/src/main/js/application/src/favicon.ico similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/favicon.ico rename to spring-boot-angular/src/main/js/application/src/favicon.ico diff --git a/spring-boot-angular/angularclient/src/index.html b/spring-boot-angular/src/main/js/application/src/index.html similarity index 100% rename from spring-boot-angular/angularclient/src/index.html rename to spring-boot-angular/src/main/js/application/src/index.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/main.ts b/spring-boot-angular/src/main/js/application/src/main.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/main.ts rename to spring-boot-angular/src/main/js/application/src/main.ts diff --git a/spring-boot-angular/angularclient/src/polyfills.ts b/spring-boot-angular/src/main/js/application/src/polyfills.ts similarity index 100% rename from spring-boot-angular/angularclient/src/polyfills.ts rename to spring-boot-angular/src/main/js/application/src/polyfills.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/styles.css b/spring-boot-angular/src/main/js/application/src/styles.css similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/styles.css rename to spring-boot-angular/src/main/js/application/src/styles.css diff --git a/spring-boot-angular/angularclient/src/tsconfig.app.json b/spring-boot-angular/src/main/js/application/src/tsconfig.app.json similarity index 100% rename from spring-boot-angular/angularclient/src/tsconfig.app.json rename to spring-boot-angular/src/main/js/application/src/tsconfig.app.json diff --git a/spring-boot-angular/angularclient/src/tsconfig.spec.json b/spring-boot-angular/src/main/js/application/src/tsconfig.spec.json similarity index 100% rename from spring-boot-angular/angularclient/src/tsconfig.spec.json rename to spring-boot-angular/src/main/js/application/src/tsconfig.spec.json diff --git a/spring-boot-angular/angularclient/src/typings.d.ts b/spring-boot-angular/src/main/js/application/src/typings.d.ts similarity index 100% rename from spring-boot-angular/angularclient/src/typings.d.ts rename to spring-boot-angular/src/main/js/application/src/typings.d.ts diff --git a/spring-boot-angular/angularclient/tsconfig.json b/spring-boot-angular/src/main/js/application/tsconfig.json similarity index 100% rename from spring-boot-angular/angularclient/tsconfig.json rename to spring-boot-angular/src/main/js/application/tsconfig.json diff --git a/spring-boot-angular/angularclient/tslint.json b/spring-boot-angular/src/main/js/application/tslint.json similarity index 100% rename from spring-boot-angular/angularclient/tslint.json rename to spring-boot-angular/src/main/js/application/tslint.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/.editorconfig b/spring-boot-angular/src/main/js/ecommerce/.editorconfig similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/.editorconfig rename to spring-boot-angular/src/main/js/ecommerce/.editorconfig diff --git a/spring-boot-angular-ecommerce/src/main/frontend/README.md b/spring-boot-angular/src/main/js/ecommerce/README.md similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/README.md rename to spring-boot-angular/src/main/js/ecommerce/README.md diff --git a/spring-boot-angular-ecommerce/src/main/frontend/angular.json b/spring-boot-angular/src/main/js/ecommerce/angular.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/angular.json rename to spring-boot-angular/src/main/js/ecommerce/angular.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/e2e/protractor.conf.js b/spring-boot-angular/src/main/js/ecommerce/e2e/protractor.conf.js similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/e2e/protractor.conf.js rename to spring-boot-angular/src/main/js/ecommerce/e2e/protractor.conf.js diff --git a/spring-boot-angular-ecommerce/src/main/frontend/e2e/src/app.e2e-spec.ts b/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.e2e-spec.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/e2e/src/app.e2e-spec.ts rename to spring-boot-angular/src/main/js/ecommerce/e2e/src/app.e2e-spec.ts diff --git a/spring-boot-angular/angularclient/e2e/app.po.ts b/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.po.ts similarity index 100% rename from spring-boot-angular/angularclient/e2e/app.po.ts rename to spring-boot-angular/src/main/js/ecommerce/e2e/src/app.po.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/e2e/tsconfig.e2e.json b/spring-boot-angular/src/main/js/ecommerce/e2e/tsconfig.e2e.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/e2e/tsconfig.e2e.json rename to spring-boot-angular/src/main/js/ecommerce/e2e/tsconfig.e2e.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/package-lock.json b/spring-boot-angular/src/main/js/ecommerce/package-lock.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/package-lock.json rename to spring-boot-angular/src/main/js/ecommerce/package-lock.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/package.json b/spring-boot-angular/src/main/js/ecommerce/package.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/package.json rename to spring-boot-angular/src/main/js/ecommerce/package.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/proxy-conf.json b/spring-boot-angular/src/main/js/ecommerce/proxy-conf.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/proxy-conf.json rename to spring-boot-angular/src/main/js/ecommerce/proxy-conf.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.css b/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.css similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.css rename to spring-boot-angular/src/main/js/ecommerce/src/app/app.component.css diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.html b/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.html similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.html rename to spring-boot-angular/src/main/js/ecommerce/src/app/app.component.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.spec.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.spec.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.spec.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/app.component.spec.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/app.component.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/app.component.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/app.module.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/app.module.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/app.module.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/app.module.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.css b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.css similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.css rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.css diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.html b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.html similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.html rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.spec.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.spec.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.spec.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.spec.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/ecommerce.component.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/models/product-order.model.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-order.model.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/models/product-order.model.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-order.model.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/models/product-orders.model.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-orders.model.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/models/product-orders.model.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-orders.model.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/models/product.model.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product.model.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/models/product.model.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product.model.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.css b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.css similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.css rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.css diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.html b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.html similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.html rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.spec.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.spec.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.spec.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.spec.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/orders/orders.component.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.css b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.css similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.css rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.css diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.html b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.html similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.html rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.spec.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.spec.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.spec.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.spec.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/products/products.component.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/services/EcommerceService.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/services/EcommerceService.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/services/EcommerceService.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/services/EcommerceService.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.css b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.css similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.css rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.css diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.html b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.html similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.html rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.ts b/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/app/ecommerce/shopping-cart/shopping-cart.component.ts rename to spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.ts diff --git a/spring-boot-angular/angularclient/src/assets/.gitkeep b/spring-boot-angular/src/main/js/ecommerce/src/assets/.gitkeep similarity index 100% rename from spring-boot-angular/angularclient/src/assets/.gitkeep rename to spring-boot-angular/src/main/js/ecommerce/src/assets/.gitkeep diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/browserslist b/spring-boot-angular/src/main/js/ecommerce/src/browserslist similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/browserslist rename to spring-boot-angular/src/main/js/ecommerce/src/browserslist diff --git a/spring-boot-angular/angularclient/src/environments/environment.prod.ts b/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.prod.ts similarity index 100% rename from spring-boot-angular/angularclient/src/environments/environment.prod.ts rename to spring-boot-angular/src/main/js/ecommerce/src/environments/environment.prod.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/environments/environment.ts b/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/environments/environment.ts rename to spring-boot-angular/src/main/js/ecommerce/src/environments/environment.ts diff --git a/spring-boot-angular/angularclient/src/favicon.ico b/spring-boot-angular/src/main/js/ecommerce/src/favicon.ico similarity index 100% rename from spring-boot-angular/angularclient/src/favicon.ico rename to spring-boot-angular/src/main/js/ecommerce/src/favicon.ico diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/index.html b/spring-boot-angular/src/main/js/ecommerce/src/index.html similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/index.html rename to spring-boot-angular/src/main/js/ecommerce/src/index.html diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/karma.conf.js b/spring-boot-angular/src/main/js/ecommerce/src/karma.conf.js similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/karma.conf.js rename to spring-boot-angular/src/main/js/ecommerce/src/karma.conf.js diff --git a/spring-boot-angular/angularclient/src/main.ts b/spring-boot-angular/src/main/js/ecommerce/src/main.ts similarity index 100% rename from spring-boot-angular/angularclient/src/main.ts rename to spring-boot-angular/src/main/js/ecommerce/src/main.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/polyfills.ts b/spring-boot-angular/src/main/js/ecommerce/src/polyfills.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/polyfills.ts rename to spring-boot-angular/src/main/js/ecommerce/src/polyfills.ts diff --git a/spring-boot-angular/angularclient/src/styles.css b/spring-boot-angular/src/main/js/ecommerce/src/styles.css similarity index 100% rename from spring-boot-angular/angularclient/src/styles.css rename to spring-boot-angular/src/main/js/ecommerce/src/styles.css diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/test.ts b/spring-boot-angular/src/main/js/ecommerce/src/test.ts similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/test.ts rename to spring-boot-angular/src/main/js/ecommerce/src/test.ts diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/tsconfig.app.json b/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.app.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/tsconfig.app.json rename to spring-boot-angular/src/main/js/ecommerce/src/tsconfig.app.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/tsconfig.spec.json b/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.spec.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/tsconfig.spec.json rename to spring-boot-angular/src/main/js/ecommerce/src/tsconfig.spec.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/src/tslint.json b/spring-boot-angular/src/main/js/ecommerce/src/tslint.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/src/tslint.json rename to spring-boot-angular/src/main/js/ecommerce/src/tslint.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/tsconfig.json b/spring-boot-angular/src/main/js/ecommerce/tsconfig.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/tsconfig.json rename to spring-boot-angular/src/main/js/ecommerce/tsconfig.json diff --git a/spring-boot-angular-ecommerce/src/main/frontend/tslint.json b/spring-boot-angular/src/main/js/ecommerce/tslint.json similarity index 100% rename from spring-boot-angular-ecommerce/src/main/frontend/tslint.json rename to spring-boot-angular/src/main/js/ecommerce/tslint.json diff --git a/spring-boot-angular-ecommerce/src/main/resources/application.properties b/spring-boot-angular/src/main/resources/application.properties similarity index 100% rename from spring-boot-angular-ecommerce/src/main/resources/application.properties rename to spring-boot-angular/src/main/resources/application.properties diff --git a/spring-boot-angular-ecommerce/src/main/resources/logback.xml b/spring-boot-angular/src/main/resources/logback.xml similarity index 100% rename from spring-boot-angular-ecommerce/src/main/resources/logback.xml rename to spring-boot-angular/src/main/resources/logback.xml diff --git a/spring-boot-angular-ecommerce/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java b/spring-boot-angular/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java similarity index 100% rename from spring-boot-angular-ecommerce/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java rename to spring-boot-angular/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java diff --git a/spring-boot-angular-ecommerce/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-boot-angular/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-boot-angular-ecommerce/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to spring-boot-angular/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-boot-angular-ecommerce/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-angular/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-angular-ecommerce/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-angular/src/test/java/org/baeldung/SpringContextTest.java From 5621a6d8c5b527a607a261db4eea0d838393e2ab Mon Sep 17 00:00:00 2001 From: macroscopic64 Date: Sat, 28 Sep 2019 11:38:39 +0530 Subject: [PATCH 074/107] [BAEL-3288] - Graceful Shutdown of a Spring Boot Application --- .../baeldung/gracefulshutdown/GracefulShutdownApplication.java | 0 .../baeldung/gracefulshutdown/beans/LongRunningProcessBean.java | 0 .../com/baeldung/gracefulshutdown/config/SpringConfiguration.java | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {spring-boot => spring-boot-ops-2}/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java (100%) rename {spring-boot => spring-boot-ops-2}/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java (100%) rename {spring-boot => spring-boot-ops-2}/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java (100%) diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java b/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java rename to spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java b/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java rename to spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java diff --git a/spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java b/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java rename to spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java From d4b9f8a59a7a665941259e84a18cb7d1545f7ffa Mon Sep 17 00:00:00 2001 From: macroscopic64 Date: Sat, 28 Sep 2019 11:40:44 +0530 Subject: [PATCH 075/107] [BAEL-3288] - Graceful Shutdown of a Spring Boot Application --- .../baeldung/gracefulshutdown/GracefulShutdownApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java b/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java index 9cb226a49f..dd0d0f920c 100644 --- a/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java +++ b/spring-boot-ops-2/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java @@ -3,7 +3,7 @@ package com.baeldung.gracefulshutdown; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -@SpringBootApplication(scanBasePackages = {"com.baeldung.gracefulshutdown"}) +@SpringBootApplication public class GracefulShutdownApplication { public static void main(String args[]) { From a846c037cbe24aac76faeee1f4c3e3091e6ca8d4 Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Fri, 30 Aug 2019 00:34:11 +0200 Subject: [PATCH 076/107] BAEL-3219 Parsing an XML File Using SAX Parser --- .../java/com/baeldung/sax/SaxParserMain.java | 161 ++++++++++++++++++ xml/src/main/resources/sax/baeldung.xml | 16 ++ 2 files changed, 177 insertions(+) create mode 100644 xml/src/main/java/com/baeldung/sax/SaxParserMain.java create mode 100644 xml/src/main/resources/sax/baeldung.xml diff --git a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java new file mode 100644 index 0000000000..fdf9b524d0 --- /dev/null +++ b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java @@ -0,0 +1,161 @@ +package com.baeldung.sax; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class SaxParserMain { + public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + + BaeldungHandler baeldungHandler = new BaeldungHandler(); + saxParser.parse("xml\\src\\main\\resources\\sax\\baeldung.xml", baeldungHandler); + System.out.println(baeldungHandler.getWebsite()); + } + + public static class BaeldungHandler extends DefaultHandler { + private Baeldung website; + private String elementValue; + + @Override + public void characters(char[] ch, int start, int length) throws SAXException { + elementValue = new String(ch, start, length); + } + + @Override + public void startDocument() throws SAXException { + website = new Baeldung(); + } + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + switch (qName) { + case ARTICLES: + website.setArticleList(new ArrayList<>()); + break; + case ARTICLE: + website.getArticleList().add(new BaeldungArticle()); + } + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + switch (qName) { + case TITLE: + latestArticle().setTitle(elementValue); + break; + case CONTENT: + latestArticle().setContent(elementValue); + break; + } + } + + private BaeldungArticle latestArticle() { + List articleList = website.getArticleList(); + int latestArticleIndex = articleList.size() - 1; + return articleList.get(latestArticleIndex); + } + + public Baeldung getWebsite() { + return website; + } + + @Override + public String toString() { + return "BaeldungHandler{" + + "website=" + website + + ", elementValue='" + elementValue + '\'' + + '}'; + } + + private static final String ARTICLES = "articles"; + private static final String ARTICLE = "article"; + private static final String TITLE = "title"; + private static final String CONTENT = "content"; + } + + + public static class Baeldung { + private List articleList; + + public List getArticleList() { + return articleList; + } + + public void setArticleList(List articleList) { + this.articleList = articleList; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Baeldung baeldung = (Baeldung) o; + return Objects.equals(articleList, baeldung.articleList); + } + + @Override + public int hashCode() { + return Objects.hash(articleList); + } + + @Override + public String toString() { + return "Baeldung{" + + "articleList=" + articleList + + '}'; + } + } + + public static class BaeldungArticle { + private String title; + private String content; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BaeldungArticle that = (BaeldungArticle) o; + return Objects.equals(title, that.title) && + Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + return Objects.hash(title, content); + } + + @Override + public String toString() { + return "BaeldungArticle{" + + "title='" + title + '\'' + + ", content='" + content + '\'' + + '}'; + } + } +} diff --git a/xml/src/main/resources/sax/baeldung.xml b/xml/src/main/resources/sax/baeldung.xml new file mode 100644 index 0000000000..4b839f35c7 --- /dev/null +++ b/xml/src/main/resources/sax/baeldung.xml @@ -0,0 +1,16 @@ + + +
+ Parsing an XML File Using SAX Parser + Lorem ipsum... +
+
+ Parsing an XML File Using DOM Parser + Lorem ipsum... +
+
+ Parsing an XML File Using StAX Parser + Lorem ipsum... +
+
+
\ No newline at end of file From 6e77eef313253f92b4c9643e1e75f72cce41e7ba Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Sat, 31 Aug 2019 13:38:40 +0200 Subject: [PATCH 077/107] BAEL-3219 Parsing an XML File Using SAX Parser --- .../com/baeldung/sax/SaxParserMainTest.java | 44 +++++++++++++++++++ xml/src/test/resources/sax/baeldung.xml | 16 +++++++ 2 files changed, 60 insertions(+) create mode 100644 xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java create mode 100644 xml/src/test/resources/sax/baeldung.xml diff --git a/xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java b/xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java new file mode 100644 index 0000000000..af31bc3bd2 --- /dev/null +++ b/xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java @@ -0,0 +1,44 @@ +package com.baeldung.sax; + +import org.junit.Test; +import org.xml.sax.SAXException; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import java.io.IOException; +import java.util.List; + +import static org.junit.Assert.*; + +public class SaxParserMainTest { + + @Test + void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + + SaxParserMain.BaeldungHandler baeldungHandler = new SaxParserMain.BaeldungHandler(); + saxParser.parse("xml\\src\\test\\resources\\sax\\baeldung.xml", baeldungHandler); + + SaxParserMain.Baeldung result = baeldungHandler.getWebsite(); + + assertNotNull(result); + List articles = result.getArticleList(); + + assertNotNull(articles); + assertEquals(3, articles.size()); + + SaxParserMain.BaeldungArticle articleOne = articles.get(0); + assertEquals("Parsing an XML File Using SAX Parser", articleOne.getTitle()); + assertEquals("Lorem ipsum...", articleOne.getContent()); + + SaxParserMain.BaeldungArticle articleTwo = articles.get(1); + assertEquals("Parsing an XML File Using DOM Parser", articleTwo.getTitle()); + assertEquals("Lorem ipsum...", articleTwo.getContent()); + + SaxParserMain.BaeldungArticle articleThree = articles.get(2); + assertEquals("Parsing an XML File Using StAX Parser", articleThree.getTitle()); + assertEquals("Lorem ipsum...", articleThree.getContent()); + } +} diff --git a/xml/src/test/resources/sax/baeldung.xml b/xml/src/test/resources/sax/baeldung.xml new file mode 100644 index 0000000000..4b839f35c7 --- /dev/null +++ b/xml/src/test/resources/sax/baeldung.xml @@ -0,0 +1,16 @@ + + +
+ Parsing an XML File Using SAX Parser + Lorem ipsum... +
+
+ Parsing an XML File Using DOM Parser + Lorem ipsum... +
+
+ Parsing an XML File Using StAX Parser + Lorem ipsum... +
+
+
\ No newline at end of file From 21804927e3b2bdd1edcad9af94581edd8b445fe3 Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Sat, 31 Aug 2019 15:40:44 +0200 Subject: [PATCH 078/107] BAEL-3219 Parsing an XML File Using SAX Parser --- .../{SaxParserMainTest.java => SaxParserMainUnitTest.java} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename xml/src/test/java/com/baeldung/sax/{SaxParserMainTest.java => SaxParserMainUnitTest.java} (84%) diff --git a/xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java similarity index 84% rename from xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java rename to xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java index af31bc3bd2..d9351aed03 100644 --- a/xml/src/test/java/com/baeldung/sax/SaxParserMainTest.java +++ b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java @@ -11,15 +11,15 @@ import java.util.List; import static org.junit.Assert.*; -public class SaxParserMainTest { +public class SaxParserMainUnitTest { @Test - void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException { + public void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); SaxParserMain.BaeldungHandler baeldungHandler = new SaxParserMain.BaeldungHandler(); - saxParser.parse("xml\\src\\test\\resources\\sax\\baeldung.xml", baeldungHandler); + saxParser.parse("src\\test\\resources\\sax\\baeldung.xml", baeldungHandler); SaxParserMain.Baeldung result = baeldungHandler.getWebsite(); From 08da9be66649c6056a6490f25ac7d446172e23a6 Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Sat, 31 Aug 2019 21:48:19 +0200 Subject: [PATCH 079/107] BAEL-3219 Parsing an XML File Using SAX Parser --- .../java/com/baeldung/sax/SaxParserMainUnitTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java index d9351aed03..d94857dbb5 100644 --- a/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java +++ b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java @@ -7,6 +7,11 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; import static org.junit.Assert.*; @@ -14,12 +19,13 @@ import static org.junit.Assert.*; public class SaxParserMainUnitTest { @Test - public void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException { + public void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException, URISyntaxException { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); SaxParserMain.BaeldungHandler baeldungHandler = new SaxParserMain.BaeldungHandler(); - saxParser.parse("src\\test\\resources\\sax\\baeldung.xml", baeldungHandler); + Path path = Paths.get(new URL("src\\test\\resources\\sax\\baeldung.xml").toURI()); + saxParser.parse(path.toFile(), baeldungHandler); SaxParserMain.Baeldung result = baeldungHandler.getWebsite(); From 6f4957a63d07358c4bfa9acc4819d0164b15b6dd Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Sat, 31 Aug 2019 21:57:51 +0200 Subject: [PATCH 080/107] BAEL-3219 Parsing an XML File Using SAX Parser --- .../java/com/baeldung/sax/SaxParserMainUnitTest.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java index d94857dbb5..8a8aa62dd2 100644 --- a/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java +++ b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java @@ -7,11 +7,6 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.List; import static org.junit.Assert.*; @@ -19,13 +14,12 @@ import static org.junit.Assert.*; public class SaxParserMainUnitTest { @Test - public void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException, URISyntaxException { + public void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); SaxParserMain.BaeldungHandler baeldungHandler = new SaxParserMain.BaeldungHandler(); - Path path = Paths.get(new URL("src\\test\\resources\\sax\\baeldung.xml").toURI()); - saxParser.parse(path.toFile(), baeldungHandler); + saxParser.parse("src/test/resources/sax/baeldung.xml", baeldungHandler); SaxParserMain.Baeldung result = baeldungHandler.getWebsite(); From 59729b7e2339cd63072566db388691b22112f6bc Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Sun, 1 Sep 2019 21:37:01 +0200 Subject: [PATCH 081/107] BAEL-3219 Parsing an XML File Using SAX Parser --- xml/pom.xml | 7 ++ .../java/com/baeldung/sax/SaxParserMain.java | 93 +++---------------- 2 files changed, 18 insertions(+), 82 deletions(-) diff --git a/xml/pom.xml b/xml/pom.xml index bbd607f9b5..3b8b88ba73 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -111,6 +111,13 @@ ${commons-lang.version}
+ + org.projectlombok + lombok + 1.18.8 + provided + + org.junit.jupiter junit-jupiter diff --git a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java index fdf9b524d0..654d5162cd 100644 --- a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java +++ b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java @@ -1,5 +1,7 @@ package com.baeldung.sax; +import lombok.Data; +import lombok.ToString; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; @@ -10,7 +12,6 @@ import javax.xml.parsers.SAXParserFactory; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Objects; public class SaxParserMain { public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException { @@ -18,11 +19,17 @@ public class SaxParserMain { SAXParser saxParser = factory.newSAXParser(); BaeldungHandler baeldungHandler = new BaeldungHandler(); - saxParser.parse("xml\\src\\main\\resources\\sax\\baeldung.xml", baeldungHandler); + saxParser.parse("xml/src/main/resources/sax/baeldung.xml", baeldungHandler); System.out.println(baeldungHandler.getWebsite()); } + @ToString public static class BaeldungHandler extends DefaultHandler { + private static final String ARTICLES = "articles"; + private static final String ARTICLE = "article"; + private static final String TITLE = "title"; + private static final String CONTENT = "content"; + private Baeldung website; private String elementValue; @@ -68,94 +75,16 @@ public class SaxParserMain { public Baeldung getWebsite() { return website; } - - @Override - public String toString() { - return "BaeldungHandler{" + - "website=" + website + - ", elementValue='" + elementValue + '\'' + - '}'; - } - - private static final String ARTICLES = "articles"; - private static final String ARTICLE = "article"; - private static final String TITLE = "title"; - private static final String CONTENT = "content"; } - + @Data public static class Baeldung { private List articleList; - - public List getArticleList() { - return articleList; - } - - public void setArticleList(List articleList) { - this.articleList = articleList; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Baeldung baeldung = (Baeldung) o; - return Objects.equals(articleList, baeldung.articleList); - } - - @Override - public int hashCode() { - return Objects.hash(articleList); - } - - @Override - public String toString() { - return "Baeldung{" + - "articleList=" + articleList + - '}'; - } } + @Data public static class BaeldungArticle { private String title; private String content; - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - BaeldungArticle that = (BaeldungArticle) o; - return Objects.equals(title, that.title) && - Objects.equals(content, that.content); - } - - @Override - public int hashCode() { - return Objects.hash(title, content); - } - - @Override - public String toString() { - return "BaeldungArticle{" + - "title='" + title + '\'' + - ", content='" + content + '\'' + - '}'; - } } } From f82e007672f60178d1e3b4e5ba207536805f464b Mon Sep 17 00:00:00 2001 From: YassinHajaj Date: Fri, 6 Sep 2019 16:01:11 +0000 Subject: [PATCH 082/107] BAEL-3219 --- xml/pom.xml | 13 ++------ .../java/com/baeldung/sax/SaxParserMain.java | 32 ++++++++++++++++--- xml/src/main/resources/sax/baeldung.xml | 6 ++-- .../baeldung/sax/SaxParserMainUnitTest.java | 8 ++--- xml/src/test/resources/sax/baeldung.xml | 6 ++-- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/xml/pom.xml b/xml/pom.xml index 3b8b88ba73..24969d1d6b 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -111,13 +111,6 @@ ${commons-lang.version} - - org.projectlombok - lombok - 1.18.8 - provided - - org.junit.jupiter junit-jupiter @@ -332,7 +325,7 @@ - maven-assembly-plugin @@ -352,9 +345,9 @@ - make-assembly - package attached diff --git a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java index 654d5162cd..5aba9409de 100644 --- a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java +++ b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java @@ -1,7 +1,5 @@ package com.baeldung.sax; -import lombok.Data; -import lombok.ToString; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; @@ -23,7 +21,7 @@ public class SaxParserMain { System.out.println(baeldungHandler.getWebsite()); } - @ToString + //@ToString public static class BaeldungHandler extends DefaultHandler { private static final String ARTICLES = "articles"; private static final String ARTICLE = "article"; @@ -77,14 +75,38 @@ public class SaxParserMain { } } - @Data + //@Data public static class Baeldung { private List articleList; + + public void setArticleList(List articleList) { + this.articleList = articleList; + } + + public List getArticleList() { + return this.articleList; + } } - @Data + //@Data public static class BaeldungArticle { private String title; private String content; + + public void setTitle(String title) { + this.title = title; + } + + public String getTitle() { + return this.title; + } + + public void setContent(String content) { + this.content = content; + } + + public String getContent() { + return this.content; + } } } diff --git a/xml/src/main/resources/sax/baeldung.xml b/xml/src/main/resources/sax/baeldung.xml index 4b839f35c7..6736d5bdca 100644 --- a/xml/src/main/resources/sax/baeldung.xml +++ b/xml/src/main/resources/sax/baeldung.xml @@ -2,15 +2,15 @@
Parsing an XML File Using SAX Parser - Lorem ipsum... + SAX Parser's Lorem ipsum...
Parsing an XML File Using DOM Parser - Lorem ipsum... + DOM Parser's Lorem ipsum...
Parsing an XML File Using StAX Parser - Lorem ipsum... + StAX Parser's Lorem ipsum...
\ No newline at end of file diff --git a/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java index 8a8aa62dd2..333c5619c8 100644 --- a/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java +++ b/xml/src/test/java/com/baeldung/sax/SaxParserMainUnitTest.java @@ -14,7 +14,7 @@ import static org.junit.Assert.*; public class SaxParserMainUnitTest { @Test - public void parse_baeldung_xml_document() throws IOException, SAXException, ParserConfigurationException { + public void givenAProperXMLFile_whenItIsParsed_ThenAnObjectContainsAllItsElements() throws IOException, SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); @@ -31,14 +31,14 @@ public class SaxParserMainUnitTest { SaxParserMain.BaeldungArticle articleOne = articles.get(0); assertEquals("Parsing an XML File Using SAX Parser", articleOne.getTitle()); - assertEquals("Lorem ipsum...", articleOne.getContent()); + assertEquals("SAX Parser's Lorem ipsum...", articleOne.getContent()); SaxParserMain.BaeldungArticle articleTwo = articles.get(1); assertEquals("Parsing an XML File Using DOM Parser", articleTwo.getTitle()); - assertEquals("Lorem ipsum...", articleTwo.getContent()); + assertEquals("DOM Parser's Lorem ipsum...", articleTwo.getContent()); SaxParserMain.BaeldungArticle articleThree = articles.get(2); assertEquals("Parsing an XML File Using StAX Parser", articleThree.getTitle()); - assertEquals("Lorem ipsum...", articleThree.getContent()); + assertEquals("StAX Parser's Lorem ipsum...", articleThree.getContent()); } } diff --git a/xml/src/test/resources/sax/baeldung.xml b/xml/src/test/resources/sax/baeldung.xml index 4b839f35c7..6736d5bdca 100644 --- a/xml/src/test/resources/sax/baeldung.xml +++ b/xml/src/test/resources/sax/baeldung.xml @@ -2,15 +2,15 @@
Parsing an XML File Using SAX Parser - Lorem ipsum... + SAX Parser's Lorem ipsum...
Parsing an XML File Using DOM Parser - Lorem ipsum... + DOM Parser's Lorem ipsum...
Parsing an XML File Using StAX Parser - Lorem ipsum... + StAX Parser's Lorem ipsum...
\ No newline at end of file From d7107a5931a92570e7aa5be428e9e50ef0abf201 Mon Sep 17 00:00:00 2001 From: YassinHajaj Date: Sat, 28 Sep 2019 13:57:53 +0200 Subject: [PATCH 083/107] BAEL-3219 --- xml/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/pom.xml b/xml/pom.xml index 24969d1d6b..bbd607f9b5 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -325,7 +325,7 @@
- maven-assembly-plugin @@ -345,9 +345,9 @@ - make-assembly - package attached From 83535d53c8a94286ef1d023edc7d0936ddd32b64 Mon Sep 17 00:00:00 2001 From: "yassin.hajaj" Date: Sat, 28 Sep 2019 14:19:11 +0200 Subject: [PATCH 084/107] BAEL-3219 --- xml/src/main/java/com/baeldung/sax/SaxParserMain.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java index 5aba9409de..4908c10386 100644 --- a/xml/src/main/java/com/baeldung/sax/SaxParserMain.java +++ b/xml/src/main/java/com/baeldung/sax/SaxParserMain.java @@ -21,7 +21,6 @@ public class SaxParserMain { System.out.println(baeldungHandler.getWebsite()); } - //@ToString public static class BaeldungHandler extends DefaultHandler { private static final String ARTICLES = "articles"; private static final String ARTICLE = "article"; @@ -75,7 +74,6 @@ public class SaxParserMain { } } - //@Data public static class Baeldung { private List articleList; @@ -88,7 +86,6 @@ public class SaxParserMain { } } - //@Data public static class BaeldungArticle { private String title; private String content; From c5e7773a5151fdbfae81939f1bb7c4d81c50c565 Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Sat, 28 Sep 2019 21:06:14 +0300 Subject: [PATCH 085/107] Split or move persistence-modules/java-jpa module (#7887) --- persistence-modules/java-jpa-2/README.md | 6 +- .../jpa/criteria}/CustomItemRepository.java | 22 ++- .../criteria}/CustomItemRepositoryImpl.java | 149 +++++++++--------- .../java/com/baeldung/jpa/criteria}/Item.java | 98 ++++++------ .../com/baeldung/jpa/defaultvalues/User.java | 0 .../jpa/defaultvalues/UserRepository.java | 0 .../com/baeldung/jpa/projections/Product.java | 0 .../jpa/projections/ProductRepository.java | 0 .../jpa/querytypes/QueryTypesExamples.java | 0 .../baeldung/jpa/querytypes/UserEntity.java | 0 .../main/resources/META-INF/persistence.xml | 87 ++++++++++ .../src/main}/resources/item.sql | 6 +- .../src/main/resources/products_jpa.sql | 0 .../CustomItemRepositoryIntegrationTest.java | 88 +++++------ .../UserDefaultValuesUnitTest.java | 0 .../HibernateProjectionsIntegrationTest.java | 0 .../ProductRepositoryIntegrationTest.java | 0 .../QueryTypesExamplesIntegrationTest.java | 0 .../src/test/resources/products.sql | 0 .../src/test/resources/users.sql | 0 persistence-modules/java-jpa/README.md | 8 +- .../convertdates}/LocalDateConverter.java | 2 +- .../baeldung/{util => jpa/entity}/Gender.java | 2 +- .../java/com/baeldung/jpa/entity/Student.java | 2 - .../jpa/{entity => primarykeys}/Account.java | 2 +- .../{entity => primarykeys}/AccountId.java | 2 +- .../jpa/{entity => primarykeys}/Book.java | 2 +- .../jpa/{entity => primarykeys}/BookId.java | 2 +- .../sqlresultsetmapping/Employee.java | 4 +- .../sqlresultsetmapping/ScheduledDay.java | 8 +- .../main/resources/META-INF/persistence.xml | 97 +----------- .../entity/StudentEntityIntegrationTest.java | 2 - .../CompositeKeysIntegrationTest.java | 6 +- .../SqlResultSetMappingUnitTest.java | 2 +- 34 files changed, 296 insertions(+), 301 deletions(-) rename persistence-modules/{java-jpa/src/main/java/com/baeldung/jpa/criteria/repository => java-jpa-2/src/main/java/com/baeldung/jpa/criteria}/CustomItemRepository.java (59%) rename persistence-modules/{java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl => java-jpa-2/src/main/java/com/baeldung/jpa/criteria}/CustomItemRepositoryImpl.java (91%) rename persistence-modules/{java-jpa/src/main/java/com/baeldung/jpa/criteria/entity => java-jpa-2/src/main/java/com/baeldung/jpa/criteria}/Item.java (89%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/java/com/baeldung/jpa/defaultvalues/User.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/java/com/baeldung/jpa/projections/Product.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/java/com/baeldung/jpa/projections/ProductRepository.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java (100%) rename persistence-modules/{java-jpa/src/test => java-jpa-2/src/main}/resources/item.sql (98%) rename persistence-modules/{java-jpa => java-jpa-2}/src/main/resources/products_jpa.sql (100%) rename persistence-modules/{java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl => java-jpa-2/src/test/java/com/baeldung/jpa/criteria}/CustomItemRepositoryIntegrationTest.java (86%) rename persistence-modules/{java-jpa => java-jpa-2}/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/test/resources/products.sql (100%) rename persistence-modules/{java-jpa => java-jpa-2}/src/test/resources/users.sql (100%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/{util => jpa/convertdates}/LocalDateConverter.java (94%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/{util => jpa/entity}/Gender.java (54%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/{entity => primarykeys}/Account.java (95%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/{entity => primarykeys}/AccountId.java (97%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/{entity => primarykeys}/Book.java (93%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/{entity => primarykeys}/BookId.java (97%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/{ => jpa}/sqlresultsetmapping/Employee.java (85%) rename persistence-modules/java-jpa/src/main/java/com/baeldung/{ => jpa}/sqlresultsetmapping/ScheduledDay.java (89%) rename persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/{entity => primarykeys}/CompositeKeysIntegrationTest.java (93%) rename persistence-modules/java-jpa/src/test/java/com/baeldung/{ => jpa}/sqlresultsetmapping/SqlResultSetMappingUnitTest.java (98%) diff --git a/persistence-modules/java-jpa-2/README.md b/persistence-modules/java-jpa-2/README.md index 579dcbdab0..0e1889c1fc 100644 --- a/persistence-modules/java-jpa-2/README.md +++ b/persistence-modules/java-jpa-2/README.md @@ -1,4 +1,8 @@ # Relevant Articles -- [JPA Query Parameters Usage](http://www.baeldung.com/jpa-query-parameters-usage) +- [JPA Query Parameters Usage](https://www.baeldung.com/jpa-query-parameters-usage) - [Mapping Entitiy Class Names to SQL Table Names with JPA](https://www.baeldung.com/jpa-entity-table-names) +- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values) +- [Types of JPA Queries](https://www.baeldung.com/jpa-queries) +- [JPA/Hibernate Projections](https://www.baeldung.com/jpa-hibernate-projections) +- [Combining JPA And/Or Criteria Predicates](https://www.baeldung.com/jpa-and-or-criteria-predicates) diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/CustomItemRepository.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepository.java similarity index 59% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/CustomItemRepository.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepository.java index c55dc4a592..c85ac53ac2 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/CustomItemRepository.java +++ b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepository.java @@ -1,12 +1,10 @@ -package com.baeldung.jpa.criteria.repository; - -import java.util.List; - -import com.baeldung.jpa.criteria.entity.Item; - -public interface CustomItemRepository { - - List findItemsByColorAndGrade(); - - List findItemByColorOrGrade(); -} +package com.baeldung.jpa.criteria; + +import java.util.List; + +public interface CustomItemRepository { + + List findItemsByColorAndGrade(); + + List findItemByColorOrGrade(); +} diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryImpl.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepositoryImpl.java similarity index 91% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryImpl.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepositoryImpl.java index bf1d3eed0b..c64cd14ca5 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryImpl.java +++ b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/CustomItemRepositoryImpl.java @@ -1,77 +1,72 @@ -package com.baeldung.jpa.criteria.repository.impl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; - -import com.baeldung.jpa.criteria.entity.Item; -import com.baeldung.jpa.criteria.repository.CustomItemRepository; - -public class CustomItemRepositoryImpl implements CustomItemRepository { - - private EntityManager entityManager; - - public CustomItemRepositoryImpl() { - super(); - EntityManagerFactory factory = Persistence.createEntityManagerFactory("jpa-h2-criteria"); - entityManager = factory.createEntityManager(); - } - - @Override - public List findItemsByColorAndGrade() { - - CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class); - Root itemRoot = criteriaQuery.from(Item.class); - - Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "blue"); - Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "red"); - Predicate predicateForColor = criteriaBuilder.or(predicateForBlueColor, predicateForRedColor); - - Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "A"); - Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B"); - Predicate predicateForGrade = criteriaBuilder.or(predicateForGradeA, predicateForGradeB); - - // final search filter - Predicate finalPredicate = criteriaBuilder.and(predicateForColor, predicateForGrade); - - criteriaQuery.where(finalPredicate); - - List items = entityManager.createQuery(criteriaQuery) - .getResultList(); - return items; - } - - @Override - public List findItemByColorOrGrade() { - - CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class); - Root itemRoot = criteriaQuery.from(Item.class); - - Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "red"); - Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "D"); - Predicate predicateForBlueColorAndGradeA = criteriaBuilder.and(predicateForBlueColor, predicateForGradeA); - - Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "blue"); - Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B"); - Predicate predicateForRedColorAndGradeB = criteriaBuilder.and(predicateForRedColor, predicateForGradeB); - - // final search filter - Predicate finalPredicate = criteriaBuilder.or(predicateForBlueColorAndGradeA, predicateForRedColorAndGradeB); - - criteriaQuery.where(finalPredicate); - - List items = entityManager.createQuery(criteriaQuery) - .getResultList(); - return items; - } -} +package com.baeldung.jpa.criteria; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; + +public class CustomItemRepositoryImpl implements CustomItemRepository { + + private EntityManager entityManager; + + public CustomItemRepositoryImpl() { + super(); + EntityManagerFactory factory = Persistence.createEntityManagerFactory("jpa-h2-criteria"); + entityManager = factory.createEntityManager(); + } + + @Override + public List findItemsByColorAndGrade() { + + CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); + CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class); + Root itemRoot = criteriaQuery.from(Item.class); + + Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "blue"); + Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "red"); + Predicate predicateForColor = criteriaBuilder.or(predicateForBlueColor, predicateForRedColor); + + Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "A"); + Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B"); + Predicate predicateForGrade = criteriaBuilder.or(predicateForGradeA, predicateForGradeB); + + // final search filter + Predicate finalPredicate = criteriaBuilder.and(predicateForColor, predicateForGrade); + + criteriaQuery.where(finalPredicate); + + List items = entityManager.createQuery(criteriaQuery) + .getResultList(); + return items; + } + + @Override + public List findItemByColorOrGrade() { + + CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); + CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Item.class); + Root itemRoot = criteriaQuery.from(Item.class); + + Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "red"); + Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "D"); + Predicate predicateForBlueColorAndGradeA = criteriaBuilder.and(predicateForBlueColor, predicateForGradeA); + + Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "blue"); + Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B"); + Predicate predicateForRedColorAndGradeB = criteriaBuilder.and(predicateForRedColor, predicateForGradeB); + + // final search filter + Predicate finalPredicate = criteriaBuilder.or(predicateForBlueColorAndGradeA, predicateForRedColorAndGradeB); + + criteriaQuery.where(finalPredicate); + + List items = entityManager.createQuery(criteriaQuery) + .getResultList(); + return items; + } +} diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/entity/Item.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/Item.java similarity index 89% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/entity/Item.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/Item.java index 64ef46f265..f6093e5735 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/criteria/entity/Item.java +++ b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/criteria/Item.java @@ -1,49 +1,49 @@ -package com.baeldung.jpa.criteria.entity; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Table(name = "item") -@Entity -public class Item { - - @Id - private Long id; - private String color; - private String grade; - private String name; - - public String getColor() { - return color; - } - - public String getGrade() { - return grade; - } - - public Long getId() { - return id; - } - - public String getName() { - return name; - } - - public void setColor(String color) { - this.color = color; - } - - public void setGrade(String grade) { - this.grade = grade; - } - - public void setId(Long id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - -} +package com.baeldung.jpa.criteria; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Table(name = "item") +@Entity +public class Item { + + @Id + private Long id; + private String color; + private String grade; + private String name; + + public String getColor() { + return color; + } + + public String getGrade() { + return grade; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public void setColor(String color) { + this.color = color; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public void setId(Long id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/User.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/User.java similarity index 100% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/User.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/User.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java similarity index 100% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/defaultvalues/UserRepository.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/Product.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/Product.java similarity index 100% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/Product.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/Product.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/ProductRepository.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/ProductRepository.java similarity index 100% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/projections/ProductRepository.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/projections/ProductRepository.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java similarity index 100% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/QueryTypesExamples.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java b/persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java similarity index 100% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java rename to persistence-modules/java-jpa-2/src/main/java/com/baeldung/jpa/querytypes/UserEntity.java diff --git a/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml index 560a75070c..62d7ce0f5e 100644 --- a/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa-2/src/main/resources/META-INF/persistence.xml @@ -32,4 +32,91 @@ value="queryparams.sql" />
+ + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.defaultvalues.User + true + + + + + + + + + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.querytypes.UserEntity + true + + + + + + + + + + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.projections.Product + true + + + + + + + + + + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.criteria.Item + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/java-jpa/src/test/resources/item.sql b/persistence-modules/java-jpa-2/src/main/resources/item.sql similarity index 98% rename from persistence-modules/java-jpa/src/test/resources/item.sql rename to persistence-modules/java-jpa-2/src/main/resources/item.sql index faf50f6829..871dcee017 100644 --- a/persistence-modules/java-jpa/src/test/resources/item.sql +++ b/persistence-modules/java-jpa-2/src/main/resources/item.sql @@ -1,4 +1,4 @@ -insert into item(id,grade,color) values (10,'C','blue'); -insert into item(id,grade,color) values (11,'C','red'); -insert into item(id,grade,color) values (12,'A','blue'); +insert into item(id,grade,color) values (10,'C','blue'); +insert into item(id,grade,color) values (11,'C','red'); +insert into item(id,grade,color) values (12,'A','blue'); insert into item(id,grade,color) values (13,'D','red'); \ No newline at end of file diff --git a/persistence-modules/java-jpa/src/main/resources/products_jpa.sql b/persistence-modules/java-jpa-2/src/main/resources/products_jpa.sql similarity index 100% rename from persistence-modules/java-jpa/src/main/resources/products_jpa.sql rename to persistence-modules/java-jpa-2/src/main/resources/products_jpa.sql diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/criteria/CustomItemRepositoryIntegrationTest.java similarity index 86% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryIntegrationTest.java rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/criteria/CustomItemRepositoryIntegrationTest.java index 169fb44618..8d6bf3c4a7 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/criteria/repository/impl/CustomItemRepositoryIntegrationTest.java +++ b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/criteria/CustomItemRepositoryIntegrationTest.java @@ -1,44 +1,44 @@ -package com.baeldung.jpa.criteria.repository.impl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -import java.util.List; - -import org.junit.Test; - -import com.baeldung.jpa.criteria.entity.Item; -import com.baeldung.jpa.criteria.repository.CustomItemRepository; - -public class CustomItemRepositoryIntegrationTest { - - CustomItemRepository customItemRepository = new CustomItemRepositoryImpl(); - - @Test - public void givenItems_whenFindItemsByColorAndGrade_thenReturnItems() { - - List items = customItemRepository.findItemsByColorAndGrade(); - - assertFalse("No items found", items.isEmpty()); - assertEquals("There should be only one item", 1, items.size()); - - Item item = items.get(0); - - assertEquals("this item do not have blue color", "blue", item.getColor()); - assertEquals("this item does not belong to A grade", "A", item.getGrade()); - } - - @Test - public void givenItems_whenFindItemByColorOrGrade_thenReturnItems() { - - List items = customItemRepository.findItemByColorOrGrade(); - - assertFalse("No items found", items.isEmpty()); - assertEquals("There should be only one item", 1, items.size()); - - Item item = items.get(0); - - assertEquals("this item do not have red color", "red", item.getColor()); - assertEquals("this item does not belong to D grade", "D", item.getGrade()); - } -} +package com.baeldung.jpa.criteria; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.util.List; + +import org.junit.Test; + +import com.baeldung.jpa.criteria.Item; +import com.baeldung.jpa.criteria.CustomItemRepository; + +public class CustomItemRepositoryIntegrationTest { + + CustomItemRepository customItemRepository = new CustomItemRepositoryImpl(); + + @Test + public void givenItems_whenFindItemsByColorAndGrade_thenReturnItems() { + + List items = customItemRepository.findItemsByColorAndGrade(); + + assertFalse("No items found", items.isEmpty()); + assertEquals("There should be only one item", 1, items.size()); + + Item item = items.get(0); + + assertEquals("this item do not have blue color", "blue", item.getColor()); + assertEquals("this item does not belong to A grade", "A", item.getGrade()); + } + + @Test + public void givenItems_whenFindItemByColorOrGrade_thenReturnItems() { + + List items = customItemRepository.findItemByColorOrGrade(); + + assertFalse("No items found", items.isEmpty()); + assertEquals("There should be only one item", 1, items.size()); + + Item item = items.get(0); + + assertEquals("this item do not have red color", "red", item.getColor()); + assertEquals("this item does not belong to D grade", "D", item.getGrade()); + } +} diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java similarity index 100% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/defaultvalues/UserDefaultValuesUnitTest.java diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java similarity index 100% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/HibernateProjectionsIntegrationTest.java diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java similarity index 100% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/projections/ProductRepositoryIntegrationTest.java diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java b/persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java similarity index 100% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java rename to persistence-modules/java-jpa-2/src/test/java/com/baeldung/jpa/querytypes/QueryTypesExamplesIntegrationTest.java diff --git a/persistence-modules/java-jpa/src/test/resources/products.sql b/persistence-modules/java-jpa-2/src/test/resources/products.sql similarity index 100% rename from persistence-modules/java-jpa/src/test/resources/products.sql rename to persistence-modules/java-jpa-2/src/test/resources/products.sql diff --git a/persistence-modules/java-jpa/src/test/resources/users.sql b/persistence-modules/java-jpa-2/src/test/resources/users.sql similarity index 100% rename from persistence-modules/java-jpa/src/test/resources/users.sql rename to persistence-modules/java-jpa-2/src/test/resources/users.sql diff --git a/persistence-modules/java-jpa/README.md b/persistence-modules/java-jpa/README.md index 5a99217f45..670203f10d 100644 --- a/persistence-modules/java-jpa/README.md +++ b/persistence-modules/java-jpa/README.md @@ -1,16 +1,12 @@ # Relevant Articles -- [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) +- [A Guide to SqlResultSetMapping](https://www.baeldung.com/jpa-sql-resultset-mapping) +- [A Guide to Stored Procedures with JPA](https://www.baeldung.com/jpa-stored-procedures) - [Fixing the JPA error “java.lang.String cannot be cast to Ljava.lang.String;”](https://www.baeldung.com/jpa-error-java-lang-string-cannot-be-cast) - [JPA Entity Graph](https://www.baeldung.com/jpa-entity-graph) - [JPA 2.2 Support for Java 8 Date/Time Types](https://www.baeldung.com/jpa-java-time) - [Converting Between LocalDate and SQL Date](https://www.baeldung.com/java-convert-localdate-sql-date) -- [Combining JPA And/Or Criteria Predicates](https://www.baeldung.com/jpa-and-or-criteria-predicates) -- [Types of JPA Queries](https://www.baeldung.com/jpa-queries) -- [JPA/Hibernate Projections](https://www.baeldung.com/jpa-hibernate-projections) - [Composite Primary Keys in JPA](https://www.baeldung.com/jpa-composite-primary-keys) - [Defining JPA Entities](https://www.baeldung.com/jpa-entities) - [JPA @Basic Annotation](https://www.baeldung.com/jpa-basic-annotation) -- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values) - [Persisting Enums in JPA](https://www.baeldung.com/jpa-persisting-enums-in-jpa) diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/LocalDateConverter.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/convertdates/LocalDateConverter.java similarity index 94% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/util/LocalDateConverter.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/convertdates/LocalDateConverter.java index 00fd378b05..de6ada2361 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/LocalDateConverter.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/convertdates/LocalDateConverter.java @@ -1,4 +1,4 @@ -package com.baeldung.util; +package com.baeldung.jpa.convertdates; import javax.persistence.AttributeConverter; import javax.persistence.Converter; diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/Gender.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Gender.java similarity index 54% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/util/Gender.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Gender.java index 13f08d995c..8f808f539d 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/util/Gender.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Gender.java @@ -1,4 +1,4 @@ -package com.baeldung.util; +package com.baeldung.jpa.entity; public enum Gender { MALE, diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java index 531bae40c5..64e7ab586c 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Student.java @@ -14,8 +14,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; -import com.baeldung.util.Gender; - @Entity @Table(name="STUDENT") public class Student { diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Account.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Account.java similarity index 95% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Account.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Account.java index 48a98512fa..915c605e65 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Account.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Account.java @@ -1,4 +1,4 @@ -package com.baeldung.jpa.entity; +package com.baeldung.jpa.primarykeys; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/AccountId.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/AccountId.java similarity index 97% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/AccountId.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/AccountId.java index 091c326367..1e8a06be63 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/AccountId.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/AccountId.java @@ -1,4 +1,4 @@ -package com.baeldung.jpa.entity; +package com.baeldung.jpa.primarykeys; import java.io.Serializable; diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Book.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Book.java similarity index 93% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Book.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Book.java index 460f302e28..a84eb3ef01 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/Book.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/Book.java @@ -1,4 +1,4 @@ -package com.baeldung.jpa.entity; +package com.baeldung.jpa.primarykeys; import javax.persistence.EmbeddedId; import javax.persistence.Entity; diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/BookId.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/BookId.java similarity index 97% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/BookId.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/BookId.java index ff587beaf2..d8c925c148 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entity/BookId.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/primarykeys/BookId.java @@ -1,4 +1,4 @@ -package com.baeldung.jpa.entity; +package com.baeldung.jpa.primarykeys; import java.io.Serializable; diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/Employee.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/Employee.java similarity index 85% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/Employee.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/Employee.java index bec1b8845a..b62a21d481 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/Employee.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/Employee.java @@ -1,4 +1,4 @@ -package com.baeldung.sqlresultsetmapping; +package com.baeldung.jpa.sqlresultsetmapping; import javax.persistence.*; @@ -7,7 +7,7 @@ import javax.persistence.*; name="EmployeeResult", entities={ @EntityResult( - entityClass = com.baeldung.sqlresultsetmapping.Employee.class, + entityClass = com.baeldung.jpa.sqlresultsetmapping.Employee.class, fields={@FieldResult(name="id",column="employeeNumber"), @FieldResult(name="name", column="name")} ) diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/ScheduledDay.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/ScheduledDay.java similarity index 89% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/ScheduledDay.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/ScheduledDay.java index 7e332bc67a..a7ca59ab3f 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/sqlresultsetmapping/ScheduledDay.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/sqlresultsetmapping/ScheduledDay.java @@ -1,18 +1,18 @@ -package com.baeldung.sqlresultsetmapping; +package com.baeldung.jpa.sqlresultsetmapping; import javax.persistence.*; @SqlResultSetMappings(value = { @SqlResultSetMapping(name = "ScheduleResult", - classes = { @ConstructorResult(targetClass = com.baeldung.sqlresultsetmapping.ScheduledDay.class, + classes = { @ConstructorResult(targetClass = com.baeldung.jpa.sqlresultsetmapping.ScheduledDay.class, columns = { @ColumnResult(name = "id", type = Long.class), @ColumnResult(name = "employeeId", type = Long.class), @ColumnResult(name = "dayOfWeek") }) }), @SqlResultSetMapping(name = "FridayEmployeeResult", columns = { @ColumnResult(name = "employeeId") }), @SqlResultSetMapping(name = "EmployeeScheduleResults", - entities = { @EntityResult(entityClass = com.baeldung.sqlresultsetmapping.Employee.class), - @EntityResult(entityClass = com.baeldung.sqlresultsetmapping.ScheduledDay.class) + entities = { @EntityResult(entityClass = com.baeldung.jpa.sqlresultsetmapping.Employee.class), + @EntityResult(entityClass = com.baeldung.jpa.sqlresultsetmapping.ScheduledDay.class) }) }) @NamedNativeQuery(name = "FridayEmployees", query = "SELECT employeeId FROM schedule_days WHERE dayOfWeek = 'FRIDAY'", diff --git a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml index 1f16bee3ba..b780a6f569 100644 --- a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml @@ -7,8 +7,8 @@ org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.sqlresultsetmapping.ScheduledDay - com.baeldung.sqlresultsetmapping.Employee + com.baeldung.jpa.sqlresultsetmapping.ScheduledDay + com.baeldung.jpa.sqlresultsetmapping.Employee com.baeldung.jpa.basicannotation.Course true @@ -115,77 +115,13 @@ - - org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.criteria.entity.Item - true - - - - - - - - - - - - - - - org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.querytypes.UserEntity - true - - - - - - - - - - - - - - - org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.defaultvalues.User - true - - - - - - - - - - - - org.hibernate.jpa.HibernatePersistenceProvider com.baeldung.jpa.entity.Student - com.baeldung.jpa.entity.Book - com.baeldung.jpa.entity.BookId - com.baeldung.jpa.entity.Account - com.baeldung.jpa.entity.AccountId + com.baeldung.jpa.primarykeys.Book + com.baeldung.jpa.primarykeys.BookId + com.baeldung.jpa.primarykeys.Account + com.baeldung.jpa.primarykeys.AccountId true - - org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.projections.Product - true - - - - - - - - - - - - \ No newline at end of file diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java index fdaaba5439..3c7a82edc3 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/StudentEntityIntegrationTest.java @@ -16,8 +16,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import com.baeldung.util.Gender; - public class StudentEntityIntegrationTest { private EntityManagerFactory emf; diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/CompositeKeysIntegrationTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/primarykeys/CompositeKeysIntegrationTest.java similarity index 93% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/CompositeKeysIntegrationTest.java rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/primarykeys/CompositeKeysIntegrationTest.java index 2d30ebab5e..be529ab81c 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entity/CompositeKeysIntegrationTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/primarykeys/CompositeKeysIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jpa.entity; +package com.baeldung.jpa.primarykeys; import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -7,6 +7,10 @@ import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; +import com.baeldung.jpa.primarykeys.Account; +import com.baeldung.jpa.primarykeys.AccountId; +import com.baeldung.jpa.primarykeys.Book; +import com.baeldung.jpa.primarykeys.BookId; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/sqlresultsetmapping/SqlResultSetMappingUnitTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/sqlresultsetmapping/SqlResultSetMappingUnitTest.java similarity index 98% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/sqlresultsetmapping/SqlResultSetMappingUnitTest.java rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/sqlresultsetmapping/SqlResultSetMappingUnitTest.java index 4e01095278..f318df3747 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/sqlresultsetmapping/SqlResultSetMappingUnitTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/sqlresultsetmapping/SqlResultSetMappingUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.sqlresultsetmapping; +package com.baeldung.jpa.sqlresultsetmapping; import static org.junit.Assert.*; From 85a4c72414e7c0171b624ebd3f5a005e0643b1b4 Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Sat, 28 Sep 2019 23:43:11 +0530 Subject: [PATCH 086/107] [BAEL-16672] - Re-organize maven module (#7703) * [BAEL-16672] - Re-organize maven module * [BAEL-16672] - Added missed modules in main pom * [BAEL-16672] - Added commented compiler-plugin-java-9 module in main pom.xml --- maven-all/README.md | 3 + maven-all/compiler-plugin-java-9/README.md | 3 + .../compiler-plugin-java-9/pom.xml | 0 .../maven/java9/MavenCompilerPlugin.java | 0 .../src/main/java/module-info.java | 0 maven-all/maven-war-plugin/README.md | 3 + {maven => maven-all}/maven-war-plugin/pom.xml | 56 +++++++++--------- {maven => maven-all/maven}/.gitignore | 0 {maven => maven-all/maven}/README.md | 5 -- .../maven}/custom-rule/pom.xml | 0 .../com/baeldung/enforcer/MyCustomRule.java | 0 .../maven}/input-resources/baeldung.png | Bin .../maven}/input-resources/baeldung.txt | 0 .../maven}/input-resources/verifications.xml | 0 maven-all/maven/maven-enforcer/README.md | 3 + .../maven}/maven-enforcer/pom.xml | 0 {maven => maven-all/maven}/pom.xml | 1 + .../com/baeldung/maven/it/RestITCase.java | 0 .../com/baeldung/maven/plugins/Foo.java | 0 .../com/baeldung/maven/it/EndpointConfig.java | 0 .../com/baeldung/maven/it/RestEndpoint.java | 0 .../java/com/baeldung/maven/plugins/Data.java | 0 .../maven/plugins/MultipleSrcFolders.java | 0 .../maven}/src/main/resources/logback.xml | 0 .../maven}/src/main/webapp/WEB-INF/web.xml | 0 .../com/baeldung/maven/it/Integration.java | 0 .../java/com/baeldung/maven/it/RestIT.java | 0 .../maven/it/RestIntegrationTest.java | 0 .../com/baeldung/maven/it/RestJUnitTest.java | 0 .../com/baeldung/maven/plugins/DataCheck.java | 0 .../baeldung/maven/plugins/DataUnitTest.java | 0 .../src/test/java/testfail/TestFail.java | 0 maven-all/profiles/README.md | 3 + {maven => maven-all}/profiles/pom.xml | 0 maven-all/versions-maven-plugin/README.md | 3 + .../versions-maven-plugin/original/pom.xml | 0 .../versions-maven-plugin/pom.xml | 2 +- .../versions-maven-plugin/run-the-demo.sh | 0 pom.xml | 12 +++- 39 files changed, 58 insertions(+), 36 deletions(-) create mode 100644 maven-all/README.md create mode 100644 maven-all/compiler-plugin-java-9/README.md rename {maven => maven-all}/compiler-plugin-java-9/pom.xml (100%) rename {maven => maven-all}/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java (100%) rename {maven => maven-all}/compiler-plugin-java-9/src/main/java/module-info.java (100%) create mode 100644 maven-all/maven-war-plugin/README.md rename {maven => maven-all}/maven-war-plugin/pom.xml (89%) rename {maven => maven-all/maven}/.gitignore (100%) rename {maven => maven-all/maven}/README.md (70%) rename {maven => maven-all/maven}/custom-rule/pom.xml (100%) rename {maven => maven-all/maven}/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java (100%) rename {maven => maven-all/maven}/input-resources/baeldung.png (100%) rename {maven => maven-all/maven}/input-resources/baeldung.txt (100%) rename {maven => maven-all/maven}/input-resources/verifications.xml (100%) create mode 100644 maven-all/maven/maven-enforcer/README.md rename {maven => maven-all/maven}/maven-enforcer/pom.xml (100%) rename {maven => maven-all/maven}/pom.xml (99%) rename {maven => maven-all/maven}/src/integration-test/java/com/baeldung/maven/it/RestITCase.java (100%) rename {maven => maven-all/maven}/src/main/another-src/com/baeldung/maven/plugins/Foo.java (100%) rename {maven => maven-all/maven}/src/main/java/com/baeldung/maven/it/EndpointConfig.java (100%) rename {maven => maven-all/maven}/src/main/java/com/baeldung/maven/it/RestEndpoint.java (100%) rename {maven => maven-all/maven}/src/main/java/com/baeldung/maven/plugins/Data.java (100%) rename {maven => maven-all/maven}/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java (100%) rename {maven => maven-all/maven}/src/main/resources/logback.xml (100%) rename {maven => maven-all/maven}/src/main/webapp/WEB-INF/web.xml (100%) rename {maven => maven-all/maven}/src/test/java/com/baeldung/maven/it/Integration.java (100%) rename {maven => maven-all/maven}/src/test/java/com/baeldung/maven/it/RestIT.java (100%) rename {maven => maven-all/maven}/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java (100%) rename {maven => maven-all/maven}/src/test/java/com/baeldung/maven/it/RestJUnitTest.java (100%) rename {maven => maven-all/maven}/src/test/java/com/baeldung/maven/plugins/DataCheck.java (100%) rename {maven => maven-all/maven}/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java (100%) rename {maven => maven-all/maven}/src/test/java/testfail/TestFail.java (100%) create mode 100644 maven-all/profiles/README.md rename {maven => maven-all}/profiles/pom.xml (100%) create mode 100644 maven-all/versions-maven-plugin/README.md rename {maven => maven-all}/versions-maven-plugin/original/pom.xml (100%) rename {maven => maven-all}/versions-maven-plugin/pom.xml (98%) rename {maven => maven-all}/versions-maven-plugin/run-the-demo.sh (100%) mode change 100755 => 100644 diff --git a/maven-all/README.md b/maven-all/README.md new file mode 100644 index 0000000000..d014f323d2 --- /dev/null +++ b/maven-all/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Apache Maven Tutorial](https://www.baeldung.com/maven) \ No newline at end of file diff --git a/maven-all/compiler-plugin-java-9/README.md b/maven-all/compiler-plugin-java-9/README.md new file mode 100644 index 0000000000..d0b7b72acc --- /dev/null +++ b/maven-all/compiler-plugin-java-9/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Maven Compiler Plugin](http://www.baeldung.com/maven-compiler-plugin) \ No newline at end of file diff --git a/maven/compiler-plugin-java-9/pom.xml b/maven-all/compiler-plugin-java-9/pom.xml similarity index 100% rename from maven/compiler-plugin-java-9/pom.xml rename to maven-all/compiler-plugin-java-9/pom.xml diff --git a/maven/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java b/maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java similarity index 100% rename from maven/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java rename to maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java diff --git a/maven/compiler-plugin-java-9/src/main/java/module-info.java b/maven-all/compiler-plugin-java-9/src/main/java/module-info.java similarity index 100% rename from maven/compiler-plugin-java-9/src/main/java/module-info.java rename to maven-all/compiler-plugin-java-9/src/main/java/module-info.java diff --git a/maven-all/maven-war-plugin/README.md b/maven-all/maven-war-plugin/README.md new file mode 100644 index 0000000000..d559fea80b --- /dev/null +++ b/maven-all/maven-war-plugin/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true](https://www.baeldung.com/eclipse-error-web-xml-missing) \ No newline at end of file diff --git a/maven/maven-war-plugin/pom.xml b/maven-all/maven-war-plugin/pom.xml similarity index 89% rename from maven/maven-war-plugin/pom.xml rename to maven-all/maven-war-plugin/pom.xml index 517c08978f..25c2e1ba1b 100644 --- a/maven/maven-war-plugin/pom.xml +++ b/maven-all/maven-war-plugin/pom.xml @@ -1,29 +1,29 @@ - - 4.0.0 - com.baeldung - maven-war-plugin-property - 0.0.1-SNAPSHOT - war - maven-war-plugin-property - - - - - maven-war-plugin - - 3.1.0 - - - false - - - - - - - - false - + + 4.0.0 + com.baeldung + maven-war-plugin + 0.0.1-SNAPSHOT + war + maven-war-plugin + + + + + maven-war-plugin + + 3.1.0 + + + false + + + + + + + + false + \ No newline at end of file diff --git a/maven/.gitignore b/maven-all/maven/.gitignore similarity index 100% rename from maven/.gitignore rename to maven-all/maven/.gitignore diff --git a/maven/README.md b/maven-all/maven/README.md similarity index 70% rename from maven/README.md rename to maven-all/maven/README.md index 6d1a7081b7..abe7fc4a80 100644 --- a/maven/README.md +++ b/maven-all/maven/README.md @@ -11,9 +11,4 @@ - [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories) - [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test) - [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) -- [Apache Maven Tutorial](https://www.baeldung.com/maven) -- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) - [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module) -- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) -- [Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true](https://www.baeldung.com/eclipse-error-web-xml-missing) -- [Guide to Maven Profiles](https://www.baeldung.com/maven-profiles) diff --git a/maven/custom-rule/pom.xml b/maven-all/maven/custom-rule/pom.xml similarity index 100% rename from maven/custom-rule/pom.xml rename to maven-all/maven/custom-rule/pom.xml diff --git a/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java b/maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java similarity index 100% rename from maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java rename to maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java diff --git a/maven/input-resources/baeldung.png b/maven-all/maven/input-resources/baeldung.png similarity index 100% rename from maven/input-resources/baeldung.png rename to maven-all/maven/input-resources/baeldung.png diff --git a/maven/input-resources/baeldung.txt b/maven-all/maven/input-resources/baeldung.txt similarity index 100% rename from maven/input-resources/baeldung.txt rename to maven-all/maven/input-resources/baeldung.txt diff --git a/maven/input-resources/verifications.xml b/maven-all/maven/input-resources/verifications.xml similarity index 100% rename from maven/input-resources/verifications.xml rename to maven-all/maven/input-resources/verifications.xml diff --git a/maven-all/maven/maven-enforcer/README.md b/maven-all/maven/maven-enforcer/README.md new file mode 100644 index 0000000000..7515647a3d --- /dev/null +++ b/maven-all/maven/maven-enforcer/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) \ No newline at end of file diff --git a/maven/maven-enforcer/pom.xml b/maven-all/maven/maven-enforcer/pom.xml similarity index 100% rename from maven/maven-enforcer/pom.xml rename to maven-all/maven/maven-enforcer/pom.xml diff --git a/maven/pom.xml b/maven-all/maven/pom.xml similarity index 99% rename from maven/pom.xml rename to maven-all/maven/pom.xml index ef6e7b7d93..d34be04fcf 100644 --- a/maven/pom.xml +++ b/maven-all/maven/pom.xml @@ -11,6 +11,7 @@ parent-modules com.baeldung 1.0.0-SNAPSHOT + ../.. diff --git a/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java b/maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java similarity index 100% rename from maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java rename to maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java diff --git a/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java b/maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java similarity index 100% rename from maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java rename to maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java diff --git a/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java b/maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java similarity index 100% rename from maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java rename to maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java diff --git a/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java b/maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java similarity index 100% rename from maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java rename to maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java diff --git a/maven/src/main/java/com/baeldung/maven/plugins/Data.java b/maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java similarity index 100% rename from maven/src/main/java/com/baeldung/maven/plugins/Data.java rename to maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java diff --git a/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java b/maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java similarity index 100% rename from maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java rename to maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java diff --git a/maven/src/main/resources/logback.xml b/maven-all/maven/src/main/resources/logback.xml similarity index 100% rename from maven/src/main/resources/logback.xml rename to maven-all/maven/src/main/resources/logback.xml diff --git a/maven/src/main/webapp/WEB-INF/web.xml b/maven-all/maven/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from maven/src/main/webapp/WEB-INF/web.xml rename to maven-all/maven/src/main/webapp/WEB-INF/web.xml diff --git a/maven/src/test/java/com/baeldung/maven/it/Integration.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java similarity index 100% rename from maven/src/test/java/com/baeldung/maven/it/Integration.java rename to maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java diff --git a/maven/src/test/java/com/baeldung/maven/it/RestIT.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java similarity index 100% rename from maven/src/test/java/com/baeldung/maven/it/RestIT.java rename to maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java diff --git a/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java similarity index 100% rename from maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java rename to maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java diff --git a/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java similarity index 100% rename from maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java rename to maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java diff --git a/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java b/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java similarity index 100% rename from maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java rename to maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java diff --git a/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java similarity index 100% rename from maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java rename to maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java diff --git a/maven/src/test/java/testfail/TestFail.java b/maven-all/maven/src/test/java/testfail/TestFail.java similarity index 100% rename from maven/src/test/java/testfail/TestFail.java rename to maven-all/maven/src/test/java/testfail/TestFail.java diff --git a/maven-all/profiles/README.md b/maven-all/profiles/README.md new file mode 100644 index 0000000000..22d5d7f70c --- /dev/null +++ b/maven-all/profiles/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Guide to Maven Profiles](https://www.baeldung.com/maven-profiles) \ No newline at end of file diff --git a/maven/profiles/pom.xml b/maven-all/profiles/pom.xml similarity index 100% rename from maven/profiles/pom.xml rename to maven-all/profiles/pom.xml diff --git a/maven-all/versions-maven-plugin/README.md b/maven-all/versions-maven-plugin/README.md new file mode 100644 index 0000000000..8f5670f802 --- /dev/null +++ b/maven-all/versions-maven-plugin/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) \ No newline at end of file diff --git a/maven/versions-maven-plugin/original/pom.xml b/maven-all/versions-maven-plugin/original/pom.xml similarity index 100% rename from maven/versions-maven-plugin/original/pom.xml rename to maven-all/versions-maven-plugin/original/pom.xml diff --git a/maven/versions-maven-plugin/pom.xml b/maven-all/versions-maven-plugin/pom.xml similarity index 98% rename from maven/versions-maven-plugin/pom.xml rename to maven-all/versions-maven-plugin/pom.xml index e0714bf0e0..c9f63a46f1 100644 --- a/maven/versions-maven-plugin/pom.xml +++ b/maven-all/versions-maven-plugin/pom.xml @@ -36,7 +36,7 @@ commons-beanutils commons-beanutils - 1.9.1-SNAPSHOT + 1.9.1 diff --git a/maven/versions-maven-plugin/run-the-demo.sh b/maven-all/versions-maven-plugin/run-the-demo.sh old mode 100755 new mode 100644 similarity index 100% rename from maven/versions-maven-plugin/run-the-demo.sh rename to maven-all/versions-maven-plugin/run-the-demo.sh diff --git a/pom.xml b/pom.xml index 79e5194ee8..4f40f8261f 100644 --- a/pom.xml +++ b/pom.xml @@ -544,7 +544,11 @@ lucene mapstruct - maven + + maven-all/maven + maven-all/maven-war-plugin + maven-all/profiles + maven-all/versions-maven-plugin maven-archetype maven-polyglot/maven-polyglot-json-extension @@ -1279,7 +1283,11 @@ lucene mapstruct - maven + + maven-all/maven + maven-all/maven-war-plugin + maven-all/profiles + maven-all/versions-maven-plugin maven-archetype From 4e31b4191900ca96056571fbafa15198d3b7cf3e Mon Sep 17 00:00:00 2001 From: smokeyrobot Date: Sat, 28 Sep 2019 15:19:11 -0400 Subject: [PATCH 087/107] Bael 624 (#7805) * Commit for Eval Article pull request * Revert "Commit for Eval Article pull request" * BAEL-46 - Deleted duplicate class. * BAEL-46 - Fixed old script version * BAEL-46 - Updated per editor review * BAEL-46 - Updated JMX for corrected parameters * BAEL-46 - Corrected Name and Directory * Bael-3000 - initial commit * Bael-3000 - update per review * Bael-3000 - Updated per code review * Bael-3000 - Updated per code review * Update core-java-modules/core-java-jndi/pom.xml Co-Authored-By: KevinGilmore * Update core-java-modules/core-java-jndi/pom.xml Co-Authored-By: KevinGilmore * Bael-624 Wildfly Setup * Update pom.xml * Bael-624 Review updates --- wildfly/pom.xml | 80 +++++++++++++++++++ wildfly/src/main/java/hello/Application.java | 40 ++++++++++ .../src/main/java/hello/HelloController.java | 14 ++++ 3 files changed, 134 insertions(+) create mode 100644 wildfly/pom.xml create mode 100644 wildfly/src/main/java/hello/Application.java create mode 100644 wildfly/src/main/java/hello/HelloController.java diff --git a/wildfly/pom.xml b/wildfly/pom.xml new file mode 100644 index 0000000000..bd2c93a633 --- /dev/null +++ b/wildfly/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + org.springframework + gs-spring-boot-wildfly + 0.1.0 + + war + + + org.springframework.boot + spring-boot-starter-parent + 2.1.6.RELEASE + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + org.springframework.boot + spring-boot-starter-test + test + + + javax.servlet + javax.servlet-api + provided + + + + + + 1.8 + + + + + + maven-failsafe-plugin + + + + integration-test + verify + + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + jdk.unsupported + + + + + + + diff --git a/wildfly/src/main/java/hello/Application.java b/wildfly/src/main/java/hello/Application.java new file mode 100644 index 0000000000..07b259e3a9 --- /dev/null +++ b/wildfly/src/main/java/hello/Application.java @@ -0,0 +1,40 @@ +package hello; + +import java.util.Arrays; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class Application extends SpringBootServletInitializer { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(Application.class); + } + + @Bean + public CommandLineRunner commandLineRunner(ApplicationContext ctx) { + return args -> { + + System.out.println("Let's inspect the beans provided by Spring Boot:"); + + String[] beanNames = ctx.getBeanDefinitionNames(); + Arrays.sort(beanNames); + for (String beanName : beanNames) { + System.out.println(beanName); + } + + }; + } + +} diff --git a/wildfly/src/main/java/hello/HelloController.java b/wildfly/src/main/java/hello/HelloController.java new file mode 100644 index 0000000000..d9c1069cc5 --- /dev/null +++ b/wildfly/src/main/java/hello/HelloController.java @@ -0,0 +1,14 @@ +package hello; + +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.RequestMapping; + +@RestController +public class HelloController { + + @RequestMapping("/") + public String index() { + return "Greetings from Spring Boot!"; + } + +} From 2255577ffd842b5663876d233c0b891767f38855 Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Sat, 28 Sep 2019 22:23:52 +0300 Subject: [PATCH 088/107] [BAEL-16668] Split or move testing-modules/mockito module (#7835) * Split or move testing-modules/mockito module * [BAEL-16668] fix after merge with master --- testing-modules/hamcrest/README.md | 12 ++ testing-modules/hamcrest/pom.xml | 29 +++++ .../hamcrest/objectmatchers}/City.java | 2 +- .../hamcrest/objectmatchers/Location.java | 4 + .../hamcrest/HamcrestBeansUnitTest.java | 11 +- .../HamcrestCoreMatchersUnitTest.java | 5 +- .../hamcrest/HamcrestFileUnitTest.java | 21 +--- .../hamcrest/HamcrestNumberUnitTest.java | 12 +- .../hamcrest/HamcrestObjectUnitTest.java | 11 +- .../hamcrest/HamcrestTextUnitTest.java | 6 +- .../HamcrestCustomUnitTest.java | 8 +- .../custommatchers/IsDivisibleBy.java | 2 +- .../hamcrest/custommatchers/IsOnlyDigits.java | 2 +- .../hamcrest/custommatchers/IsUppercase.java | 2 +- .../src/test/resources/test1.in | 0 testing-modules/mockito-2/README.md | 6 +- .../bddmockito/BDDMockitoUnitTest.java | 8 +- .../bddmockito/PhoneBookRepository.java | 2 +- .../mockito}/bddmockito/PhoneBookService.java | 2 +- .../LazyVerificationUnitTest.java | 14 +-- .../mockito/spy}/MockitoMisusingUnitTest.java | 16 +-- .../mockito/spy/MockitoSpyUnitTest.java | 12 +- testing-modules/mockito/README.md | 30 ++--- testing-modules/mockito/pom.xml | 8 +- .../mockito/callbacks}/ActionHandler.java | 2 +- .../baeldung/mockito/callbacks}/Callback.java | 2 +- .../baeldung/mockito/callbacks}/Data.java | 2 +- .../baeldung/mockito/callbacks}/Response.java | 2 +- .../baeldung/mockito/callbacks}/Service.java | 2 +- .../java/org/baeldung/hamcrest/Location.java | 4 - .../baeldung/mockito/FinalList.java | 4 +- .../java/com/baeldung/mockito/MockFinals.java | 35 ++++++ .../baeldung/mockito/MockFinalsUnitTest.java | 4 +- .../MockitoAnnotationIntegrationTest.java | 114 +++++++++++++++++ .../mockito/MockitoAnnotationUnitTest.java | 2 +- .../MockitoConfigExamplesIntegrationTest.java | 95 ++++++++++++++ .../MockitoConfigExamplesUnitTest.java | 4 +- .../MockitoExceptionIntegrationTest.java | 55 ++++++++ .../mockito/MockitoExceptionUnitTest.java | 2 +- .../mockito/MockitoInjectIntoSpyUnitTest.java | 5 +- .../mockito/MockitoMockIntegrationTest.java | 69 +++++++++++ .../baeldung/mockito/MockitoMockUnitTest.java | 4 +- .../MockitoVerifyExamplesIntegrationTest.java | 117 ++++++++++++++++++ .../MockitoVerifyExamplesUnitTest.java | 4 +- .../baeldung/mockito/MyDictionary.java | 2 +- .../baeldung/mockito}/MyList.java | 2 +- .../callbacks}/ActionHandlerUnitTest.java | 16 +-- .../MockitoVoidMethodsUnitTest.java | 19 +-- testing-modules/pom.xml | 1 + 49 files changed, 634 insertions(+), 159 deletions(-) create mode 100644 testing-modules/hamcrest/README.md create mode 100644 testing-modules/hamcrest/pom.xml rename testing-modules/{mockito/src/main/java/org/baeldung/hamcrest => hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers}/City.java (94%) create mode 100644 testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/Location.java rename testing-modules/{mockito/src/test/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/HamcrestBeansUnitTest.java (86%) rename testing-modules/{mockito/src/test/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java (99%) rename testing-modules/{mockito/src/test/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/HamcrestFileUnitTest.java (72%) rename testing-modules/{mockito/src/test/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/HamcrestNumberUnitTest.java (90%) rename testing-modules/{mockito/src/test/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/HamcrestObjectUnitTest.java (81%) rename testing-modules/{mockito/src/test/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/HamcrestTextUnitTest.java (99%) rename testing-modules/{mockito/src/test/java/org/baeldung/hamcrest => hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers}/HamcrestCustomUnitTest.java (82%) rename testing-modules/{mockito/src/main/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/custommatchers/IsDivisibleBy.java (93%) rename testing-modules/{mockito/src/main/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/custommatchers/IsOnlyDigits.java (92%) rename testing-modules/{mockito/src/main/java/org => hamcrest/src/test/java/com}/baeldung/hamcrest/custommatchers/IsUppercase.java (91%) rename testing-modules/{mockito => hamcrest}/src/test/resources/test1.in (100%) rename testing-modules/{mockito/src/test/java/org/baeldung => mockito-2/src/test/java/com/baeldung/mockito}/bddmockito/BDDMockitoUnitTest.java (98%) rename testing-modules/{mockito/src/test/java/org/baeldung => mockito-2/src/test/java/com/baeldung/mockito}/bddmockito/PhoneBookRepository.java (93%) rename testing-modules/{mockito/src/test/java/org/baeldung => mockito-2/src/test/java/com/baeldung/mockito}/bddmockito/PhoneBookService.java (95%) rename testing-modules/mockito-2/src/test/java/com/baeldung/mockito/{java8 => lazyverification}/LazyVerificationUnitTest.java (95%) rename testing-modules/{mockito/src/test/java/org/baeldung/mockito/misusing => mockito-2/src/test/java/com/baeldung/mockito/spy}/MockitoMisusingUnitTest.java (96%) rename testing-modules/{mockito/src/test/java/org => mockito-2/src/test/java/com}/baeldung/mockito/spy/MockitoSpyUnitTest.java (98%) rename testing-modules/mockito/src/main/java/{org/baeldung/mockito/service => com/baeldung/mockito/callbacks}/ActionHandler.java (93%) rename testing-modules/mockito/src/main/java/{org/baeldung/mockito/service => com/baeldung/mockito/callbacks}/Callback.java (61%) rename testing-modules/mockito/src/main/java/{org/baeldung/mockito/service => com/baeldung/mockito/callbacks}/Data.java (82%) rename testing-modules/mockito/src/main/java/{org/baeldung/mockito/service => com/baeldung/mockito/callbacks}/Response.java (90%) rename testing-modules/mockito/src/main/java/{org/baeldung/mockito/service => com/baeldung/mockito/callbacks}/Service.java (70%) delete mode 100644 testing-modules/mockito/src/main/java/org/baeldung/hamcrest/Location.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/FinalList.java (56%) create mode 100644 testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinals.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockFinalsUnitTest.java (90%) create mode 100644 testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationIntegrationTest.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockitoAnnotationUnitTest.java (98%) create mode 100644 testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockitoConfigExamplesUnitTest.java (97%) create mode 100644 testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionIntegrationTest.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockitoExceptionUnitTest.java (98%) rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java (90%) create mode 100644 testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockitoMockUnitTest.java (96%) create mode 100644 testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MockitoVerifyExamplesUnitTest.java (97%) rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/MyDictionary.java (93%) rename testing-modules/mockito/src/test/java/{org/baeldung/mockito/voidmethods => com/baeldung/mockito}/MyList.java (90%) rename testing-modules/mockito/src/test/java/{org/baeldung/mockito/service => com/baeldung/mockito/callbacks}/ActionHandlerUnitTest.java (98%) rename testing-modules/mockito/src/test/java/{org => com}/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java (79%) diff --git a/testing-modules/hamcrest/README.md b/testing-modules/hamcrest/README.md new file mode 100644 index 0000000000..f2ff6b996d --- /dev/null +++ b/testing-modules/hamcrest/README.md @@ -0,0 +1,12 @@ +## Hamcrest + +This module contains articles about Hamcrest + +### Relevant articles +- [Hamcrest Text Matchers](https://www.baeldung.com/hamcrest-text-matchers) +- [Hamcrest File Matchers](https://www.baeldung.com/hamcrest-file-matchers) +- [Hamcrest Object Matchers](https://www.baeldung.com/hamcrest-object-matchers) +- [Hamcrest Bean Matchers](https://www.baeldung.com/hamcrest-bean-matchers) +- [Hamcrest Number Matchers](https://www.baeldung.com/hamcrest-number-matchers) +- [Hamcrest Common Core Matchers](https://www.baeldung.com/hamcrest-core-matchers) +- [Hamcrest Custom Matchers](https://www.baeldung.com/hamcrest-custom-matchers) diff --git a/testing-modules/hamcrest/pom.xml b/testing-modules/hamcrest/pom.xml new file mode 100644 index 0000000000..2136702b3a --- /dev/null +++ b/testing-modules/hamcrest/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + com.baeldung + hamcrest + 0.0.1-SNAPSHOT + hamcrest + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.hamcrest + java-hamcrest + ${hamcrest.version} + test + + + + + 2.0.0.0 + + diff --git a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/City.java b/testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/City.java similarity index 94% rename from testing-modules/mockito/src/main/java/org/baeldung/hamcrest/City.java rename to testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/City.java index d6369189c1..cc4fba8154 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/City.java +++ b/testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/City.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest.objectmatchers; public class City extends Location { String name; diff --git a/testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/Location.java b/testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/Location.java new file mode 100644 index 0000000000..bb9c369c60 --- /dev/null +++ b/testing-modules/hamcrest/src/main/java/com/baeldung/hamcrest/objectmatchers/Location.java @@ -0,0 +1,4 @@ +package com.baeldung.hamcrest.objectmatchers; + +public class Location { +} diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestBeansUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestBeansUnitTest.java similarity index 86% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestBeansUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestBeansUnitTest.java index e7eb9bda1b..7f0c5290ba 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestBeansUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestBeansUnitTest.java @@ -1,5 +1,6 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; +import com.baeldung.hamcrest.objectmatchers.City; import org.junit.Test; import java.beans.PropertyDescriptor; @@ -8,13 +9,7 @@ import java.util.List; import static java.util.stream.Collectors.toList; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.equalToIgnoringCase; -import static org.hamcrest.Matchers.samePropertyValuesAs; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.*; import static org.hamcrest.beans.PropertyUtil.getPropertyDescriptor; import static org.hamcrest.beans.PropertyUtil.propertyDescriptorsFor; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java similarity index 99% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java index d66ed98e8d..5da6a77144 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestCoreMatchersUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; import com.google.common.collect.Lists; @@ -145,7 +145,6 @@ public class HamcrestCoreMatchersUnitTest { @Test public void givenString_WhenContainsStringIgnoringCase_ThenCorrect() { - // GIVEN String testString = "hamcrest core"; @@ -164,7 +163,6 @@ public class HamcrestCoreMatchersUnitTest { assertThat(list, hasItem(isA(String.class))); } - @Test public void givenTestInput_WhenUsingHasItemsInCollection() { @@ -223,7 +221,6 @@ public class HamcrestCoreMatchersUnitTest { assertThat(testString, either(startsWith("Bael")).or(containsString("Core"))); } - @Test public void givenTestInput_WhenUsingEveryItemForMatchInCollection() { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestFileUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestFileUnitTest.java similarity index 72% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestFileUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestFileUnitTest.java index 9973e325d6..73e2da52b5 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestFileUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestFileUnitTest.java @@ -1,22 +1,13 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; -import static org.hamcrest.core.StringContains.containsString; -import static org.hamcrest.io.FileMatchers.aFileNamed; -import static org.hamcrest.io.FileMatchers.aFileWithAbsolutePath; -import static org.hamcrest.io.FileMatchers.aFileWithCanonicalPath; -import static org.hamcrest.io.FileMatchers.aFileWithSize; -import static org.hamcrest.io.FileMatchers.aReadableFile; -import static org.hamcrest.io.FileMatchers.aWritableFile; -import static org.hamcrest.io.FileMatchers.anExistingDirectory; -import static org.hamcrest.io.FileMatchers.anExistingFile; -import static org.hamcrest.io.FileMatchers.anExistingFileOrDirectory; -import static org.hamcrest.number.OrderingComparison.greaterThan; -import static org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase; -import static org.junit.Assert.assertThat; +import org.junit.Test; import java.io.File; -import org.junit.Test; +import static org.hamcrest.io.FileMatchers.*; +import static org.hamcrest.number.OrderingComparison.greaterThan; +import static org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase; +import static org.junit.Assert.assertThat; public class HamcrestFileUnitTest { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestNumberUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestNumberUnitTest.java similarity index 90% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestNumberUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestNumberUnitTest.java index fbba6b94d2..d2b3392537 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestNumberUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestNumberUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; import org.junit.Test; @@ -6,15 +6,7 @@ import java.math.BigDecimal; import java.time.LocalDate; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.closeTo; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.lessThan; -import static org.hamcrest.Matchers.lessThanOrEqualTo; -import static org.hamcrest.Matchers.comparesEqualTo; -import static org.hamcrest.Matchers.notANumber; +import static org.hamcrest.Matchers.*; public class HamcrestNumberUnitTest { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestObjectUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestObjectUnitTest.java similarity index 81% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestObjectUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestObjectUnitTest.java index 8d30ff297b..c07fc422f6 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestObjectUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestObjectUnitTest.java @@ -1,14 +1,11 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; +import com.baeldung.hamcrest.objectmatchers.City; +import com.baeldung.hamcrest.objectmatchers.Location; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasToString; -import static org.hamcrest.Matchers.equalToIgnoringCase; -import static org.hamcrest.Matchers.emptyOrNullString; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.typeCompatibleWith; -import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.*; public class HamcrestObjectUnitTest { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestTextUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestTextUnitTest.java similarity index 99% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestTextUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestTextUnitTest.java index e336b1bba3..593fdf82b6 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestTextUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/HamcrestTextUnitTest.java @@ -1,4 +1,6 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; + +import org.junit.Test; import static org.hamcrest.core.StringContains.containsString; import static org.hamcrest.core.StringContains.containsStringIgnoringCase; @@ -16,8 +18,6 @@ import static org.hamcrest.text.MatchesPattern.matchesPattern; import static org.hamcrest.text.StringContainsInOrder.stringContainsInOrder; import static org.junit.Assert.assertThat; -import org.junit.Test; - public class HamcrestTextUnitTest { @Test diff --git a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestCustomUnitTest.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/HamcrestCustomUnitTest.java similarity index 82% rename from testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestCustomUnitTest.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/HamcrestCustomUnitTest.java index 6cc8692bc7..62c68d4561 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/hamcrest/HamcrestCustomUnitTest.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/HamcrestCustomUnitTest.java @@ -1,10 +1,10 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest.custommatchers; import org.junit.Test; -import static org.baeldung.hamcrest.custommatchers.IsDivisibleBy.divisibleBy; -import static org.baeldung.hamcrest.custommatchers.IsOnlyDigits.onlyDigits; -import static org.baeldung.hamcrest.custommatchers.IsUppercase.uppercase; +import static com.baeldung.hamcrest.custommatchers.IsDivisibleBy.divisibleBy; +import static com.baeldung.hamcrest.custommatchers.IsOnlyDigits.onlyDigits; +import static com.baeldung.hamcrest.custommatchers.IsUppercase.uppercase; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; diff --git a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsDivisibleBy.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsDivisibleBy.java similarity index 93% rename from testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsDivisibleBy.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsDivisibleBy.java index ea12ce0006..f865523be4 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsDivisibleBy.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsDivisibleBy.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest.custommatchers; +package com.baeldung.hamcrest.custommatchers; import org.hamcrest.Description; import org.hamcrest.Matcher; diff --git a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsOnlyDigits.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsOnlyDigits.java similarity index 92% rename from testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsOnlyDigits.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsOnlyDigits.java index 7515dfbf6d..f113c92983 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsOnlyDigits.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsOnlyDigits.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest.custommatchers; +package com.baeldung.hamcrest.custommatchers; import org.hamcrest.Description; import org.hamcrest.Matcher; diff --git a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsUppercase.java b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsUppercase.java similarity index 91% rename from testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsUppercase.java rename to testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsUppercase.java index 859e7006b7..4ffacd939c 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/custommatchers/IsUppercase.java +++ b/testing-modules/hamcrest/src/test/java/com/baeldung/hamcrest/custommatchers/IsUppercase.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest.custommatchers; +package com.baeldung.hamcrest.custommatchers; import org.hamcrest.Description; import org.hamcrest.Matcher; diff --git a/testing-modules/mockito/src/test/resources/test1.in b/testing-modules/hamcrest/src/test/resources/test1.in similarity index 100% rename from testing-modules/mockito/src/test/resources/test1.in rename to testing-modules/hamcrest/src/test/resources/test1.in diff --git a/testing-modules/mockito-2/README.md b/testing-modules/mockito-2/README.md index 5c9e8fc81a..1d1bd6af7c 100644 --- a/testing-modules/mockito-2/README.md +++ b/testing-modules/mockito-2/README.md @@ -1,5 +1,7 @@ ### Relevant articles -- [Mockito’s Java 8 Features](http://www.baeldung.com/mockito-2-java-8) -- [Lazy Verification with Mockito 2](http://www.baeldung.com/mockito-2-lazy-verification) +- [Mockito’s Java 8 Features](https://www.baeldung.com/mockito-2-java-8) +- [Lazy Verification with Mockito 2](https://www.baeldung.com/mockito-2-lazy-verification) - [Mockito Strict Stubbing and The UnnecessaryStubbingException](https://www.baeldung.com/mockito-unnecessary-stubbing-exception) +- [Quick Guide to BDDMockito](https://www.baeldung.com/bdd-mockito) +- [Mockito – Using Spies](https://www.baeldung.com/mockito-spy) diff --git a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoUnitTest.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/BDDMockitoUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoUnitTest.java rename to testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/BDDMockitoUnitTest.java index 977a60933f..fd7f04870b 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/BDDMockitoUnitTest.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/BDDMockitoUnitTest.java @@ -1,7 +1,4 @@ -package org.baeldung.bddmockito; - -import static org.junit.Assert.fail; -import static org.mockito.BDDMockito.*; +package com.baeldung.mockito.bddmockito; import org.junit.Assert; import org.junit.Before; @@ -9,6 +6,9 @@ import org.junit.Test; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; +import static org.junit.Assert.fail; +import static org.mockito.BDDMockito.*; + public class BDDMockitoUnitTest { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/PhoneBookRepository.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/PhoneBookRepository.java similarity index 93% rename from testing-modules/mockito/src/test/java/org/baeldung/bddmockito/PhoneBookRepository.java rename to testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/PhoneBookRepository.java index 94d4a90d4b..dd44e5e3cc 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/PhoneBookRepository.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/PhoneBookRepository.java @@ -1,4 +1,4 @@ -package org.baeldung.bddmockito; +package com.baeldung.mockito.bddmockito; public interface PhoneBookRepository { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/PhoneBookService.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/PhoneBookService.java similarity index 95% rename from testing-modules/mockito/src/test/java/org/baeldung/bddmockito/PhoneBookService.java rename to testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/PhoneBookService.java index 8fc49b026d..b96cf4efb7 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/bddmockito/PhoneBookService.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/bddmockito/PhoneBookService.java @@ -1,4 +1,4 @@ -package org.baeldung.bddmockito; +package com.baeldung.mockito.bddmockito; public class PhoneBookService { diff --git a/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/LazyVerificationUnitTest.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/lazyverification/LazyVerificationUnitTest.java similarity index 95% rename from testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/LazyVerificationUnitTest.java rename to testing-modules/mockito-2/src/test/java/com/baeldung/mockito/lazyverification/LazyVerificationUnitTest.java index 0e6921c7a1..c7a9d84191 100644 --- a/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/java8/LazyVerificationUnitTest.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/lazyverification/LazyVerificationUnitTest.java @@ -1,16 +1,16 @@ -package com.baeldung.mockito.java8; - -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -import java.util.List; +package com.baeldung.mockito.lazyverification; import org.junit.Test; import org.mockito.exceptions.base.MockitoAssertionError; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.VerificationCollector; +import java.util.List; + +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + public class LazyVerificationUnitTest { @Test diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/misusing/MockitoMisusingUnitTest.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/spy/MockitoMisusingUnitTest.java similarity index 96% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/misusing/MockitoMisusingUnitTest.java rename to testing-modules/mockito-2/src/test/java/com/baeldung/mockito/spy/MockitoMisusingUnitTest.java index 306f53297a..ea12061fc6 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/misusing/MockitoMisusingUnitTest.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/spy/MockitoMisusingUnitTest.java @@ -1,11 +1,4 @@ -package org.baeldung.mockito.misusing; - -import static org.hamcrest.CoreMatchers.containsString; -import static org.junit.Assert.assertThat; -import static org.junit.jupiter.api.Assertions.fail; - -import java.util.ArrayList; -import java.util.List; +package com.baeldung.mockito.spy; import org.junit.After; import org.junit.Test; @@ -13,6 +6,13 @@ import org.mockito.Mockito; import org.mockito.exceptions.misusing.NotAMockException; import org.mockito.internal.progress.ThreadSafeMockingProgress; +import java.util.ArrayList; +import java.util.List; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.junit.Assert.assertThat; +import static org.junit.jupiter.api.Assertions.fail; + public class MockitoMisusingUnitTest { @After diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyUnitTest.java b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/spy/MockitoSpyUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyUnitTest.java rename to testing-modules/mockito-2/src/test/java/com/baeldung/mockito/spy/MockitoSpyUnitTest.java index 068a4c6de9..d4696e482b 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/spy/MockitoSpyUnitTest.java +++ b/testing-modules/mockito-2/src/test/java/com/baeldung/mockito/spy/MockitoSpyUnitTest.java @@ -1,9 +1,4 @@ -package org.baeldung.mockito.spy; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; +package com.baeldung.mockito.spy; import org.junit.Test; import org.junit.runner.RunWith; @@ -11,6 +6,11 @@ import org.mockito.Mockito; import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; + @RunWith(MockitoJUnitRunner.class) public class MockitoSpyUnitTest { diff --git a/testing-modules/mockito/README.md b/testing-modules/mockito/README.md index 9c6407f9da..6b8f53ffee 100644 --- a/testing-modules/mockito/README.md +++ b/testing-modules/mockito/README.md @@ -4,23 +4,13 @@ ### Relevant Articles: -- [Mockito Verify Cookbook](http://www.baeldung.com/mockito-verify) -- [Mockito When/Then Cookbook](http://www.baeldung.com/mockito-behavior) -- [Mockito – Using Spies](http://www.baeldung.com/mockito-spy) -- [Getting Started with Mockito @Mock, @Spy, @Captor and @InjectMocks](http://www.baeldung.com/mockito-annotations) -- [Mockito’s Mock Methods](http://www.baeldung.com/mockito-mock-methods) -- [Introduction to PowerMock](http://www.baeldung.com/intro-to-powermock) -- [Mocking Exception Throwing using Mockito](http://www.baeldung.com/mockito-exceptions) -- [Mocking Void Methods with Mockito](http://www.baeldung.com/mockito-void-methods) -- [Mocking of Private Methods Using PowerMock](http://www.baeldung.com/powermock-private-method) -- [Mock Final Classes and Methods with Mockito](http://www.baeldung.com/mockito-final) -- [Hamcrest Custom Matchers](http://www.baeldung.com/hamcrest-custom-matchers) -- [Hamcrest Common Core Matchers](http://www.baeldung.com/hamcrest-core-matchers) -- [Testing Callbacks with Mockito](http://www.baeldung.com/mockito-callbacks) -- [Using Hamcrest Number Matchers](https://www.baeldung.com/hamcrest-number-matchers) -- [Quick Guide to BDDMockito](http://www.baeldung.com/bdd-mockito) -- [Hamcrest Bean Matchers](http://www.baeldung.com/hamcrest-bean-matchers) -- [Hamcrest Object Matchers](http://www.baeldung.com/hamcrest-object-matchers) -- [Hamcrest File Matchers](https://www.baeldung.com/hamcrest-file-matchers) -- [Hamcrest Text Matchers](http://www.baeldung.com/hamcrest-text-matchers) -- [Testing Callbacks with Mockito](http://www.baeldung.com/mockito-callbacks) +- [Mockito Verify Cookbook](https://www.baeldung.com/mockito-verify) +- [Mockito When/Then Cookbook](https://www.baeldung.com/mockito-behavior) +- [Getting Started with Mockito @Mock, @Spy, @Captor and @InjectMocks](https://www.baeldung.com/mockito-annotations) +- [Mockito’s Mock Methods](https://www.baeldung.com/mockito-mock-methods) +- [Introduction to PowerMock](https://www.baeldung.com/intro-to-powermock) +- [Mocking of Private Methods Using PowerMock](https://www.baeldung.com/powermock-private-method) +- [Mocking Exception Throwing using Mockito](https://www.baeldung.com/mockito-exceptions) +- [Mocking Void Methods with Mockito](https://www.baeldung.com/mockito-void-methods) +- [Mock Final Classes and Methods with Mockito](https://www.baeldung.com/mockito-final) +- [Testing Callbacks with Mockito](https://www.baeldung.com/mockito-callbacks) diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml index f307b80370..e0f32d88bf 100644 --- a/testing-modules/mockito/pom.xml +++ b/testing-modules/mockito/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - org.baeldung + com.baeldung mockito 0.1-SNAPSHOT mockito @@ -58,12 +58,6 @@ ${powermock.version} test - - org.hamcrest - java-hamcrest - ${hamcrest.version} - - org.springframework.boot spring-boot-starter diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/ActionHandler.java b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/ActionHandler.java similarity index 93% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/service/ActionHandler.java rename to testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/ActionHandler.java index 289dcff399..d70fc2b690 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/ActionHandler.java +++ b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/ActionHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.service; +package com.baeldung.mockito.callbacks; public class ActionHandler { diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Callback.java b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Callback.java similarity index 61% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Callback.java rename to testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Callback.java index fb8d01ce2e..cc6180c249 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Callback.java +++ b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Callback.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.service; +package com.baeldung.mockito.callbacks; public interface Callback { diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Data.java b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Data.java similarity index 82% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Data.java rename to testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Data.java index 665c05382c..9549995469 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Data.java +++ b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Data.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.service; +package com.baeldung.mockito.callbacks; public class Data { diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Response.java b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Response.java similarity index 90% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Response.java rename to testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Response.java index 22474a5ba7..03aded3895 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Response.java +++ b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Response.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.service; +package com.baeldung.mockito.callbacks; public class Response { diff --git a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Service.java b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Service.java similarity index 70% rename from testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Service.java rename to testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Service.java index 63434e53fb..d9f1a44422 100644 --- a/testing-modules/mockito/src/main/java/org/baeldung/mockito/service/Service.java +++ b/testing-modules/mockito/src/main/java/com/baeldung/mockito/callbacks/Service.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.service; +package com.baeldung.mockito.callbacks; public interface Service { diff --git a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/Location.java b/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/Location.java deleted file mode 100644 index 52561d07dc..0000000000 --- a/testing-modules/mockito/src/main/java/org/baeldung/hamcrest/Location.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.baeldung.hamcrest; - -public class Location { -} diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/FinalList.java similarity index 56% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/FinalList.java index e01f189f0b..27b7534978 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/FinalList.java @@ -1,6 +1,4 @@ -package org.baeldung.mockito; - -import org.baeldung.mockito.voidmethods.MyList; +package com.baeldung.mockito; public final class FinalList extends MyList { diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinals.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinals.java new file mode 100644 index 0000000000..6ff791ae06 --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinals.java @@ -0,0 +1,35 @@ +package com.baeldung.mockito; + +import org.junit.Test; + +import static org.junit.Assert.assertNotEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class MockFinals { + + @Test + public void whenMockFinalClassMockWorks() { + + FinalList finalList = new FinalList(); + + FinalList mock = mock(FinalList.class); + when(mock.size()).thenReturn(2); + + assertNotEquals(mock.size(), finalList.size()); + + } + + @Test + public void whenMockFinalMethodMockWorks() { + + MyList myList = new MyList(); + + MyList mock = mock(MyList.class); + when(mock.finalMethod()).thenReturn(1); + + assertNotEquals(mock.finalMethod(), myList.finalMethod()); + } + + + } diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinalsUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinalsUnitTest.java similarity index 90% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinalsUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinalsUnitTest.java index 000774592c..bb03fca06f 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockFinalsUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockFinalsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import org.junit.Test; @@ -6,7 +6,7 @@ import static org.junit.Assert.assertNotEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import org.baeldung.mockito.voidmethods.MyList; +import com.baeldung.mockito.MyList; public class MockFinalsUnitTest { diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationIntegrationTest.java new file mode 100644 index 0000000000..94054d1cbb --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationIntegrationTest.java @@ -0,0 +1,114 @@ +package com.baeldung.mockito; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +//@RunWith(MockitoJUnitRunner.class) +public class MockitoAnnotationIntegrationTest { + + @Mock + private List mockedList; + + @Spy + private List spiedList = new ArrayList<>(); + + @Before + public void init() { + MockitoAnnotations.initMocks(this); + } + + // tests + + @Test + public void whenNotUseMockAnnotation_thenCorrect() { + final List mockList = Mockito.mock(List.class); + mockList.add("one"); + Mockito.verify(mockList).add("one"); + assertEquals(0, mockList.size()); + + Mockito.when(mockList.size()).thenReturn(100); + assertEquals(100, mockList.size()); + } + + @Test + public void whenUseMockAnnotation_thenMockIsInjected() { + mockedList.add("one"); + Mockito.verify(mockedList).add("one"); + assertEquals(0, mockedList.size()); + + Mockito.when(mockedList.size()).thenReturn(100); + assertEquals(100, mockedList.size()); + } + + @Test + public void whenNotUseSpyAnnotation_thenCorrect() { + final List spyList = Mockito.spy(new ArrayList()); + spyList.add("one"); + spyList.add("two"); + + Mockito.verify(spyList).add("one"); + Mockito.verify(spyList).add("two"); + + assertEquals(2, spyList.size()); + + Mockito.doReturn(100).when(spyList).size(); + assertEquals(100, spyList.size()); + } + + @Test + public void whenUseSpyAnnotation_thenSpyIsInjectedCorrectly() { + spiedList.add("one"); + spiedList.add("two"); + + Mockito.verify(spiedList).add("one"); + Mockito.verify(spiedList).add("two"); + + assertEquals(2, spiedList.size()); + + Mockito.doReturn(100).when(spiedList).size(); + assertEquals(100, spiedList.size()); + } + + @Test + public void whenNotUseCaptorAnnotation_thenCorrect() { + final List mockList = Mockito.mock(List.class); + final ArgumentCaptor arg = ArgumentCaptor.forClass(String.class); + mockList.add("one"); + Mockito.verify(mockList).add(arg.capture()); + + assertEquals("one", arg.getValue()); + } + + @Captor + private + ArgumentCaptor argCaptor; + + @Test + public void whenUseCaptorAnnotation_thenTheSam() { + mockedList.add("one"); + Mockito.verify(mockedList).add(argCaptor.capture()); + + assertEquals("one", argCaptor.getValue()); + } + + @Mock + private Map wordMap; + + @InjectMocks + private MyDictionary dic = new MyDictionary(); + + @Test + public void whenUseInjectMocksAnnotation_thenCorrect() { + Mockito.when(wordMap.get("aWord")).thenReturn("aMeaning"); + + assertEquals("aMeaning", dic.getMeaning("aWord")); + } + +} diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationUnitTest.java index 6bc0e69e65..731183bae2 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoAnnotationUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import org.junit.Before; import org.junit.Test; diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java new file mode 100644 index 0000000000..5d3c009edc --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesIntegrationTest.java @@ -0,0 +1,95 @@ +package com.baeldung.mockito; + +import org.junit.Test; +import org.mockito.Mockito; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.*; + +public class MockitoConfigExamplesIntegrationTest { + + // tests + + @Test + public final void whenMockReturnBehaviorIsConfigured_thenBehaviorIsVerified() { + final MyList listMock = Mockito.mock(MyList.class); + when(listMock.add(anyString())).thenReturn(false); + + final boolean added = listMock.add(randomAlphabetic(6)); + assertThat(added, is(false)); + } + + @Test + public final void whenMockReturnBehaviorIsConfigured2_thenBehaviorIsVerified() { + final MyList listMock = Mockito.mock(MyList.class); + doReturn(false).when(listMock).add(anyString()); + + final boolean added = listMock.add(randomAlphabetic(6)); + assertThat(added, is(false)); + } + + @Test(expected = IllegalStateException.class) + public final void givenMethodIsConfiguredToThrowException_whenCallingMethod_thenExceptionIsThrown() { + final MyList listMock = Mockito.mock(MyList.class); + when(listMock.add(anyString())).thenThrow(IllegalStateException.class); + + listMock.add(randomAlphabetic(6)); + } + + @Test(expected = NullPointerException.class) + public final void whenMethodHasNoReturnType_whenConfiguringBehaviorOfMethod_thenPossible() { + final MyList listMock = Mockito.mock(MyList.class); + doThrow(NullPointerException.class).when(listMock).clear(); + + listMock.clear(); + } + + @Test + public final void givenBehaviorIsConfiguredToThrowExceptionOnSecondCall_whenCallingOnlyOnce_thenNoExceptionIsThrown() { + final MyList listMock = Mockito.mock(MyList.class); + when(listMock.add(anyString())).thenReturn(false).thenThrow(IllegalStateException.class); + + listMock.add(randomAlphabetic(6)); + } + + @Test(expected = IllegalStateException.class) + public final void givenBehaviorIsConfiguredToThrowExceptionOnSecondCall_whenCallingTwice_thenExceptionIsThrown() { + final MyList listMock = Mockito.mock(MyList.class); + when(listMock.add(anyString())).thenReturn(false).thenThrow(IllegalStateException.class); + + listMock.add(randomAlphabetic(6)); + listMock.add(randomAlphabetic(6)); + } + + @Test + public final void whenMockMethodCallIsConfiguredToCallTheRealMethod_thenRealMethodIsCalled() { + final MyList listMock = Mockito.mock(MyList.class); + when(listMock.size()).thenCallRealMethod(); + + assertThat(listMock.size(), equalTo(1)); + } + + @Test + public final void whenMockMethodCallIsConfiguredWithCustomAnswer_thenRealMethodIsCalled() { + final MyList listMock = Mockito.mock(MyList.class); + doAnswer(invocation -> "Always the same").when(listMock).get(anyInt()); + + final String element = listMock.get(1); + assertThat(element, is(equalTo("Always the same"))); + } + + @Test(expected = NullPointerException.class) + public final void givenSpy_whenConfiguringBehaviorOfSpy_thenCorrectlyConfigured() { + final MyList instance = new MyList(); + final MyList spy = Mockito.spy(instance); + + doThrow(NullPointerException.class).when(spy).size(); + spy.size(); + } + +} diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java similarity index 97% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java index c065e164c5..389dc231c1 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoConfigExamplesUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoConfigExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import org.junit.Test; import org.mockito.Mockito; @@ -11,7 +11,7 @@ import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; -import org.baeldung.mockito.voidmethods.MyList; +import com.baeldung.mockito.MyList; public class MockitoConfigExamplesUnitTest { diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionIntegrationTest.java new file mode 100644 index 0000000000..23fcba60b8 --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionIntegrationTest.java @@ -0,0 +1,55 @@ +package com.baeldung.mockito; + +import org.junit.Test; +import org.mockito.Mockito; + +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.*; + +public class MockitoExceptionIntegrationTest { + + @Test(expected = NullPointerException.class) + public void whenConfigNonVoidRetunMethodToThrowEx_thenExIsThrown() { + MyDictionary dictMock = mock(MyDictionary.class); + when(dictMock.getMeaning(anyString())).thenThrow(NullPointerException.class); + + dictMock.getMeaning("word"); + } + + @Test(expected = IllegalStateException.class) + public void whenConfigVoidRetunMethodToThrowEx_thenExIsThrown() { + MyDictionary dictMock = mock(MyDictionary.class); + doThrow(IllegalStateException.class).when(dictMock) + .add(anyString(), anyString()); + + dictMock.add("word", "meaning"); + } + + @Test(expected = NullPointerException.class) + public void whenConfigNonVoidRetunMethodToThrowExWithNewExObj_thenExIsThrown() { + MyDictionary dictMock = mock(MyDictionary.class); + when(dictMock.getMeaning(anyString())).thenThrow(new NullPointerException("Error occurred")); + + dictMock.getMeaning("word"); + } + + @Test(expected = IllegalStateException.class) + public void whenConfigVoidRetunMethodToThrowExWithNewExObj_thenExIsThrown() { + MyDictionary dictMock = mock(MyDictionary.class); + doThrow(new IllegalStateException("Error occurred")).when(dictMock) + .add(anyString(), anyString()); + + dictMock.add("word", "meaning"); + } + + // ===== + + @Test(expected = NullPointerException.class) + public void givenSpy_whenConfigNonVoidRetunMethodToThrowEx_thenExIsThrown() { + MyDictionary dict = new MyDictionary(); + MyDictionary spy = Mockito.spy(dict); + + when(spy.getMeaning(anyString())).thenThrow(NullPointerException.class); + spy.getMeaning("word"); + } +} diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionUnitTest.java index 88da16ae2b..7ed4fbdf37 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoExceptionUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoExceptionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doThrow; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java similarity index 90% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java index 568492ca10..d6a11bbc7d 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoInjectIntoSpyUnitTest.java @@ -1,13 +1,12 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.mockito.*; import org.mockito.junit.MockitoJUnitRunner; -import java.util.ArrayList; -import java.util.List; import java.util.Map; import static org.junit.Assert.assertEquals; diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java new file mode 100644 index 0000000000..e8cbcc4e8c --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockIntegrationTest.java @@ -0,0 +1,69 @@ +package com.baeldung.mockito; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.mockito.MockSettings; +import org.mockito.exceptions.verification.TooLittleActualInvocations; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.*; + +public class MockitoMockIntegrationTest { + + private static class CustomAnswer implements Answer { + @Override + public Boolean answer(InvocationOnMock invocation) throws Throwable { + return false; + } + } + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void whenUsingSimpleMock_thenCorrect() { + MyList listMock = mock(MyList.class); + when(listMock.add(anyString())).thenReturn(false); + boolean added = listMock.add(randomAlphabetic(6)); + + verify(listMock).add(anyString()); + assertThat(added, is(false)); + } + + @Test + public void whenUsingMockWithName_thenCorrect() { + MyList listMock = mock(MyList.class, "myMock"); + when(listMock.add(anyString())).thenReturn(false); + listMock.add(randomAlphabetic(6)); + + thrown.expect(TooLittleActualInvocations.class); + thrown.expectMessage(containsString("myMock.add")); + + verify(listMock, times(2)).add(anyString()); + } + + @Test + public void whenUsingMockWithAnswer_thenCorrect() { + MyList listMock = mock(MyList.class, new CustomAnswer()); + boolean added = listMock.add(randomAlphabetic(6)); + + verify(listMock).add(anyString()); + assertThat(added, is(false)); + } + + @Test + public void whenUsingMockWithSettings_thenCorrect() { + MockSettings customSettings = withSettings().defaultAnswer(new CustomAnswer()); + MyList listMock = mock(MyList.class, customSettings); + boolean added = listMock.add(randomAlphabetic(6)); + + verify(listMock).add(anyString()); + assertThat(added, is(false)); + } +} \ No newline at end of file diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java similarity index 96% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java index 30c843ff13..e1d99f80a2 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoMockUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoMockUnitTest.java @@ -1,8 +1,8 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import static org.mockito.Mockito.*; -import org.baeldung.mockito.voidmethods.MyList; +import com.baeldung.mockito.MyList; import static org.junit.Assert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java new file mode 100644 index 0000000000..b5075d7db2 --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesIntegrationTest.java @@ -0,0 +1,117 @@ +package com.baeldung.mockito; + +import com.google.common.collect.Lists; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.InOrder; +import org.mockito.Mockito; +import org.mockito.exceptions.verification.NoInteractionsWanted; + +import java.util.List; + +import static org.hamcrest.Matchers.hasItem; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.*; + +public class MockitoVerifyExamplesIntegrationTest { + + // tests + + @Test + public final void givenInteractionWithMockOccurred_whenVerifyingInteraction_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.size(); + verify(mockedList).size(); + } + + @Test + public final void givenOneInteractionWithMockOccurred_whenVerifyingNumberOfInteractions_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.size(); + verify(mockedList, times(1)).size(); + } + + @Test + public final void givenNoInteractionWithMockOccurred_whenVerifyingInteractions_thenCorrect() { + final List mockedList = mock(MyList.class); + verifyZeroInteractions(mockedList); + } + + @Test + public final void givenNoInteractionWithMethodOfMockOccurred_whenVerifyingInteractions_thenCorrect() { + final List mockedList = mock(MyList.class); + verify(mockedList, times(0)).size(); + } + + @Test(expected = NoInteractionsWanted.class) + public final void givenUnverifiedInteraction_whenVerifyingNoUnexpectedInteractions_thenFail() { + final List mockedList = mock(MyList.class); + mockedList.size(); + mockedList.clear(); + + verify(mockedList).size(); + verifyNoMoreInteractions(mockedList); + } + + @Test + public final void whenVerifyingOrderOfInteractions_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.size(); + mockedList.add("a parameter"); + mockedList.clear(); + + final InOrder inOrder = Mockito.inOrder(mockedList); + inOrder.verify(mockedList).size(); + inOrder.verify(mockedList).add("a parameter"); + inOrder.verify(mockedList).clear(); + } + + @Test + public final void whenVerifyingAnInteractionHasNotOccurred_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.size(); + + verify(mockedList, never()).clear(); + } + + @Test + public final void whenVerifyingAnInteractionHasOccurredAtLeastOnce_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.clear(); + mockedList.clear(); + mockedList.clear(); + + verify(mockedList, atLeast(1)).clear(); + verify(mockedList, atMost(10)).clear(); + } + + // with arguments + + @Test + public final void whenVerifyingAnInteractionWithExactArgument_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.add("test"); + + verify(mockedList).add("test"); + } + + @Test + public final void whenVerifyingAnInteractionWithAnyArgument_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.add("test"); + + verify(mockedList).add(anyString()); + } + + @Test + public final void whenVerifyingAnInteractionWithArgumentCapture_thenCorrect() { + final List mockedList = mock(MyList.class); + mockedList.addAll(Lists.newArrayList("someElement")); + final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(List.class); + verify(mockedList).addAll(argumentCaptor.capture()); + final List capturedArgument = argumentCaptor.>getValue(); + assertThat(capturedArgument, hasItem("someElement")); + } + +} diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java similarity index 97% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java index a6e40b84e1..ca09f77d2d 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVerifyExamplesUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoVerifyExamplesUnitTest.java @@ -1,8 +1,8 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import com.google.common.collect.Lists; -import org.baeldung.mockito.voidmethods.MyList; +import com.baeldung.mockito.MyList; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.InOrder; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MyDictionary.java similarity index 93% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MyDictionary.java index 9492c90d11..92a4498696 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MyDictionary.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; import java.util.HashMap; import java.util.Map; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/voidmethods/MyList.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MyList.java similarity index 90% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/voidmethods/MyList.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/MyList.java index f28c9b732f..ac3a76e04a 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/voidmethods/MyList.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MyList.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.voidmethods; +package com.baeldung.mockito; import java.util.AbstractList; diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/service/ActionHandlerUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/callbacks/ActionHandlerUnitTest.java similarity index 98% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/service/ActionHandlerUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/callbacks/ActionHandlerUnitTest.java index c34a9a4a09..5ffe4ab28d 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/service/ActionHandlerUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/callbacks/ActionHandlerUnitTest.java @@ -1,11 +1,4 @@ -package org.baeldung.mockito.service; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.verify; +package com.baeldung.mockito.callbacks; import org.junit.Before; import org.junit.Test; @@ -15,6 +8,13 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.stubbing.Answer; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.verify; + public class ActionHandlerUnitTest { @Mock diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java similarity index 79% rename from testing-modules/mockito/src/test/java/org/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java rename to testing-modules/mockito/src/test/java/com/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java index 0393490f9a..dd41d98b57 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/voidmethods/MockitoVoidMethodsUnitTest.java @@ -1,23 +1,16 @@ -package org.baeldung.mockito.voidmethods; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.isA; -import static org.mockito.ArgumentMatchers.isNull; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doCallRealMethod; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; +package com.baeldung.mockito.voidmethods; +import com.baeldung.mockito.MyList; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + @RunWith(MockitoJUnitRunner.class) public class MockitoVoidMethodsUnitTest { diff --git a/testing-modules/pom.xml b/testing-modules/pom.xml index c0eb59f15e..6400a2d7e7 100644 --- a/testing-modules/pom.xml +++ b/testing-modules/pom.xml @@ -23,6 +23,7 @@ load-testing-comparison mockito mockito-2 + hamcrest mocks mockserver parallel-tests-junit From 39e99cd907e348165249388c9002a297e89c782f Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Sat, 28 Sep 2019 22:26:32 +0300 Subject: [PATCH 089/107] Split or move core-java-collections module (#7893) --- core-java-modules/core-java-arrays-2/README.MD | 1 + .../baeldung/array}/removefirst/RemoveFirstElementUnitTest.java | 2 +- core-java-modules/core-java-collections-list/README.md | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) rename core-java-modules/{core-java-collections-list/src/test/java/com/baeldung/list => core-java-arrays-2/src/test/java/com/baeldung/array}/removefirst/RemoveFirstElementUnitTest.java (97%) diff --git a/core-java-modules/core-java-arrays-2/README.MD b/core-java-modules/core-java-arrays-2/README.MD index 280fb33dc3..952770a2da 100644 --- a/core-java-modules/core-java-arrays-2/README.MD +++ b/core-java-modules/core-java-arrays-2/README.MD @@ -7,3 +7,4 @@ - [Array Operations in Java](https://www.baeldung.com/java-common-array-operations) - [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection) - [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element) +- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element) diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java index f2b1bd9d88..83a97973f3 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.list.removefirst; +package com.baeldung.array.removefirst; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; diff --git a/core-java-modules/core-java-collections-list/README.md b/core-java-modules/core-java-collections-list/README.md index 1542a352fe..367f62780d 100644 --- a/core-java-modules/core-java-collections-list/README.md +++ b/core-java-modules/core-java-collections-list/README.md @@ -12,4 +12,3 @@ - [How to Find an Element in a List with Java](http://www.baeldung.com/find-list-element-java) - [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max) - [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list) -- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element) From a50e35565b864c7bd172b79de9e1f22f0a80713f Mon Sep 17 00:00:00 2001 From: Maiklins Date: Sat, 28 Sep 2019 22:51:16 +0200 Subject: [PATCH 090/107] Update java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java Co-Authored-By: KevinGilmore --- .../src/test/java/com/baeldung/map/ProductUnitTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java index 28ac06e166..2015909870 100644 --- a/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java @@ -36,7 +36,7 @@ class ProductUnitTest { Product nextPurchase = productsByName.get("Car"); - assertEquals(null, nextPurchase); + assertNull(nextPurchase); } @Test @@ -121,4 +121,4 @@ class ProductUnitTest { assertNull(productsByName.get("E-Bike")); } -} \ No newline at end of file +} From b86270a6aa9eb8093f740d763653468df66cd68a Mon Sep 17 00:00:00 2001 From: Catalin Burcea Date: Sun, 29 Sep 2019 12:18:58 +0300 Subject: [PATCH 091/107] Ignoring unmapped properties with MapStruct (#7809) --- mapstruct/pom.xml | 7 +++ .../unmappedproperties/dto/CarDTO.java | 23 ++++++++ .../unmappedproperties/dto/DocumentDTO.java | 52 +++++++++++++++++++ .../unmappedproperties/entity/Car.java | 23 ++++++++ .../unmappedproperties/entity/Document.java | 42 +++++++++++++++ .../unmappedproperties/mapper/CarMapper.java | 13 +++++ .../mapper/DocumentMapper.java | 16 ++++++ .../mapper/DocumentMapperMappingIgnore.java | 20 +++++++ .../mapper/DocumentMapperUnmappedPolicy.java | 17 ++++++ .../mapper/DocumentMapperWithConfig.java | 16 ++++++ .../mapper/IgnoreUnmappedMapperConfig.java | 8 +++ .../unmappedproperties/CarMapperUnitTest.java | 23 ++++++++ .../DocumentMapperMappingIgnoreUnitTest.java | 45 ++++++++++++++++ .../DocumentMapperUnitTest.java | 45 ++++++++++++++++ .../DocumentMapperUnmappedPolicyUnitTest.java | 45 ++++++++++++++++ .../DocumentMapperWithConfigUnitTest.java | 45 ++++++++++++++++ 16 files changed, 440 insertions(+) create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java create mode 100644 mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java create mode 100644 mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java create mode 100644 mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java create mode 100644 mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java create mode 100644 mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java create mode 100644 mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java diff --git a/mapstruct/pom.xml b/mapstruct/pom.xml index 2613dcf083..e98c4a318b 100644 --- a/mapstruct/pom.xml +++ b/mapstruct/pom.xml @@ -35,6 +35,12 @@ lombok ${org.projectlombok.version} + + org.assertj + assertj-core + ${assertj.version} + test + @@ -70,6 +76,7 @@ 1.8 1.8 1.18.4 + 3.11.1 diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java new file mode 100644 index 0000000000..8f324f5a15 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/CarDTO.java @@ -0,0 +1,23 @@ +package com.baeldung.unmappedproperties.dto; + +public class CarDTO { + private int id; + private String name; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java new file mode 100644 index 0000000000..8df306eb13 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/dto/DocumentDTO.java @@ -0,0 +1,52 @@ +package com.baeldung.unmappedproperties.dto; + +import java.util.List; + +public class DocumentDTO { + private int id; + private String title; + private String text; + private List comments; + private String author; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public List getComments() { + return comments; + } + + public void setComments(List comments) { + this.comments = comments; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java new file mode 100644 index 0000000000..c23ced3a6a --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Car.java @@ -0,0 +1,23 @@ +package com.baeldung.unmappedproperties.entity; + +public class Car { + private int id; + private String name; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java new file mode 100644 index 0000000000..89457133a3 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/entity/Document.java @@ -0,0 +1,42 @@ +package com.baeldung.unmappedproperties.entity; + +import java.util.Date; + +public class Document { + private int id; + private String title; + private String text; + private Date modificationTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getModificationTime() { + return modificationTime; + } + + public void setModificationTime(Date modificationTime) { + this.modificationTime = modificationTime; + } +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java new file mode 100644 index 0000000000..714301b811 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/CarMapper.java @@ -0,0 +1,13 @@ +package com.baeldung.unmappedproperties.mapper; + +import com.baeldung.unmappedproperties.dto.CarDTO; +import com.baeldung.unmappedproperties.entity.Car; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface CarMapper { + CarMapper INSTANCE = Mappers.getMapper(CarMapper.class); + + CarDTO carToCarDTO(Car car); +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java new file mode 100644 index 0000000000..fe233ed172 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapper.java @@ -0,0 +1,16 @@ +package com.baeldung.unmappedproperties.mapper; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface DocumentMapper { + + DocumentMapper INSTANCE = Mappers.getMapper(DocumentMapper.class); + + DocumentDTO documentToDocumentDTO(Document entity); + + Document documentDTOToDocument(DocumentDTO dto); +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java new file mode 100644 index 0000000000..bf3b0b49c4 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperMappingIgnore.java @@ -0,0 +1,20 @@ +package com.baeldung.unmappedproperties.mapper; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface DocumentMapperMappingIgnore { + + DocumentMapperMappingIgnore INSTANCE = Mappers.getMapper(DocumentMapperMappingIgnore.class); + + @Mapping(target = "comments", ignore = true) + DocumentDTO documentToDocumentDTO(Document entity); + + @Mapping(target = "modificationTime", ignore = true) + Document documentDTOToDocument(DocumentDTO dto); + +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java new file mode 100644 index 0000000000..b44f714774 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperUnmappedPolicy.java @@ -0,0 +1,17 @@ +package com.baeldung.unmappedproperties.mapper; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; +import org.mapstruct.factory.Mappers; + +@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DocumentMapperUnmappedPolicy { + + DocumentMapperUnmappedPolicy INSTANCE = Mappers.getMapper(DocumentMapperUnmappedPolicy.class); + + DocumentDTO documentToDocumentDTO(Document entity); + + Document documentDTOToDocument(DocumentDTO dto); +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java new file mode 100644 index 0000000000..dfaab7e1a1 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/DocumentMapperWithConfig.java @@ -0,0 +1,16 @@ +package com.baeldung.unmappedproperties.mapper; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +@Mapper(config = IgnoreUnmappedMapperConfig.class) +public interface DocumentMapperWithConfig { + + DocumentMapperWithConfig INSTANCE = Mappers.getMapper(DocumentMapperWithConfig.class); + + DocumentDTO documentToDocumentDTO(Document entity); + + Document documentDTOToDocument(DocumentDTO dto); +} \ No newline at end of file diff --git a/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java new file mode 100644 index 0000000000..804ce9c03a --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/unmappedproperties/mapper/IgnoreUnmappedMapperConfig.java @@ -0,0 +1,8 @@ +package com.baeldung.unmappedproperties.mapper; + +import org.mapstruct.MapperConfig; +import org.mapstruct.ReportingPolicy; + +@MapperConfig(unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface IgnoreUnmappedMapperConfig { +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java new file mode 100644 index 0000000000..4ce04015f1 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/CarMapperUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.mapper.unmappedproperties; + +import com.baeldung.unmappedproperties.dto.CarDTO; +import com.baeldung.unmappedproperties.entity.Car; +import com.baeldung.unmappedproperties.mapper.CarMapper; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CarMapperUnitTest { + + @Test + public void givenCarEntitytoCar_whenMaps_thenCorrect() { + Car entity = new Car(); + entity.setId(1); + entity.setName("Toyota"); + + CarDTO carDto = CarMapper.INSTANCE.carToCarDTO(entity); + + assertThat(carDto.getId()).isEqualTo(entity.getId()); + assertThat(carDto.getName()).isEqualTo(entity.getName()); + } +} diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java new file mode 100644 index 0000000000..493c7f8686 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperMappingIgnoreUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.mapper.unmappedproperties; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import com.baeldung.unmappedproperties.mapper.DocumentMapperMappingIgnore; +import org.junit.Test; + +import java.util.Arrays; +import java.util.Date; + +import static org.assertj.core.api.Assertions.assertThat; + +public class DocumentMapperMappingIgnoreUnitTest { + + @Test + public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() { + Document entity = new Document(); + entity.setId(1); + entity.setTitle("Price 13-42"); + entity.setText("List of positions......."); + entity.setModificationTime(new Date()); + + DocumentDTO dto = DocumentMapperMappingIgnore.INSTANCE.documentToDocumentDTO(entity); + + assertThat(dto.getId()).isEqualTo(entity.getId()); + assertThat(dto.getTitle()).isEqualTo(entity.getTitle()); + assertThat(dto.getText()).isEqualTo(entity.getText()); + } + + @Test + public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() { + DocumentDTO dto = new DocumentDTO(); + dto.setId(1); + dto.setTitle("Price 13-42"); + dto.setText("List of positions......."); + dto.setComments(Arrays.asList("Not all positions", "Wrong price values")); + dto.setAuthor("Author1"); + + Document entity = DocumentMapperMappingIgnore.INSTANCE.documentDTOToDocument(dto); + + assertThat(entity.getId()).isEqualTo(dto.getId()); + assertThat(entity.getTitle()).isEqualTo(dto.getTitle()); + assertThat(entity.getText()).isEqualTo(dto.getText()); + } +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java new file mode 100644 index 0000000000..1d3645ca96 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.mapper.unmappedproperties; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import com.baeldung.unmappedproperties.mapper.DocumentMapper; +import org.junit.Test; + +import java.util.Arrays; +import java.util.Date; + +import static org.assertj.core.api.Assertions.assertThat; + +public class DocumentMapperUnitTest { + + @Test + public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() { + Document entity = new Document(); + entity.setId(1); + entity.setTitle("Price 13-42"); + entity.setText("List of positions......."); + entity.setModificationTime(new Date()); + + DocumentDTO dto = DocumentMapper.INSTANCE.documentToDocumentDTO(entity); + + assertThat(dto.getId()).isEqualTo(entity.getId()); + assertThat(dto.getTitle()).isEqualTo(entity.getTitle()); + assertThat(dto.getText()).isEqualTo(entity.getText()); + } + + @Test + public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() { + DocumentDTO dto = new DocumentDTO(); + dto.setId(1); + dto.setTitle("Price 13-42"); + dto.setText("List of positions......."); + dto.setComments(Arrays.asList("Not all positions", "Wrong price values")); + dto.setAuthor("Author1"); + + Document entity = DocumentMapper.INSTANCE.documentDTOToDocument(dto); + + assertThat(entity.getId()).isEqualTo(dto.getId()); + assertThat(entity.getTitle()).isEqualTo(dto.getTitle()); + assertThat(entity.getText()).isEqualTo(dto.getText()); + } +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java new file mode 100644 index 0000000000..f6666a52ec --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperUnmappedPolicyUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.mapper.unmappedproperties; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import com.baeldung.unmappedproperties.mapper.DocumentMapperUnmappedPolicy; +import org.junit.Test; + +import java.util.Arrays; +import java.util.Date; + +import static org.assertj.core.api.Assertions.assertThat; + +public class DocumentMapperUnmappedPolicyUnitTest { + + @Test + public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() { + Document entity = new Document(); + entity.setId(1); + entity.setTitle("Price 13-42"); + entity.setText("List of positions......."); + entity.setModificationTime(new Date()); + + DocumentDTO dto = DocumentMapperUnmappedPolicy.INSTANCE.documentToDocumentDTO(entity); + + assertThat(dto.getId()).isEqualTo(entity.getId()); + assertThat(dto.getTitle()).isEqualTo(entity.getTitle()); + assertThat(dto.getText()).isEqualTo(entity.getText()); + } + + @Test + public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() { + DocumentDTO dto = new DocumentDTO(); + dto.setId(1); + dto.setTitle("Price 13-42"); + dto.setText("List of positions......."); + dto.setComments(Arrays.asList("Not all positions", "Wrong price values")); + dto.setAuthor("Author1"); + + Document entity = DocumentMapperUnmappedPolicy.INSTANCE.documentDTOToDocument(dto); + + assertThat(entity.getId()).isEqualTo(dto.getId()); + assertThat(entity.getTitle()).isEqualTo(dto.getTitle()); + assertThat(entity.getText()).isEqualTo(dto.getText()); + } +} \ No newline at end of file diff --git a/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java new file mode 100644 index 0000000000..c9409225f5 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapper/unmappedproperties/DocumentMapperWithConfigUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.mapper.unmappedproperties; + +import com.baeldung.unmappedproperties.dto.DocumentDTO; +import com.baeldung.unmappedproperties.entity.Document; +import com.baeldung.unmappedproperties.mapper.DocumentMapperWithConfig; +import org.junit.Test; + +import java.util.Arrays; +import java.util.Date; + +import static org.assertj.core.api.Assertions.assertThat; + +public class DocumentMapperWithConfigUnitTest { + + @Test + public void givenDocumentEntityToDocumentDto_whenMaps_thenCorrect() { + Document entity = new Document(); + entity.setId(1); + entity.setTitle("Price 13-42"); + entity.setText("List of positions......."); + entity.setModificationTime(new Date()); + + DocumentDTO dto = DocumentMapperWithConfig.INSTANCE.documentToDocumentDTO(entity); + + assertThat(dto.getId()).isEqualTo(entity.getId()); + assertThat(dto.getTitle()).isEqualTo(entity.getTitle()); + assertThat(dto.getText()).isEqualTo(entity.getText()); + } + + @Test + public void givenDocumentDtoToDocumentEntity_whenMaps_thenCorrect() { + DocumentDTO dto = new DocumentDTO(); + dto.setId(1); + dto.setTitle("Price 13-42"); + dto.setText("List of positions......."); + dto.setComments(Arrays.asList("Not all positions", "Wrong price values")); + dto.setAuthor("Author1"); + + Document entity = DocumentMapperWithConfig.INSTANCE.documentDTOToDocument(dto); + + assertThat(entity.getId()).isEqualTo(dto.getId()); + assertThat(entity.getTitle()).isEqualTo(dto.getTitle()); + assertThat(entity.getText()).isEqualTo(dto.getText()); + } +} \ No newline at end of file From 56cae916aa5dcc5167b3687be0270d109233bd57 Mon Sep 17 00:00:00 2001 From: Devender Kumar <47500074+kumar-devender@users.noreply.github.com> Date: Sun, 29 Sep 2019 17:38:58 +0200 Subject: [PATCH 092/107] remove sys and added test cases (#7894) * BAEL-3286 added component scan filter example * Remove unused class * Corrected formatting * formatted code * Update code * added test cases * Fix tests name --- spring-boot-di/pom.xml | 5 +++ .../filter/annotation/Animal.java | 3 +- .../ComponentScanAnnotationFilterApp.java | 8 ----- .../filter/annotation/Elephant.java | 3 +- .../componentscan/filter/aspectj/Cat.java | 3 +- .../ComponentScanAspectJFilterApp.java | 15 +++++++++ .../aspectj/ComponentScanCustomFilterApp.java | 24 -------------- .../filter/aspectj/Elephant.java | 3 +- .../componentscan/filter/aspectj/Loin.java | 3 +- .../filter/assignable/Animal.java | 3 +- .../componentscan/filter/assignable/Cat.java | 3 +- .../ComponentScanAssignableTypeFilterApp.java | 8 ----- .../filter/assignable/Elephant.java | 3 +- .../componentscan/filter/custom/Cat.java | 3 +- .../custom/ComponentScanCustomFilter.java | 6 ++-- .../custom/ComponentScanCustomFilterApp.java | 8 ----- .../componentscan/filter/custom/Loin.java | 3 +- .../componentscan/filter/custom/Pet.java | 3 +- .../componentscan/filter/regex/Cat.java | 3 +- .../regex/ComponentScanRegexFilterApp.java | 7 ----- .../componentscan/filter/regex/Elephant.java | 3 +- .../componentscan/filter/regex/Loin.java | 3 +- .../springapp/SpringComponentScanApp.java | 8 ++--- .../SpringBootComponentScanApp.java | 6 ++-- ...canAnnotationFilterAppIntegrationTest.java | 30 ++++++++++++++++++ ...ntScanAspectJFilterAppIntegrationTest.java | 30 ++++++++++++++++++ ...ssignableTypeFilterAppIntegrationTest.java | 31 +++++++++++++++++++ ...entScanCustomFilterAppIntegrationTest.java | 30 ++++++++++++++++++ ...nentScanRegexFilterAppIntegrationTest.java | 31 +++++++++++++++++++ 29 files changed, 210 insertions(+), 79 deletions(-) create mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterApp.java delete mode 100644 spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java create mode 100644 spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java create mode 100644 spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java create mode 100644 spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java create mode 100644 spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java create mode 100644 spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java diff --git a/spring-boot-di/pom.xml b/spring-boot-di/pom.xml index c0faf44335..31ccff03da 100644 --- a/spring-boot-di/pom.xml +++ b/spring-boot-di/pom.xml @@ -36,6 +36,11 @@ tomcat-embed-jasper provided + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java index 73bd0e3673..7ec076abc7 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java @@ -7,4 +7,5 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -public @interface Animal { } +public @interface Animal { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java index 7e89870d4b..7849e4e10a 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java @@ -1,21 +1,13 @@ package com.baeldung.componentscan.filter.annotation; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; -import java.util.Arrays; - @Configuration @ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Animal.class)) public class ComponentScanAnnotationFilterApp { - private static ApplicationContext applicationContext; public static void main(String[] args) { - applicationContext = new AnnotationConfigApplicationContext(ComponentScanAnnotationFilterApp.class); - Arrays.stream(applicationContext.getBeanDefinitionNames()) - .forEach(System.out::println); } } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java index 8ad8111d6b..758775a737 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java @@ -1,4 +1,5 @@ package com.baeldung.componentscan.filter.annotation; @Animal -public class Elephant { } +public class Elephant { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java index b34a2d7112..ababe4fea9 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Cat.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.aspectj; -public class Cat { } +public class Cat { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterApp.java new file mode 100644 index 0000000000..aea7c0a2cd --- /dev/null +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterApp.java @@ -0,0 +1,15 @@ +package com.baeldung.componentscan.filter.aspectj; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +@Configuration +@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASPECTJ, +pattern = "com.baeldung.componentscan.filter.aspectj.* " + + "&& !(com.baeldung.componentscan.filter.aspectj.L* " + + "|| com.baeldung.componentscan.filter.aspectj.C*)")) +public class ComponentScanAspectJFilterApp { + public static void main(String[] args) { + } +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java deleted file mode 100644 index 3674c09531..0000000000 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/ComponentScanCustomFilterApp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.componentscan.filter.aspectj; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.FilterType; - -import java.util.Arrays; - -@Configuration -@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASPECTJ, - pattern = "com.baeldung.componentscan.filter.aspectj.* " - + "&& !(com.baeldung.componentscan.filter.aspectj.L* " - + "|| com.baeldung.componentscan.filter.aspectj.E*)")) -public class ComponentScanCustomFilterApp { - private static ApplicationContext applicationContext; - - public static void main(String[] args) { - applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class); - Arrays.stream(applicationContext.getBeanDefinitionNames()) - .forEach(System.out::println); - } -} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java index 30abc9dcd4..ade1b5903c 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Elephant.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.aspectj; -public class Elephant { } +public class Elephant { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java index cf442e981e..6bfdfeb321 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/aspectj/Loin.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.aspectj; -public class Loin { } +public class Loin { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java index 77cf2e72f0..faf4121834 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Animal.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.assignable; -public interface Animal { } +public interface Animal { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java index 262ae154f8..568ac8045f 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Cat.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.assignable; -public class Cat implements Animal { } +public class Cat implements Animal { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java index a5fa2b0942..b0155a882b 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterApp.java @@ -1,21 +1,13 @@ package com.baeldung.componentscan.filter.assignable; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; -import java.util.Arrays; - @Configuration @ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = Animal.class)) public class ComponentScanAssignableTypeFilterApp { - private static ApplicationContext applicationContext; public static void main(String[] args) { - applicationContext = new AnnotationConfigApplicationContext(ComponentScanAssignableTypeFilterApp.class); - Arrays.stream(applicationContext.getBeanDefinitionNames()) - .forEach(System.out::println); } } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java index 815e0d762a..74637c86ba 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/assignable/Elephant.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.assignable; -public class Elephant implements Animal { } +public class Elephant implements Animal { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java index 282d6bb641..17a8e87b7a 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Cat.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.custom; -public class Cat extends Pet { } +public class Cat extends Pet { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java index ebaccf7838..30ccb19276 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilter.java @@ -10,11 +10,11 @@ import java.io.IOException; public class ComponentScanCustomFilter implements TypeFilter { @Override - public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) - throws IOException { + public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException { ClassMetadata classMetadata = metadataReader.getClassMetadata(); String superClass = classMetadata.getSuperClassName(); - if (Pet.class.getName().equalsIgnoreCase(superClass)) { + if (Pet.class.getName() + .equalsIgnoreCase(superClass)) { return true; } return false; diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java index 1a4f5dbf4e..3a87b6a807 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterApp.java @@ -1,21 +1,13 @@ package com.baeldung.componentscan.filter.custom; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; -import java.util.Arrays; - @Configuration @ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.CUSTOM, classes = ComponentScanCustomFilter.class)) public class ComponentScanCustomFilterApp { - private static ApplicationContext applicationContext; public static void main(String[] args) { - applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class); - Arrays.stream(applicationContext.getBeanDefinitionNames()) - .forEach(System.out::println); } } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java index 0e2f9e0692..5deb4af9f3 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Loin.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.custom; -public class Loin { } +public class Loin { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java index 9b4497221d..c9be5a39c2 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/custom/Pet.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.custom; -public class Pet { } +public class Pet { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java index 87341cae9d..4569f91787 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Cat.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.regex; -public class Cat { } +public class Cat { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java index 36e94446b2..d2b7bd03fb 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterApp.java @@ -1,20 +1,13 @@ package com.baeldung.componentscan.filter.regex; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; -import java.util.Arrays; - @Configuration @ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*[t]")) public class ComponentScanRegexFilterApp { - private static ApplicationContext applicationContext; public static void main(String[] args) { - applicationContext = new AnnotationConfigApplicationContext(ComponentScanRegexFilterApp.class); - Arrays.stream(applicationContext.getBeanDefinitionNames()).forEach(System.out::println); } } diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java index 314dca5b77..4910be41ad 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Elephant.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.regex; -public class Elephant { } +public class Elephant { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java index 1b75fc1b43..5b7949be38 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/regex/Loin.java @@ -1,3 +1,4 @@ package com.baeldung.componentscan.filter.regex; -public class Loin { } +public class Loin { +} diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java index 83b91f7860..8873f1214c 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java @@ -10,10 +10,10 @@ import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan -//@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = Rose.class)) -//@ComponentScan(basePackages = "com.baeldung.componentscan.springapp") -//@ComponentScan(basePackages = "com.baeldung.componentscan.springapp.animals") -//@ComponentScan (excludeFilters = @ComponentScan.Filter(type=FilterType.REGEX,pattern="com\\.baeldung\\.componentscan\\.springapp\\.flowers\\..*")) +// @ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = Rose.class)) +// @ComponentScan(basePackages = "com.baeldung.componentscan.springapp") +// @ComponentScan(basePackages = "com.baeldung.componentscan.springapp.animals") +// @ComponentScan (excludeFilters = @ComponentScan.Filter(type=FilterType.REGEX,pattern="com\\.baeldung\\.componentscan\\.springapp\\.flowers\\..*")) public class SpringComponentScanApp { private static ApplicationContext applicationContext; diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java b/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java index 4362caefbb..c48f8c5e54 100644 --- a/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java +++ b/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java @@ -8,9 +8,9 @@ import org.springframework.context.annotation.Bean; import com.baeldung.componentscan.ExampleBean; @SpringBootApplication -//@ComponentScan(basePackages = "com.baeldung.componentscan.springbootapp.animals") -//@ComponentScan ( excludeFilters = @ComponentScan.Filter(type=FilterType.REGEX,pattern="com\\.baeldung\\.componentscan\\.springbootapp\\.flowers\\..*")) -//@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = Rose.class)) +// @ComponentScan(basePackages = "com.baeldung.componentscan.springbootapp.animals") +// @ComponentScan ( excludeFilters = @ComponentScan.Filter(type=FilterType.REGEX,pattern="com\\.baeldung\\.componentscan\\.springbootapp\\.flowers\\..*")) +// @ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = Rose.class)) public class SpringBootComponentScanApp { private static ApplicationContext applicationContext; diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java new file mode 100644 index 0000000000..ed984a3beb --- /dev/null +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java @@ -0,0 +1,30 @@ +package com.baeldung.componentscan.filter.annotation; + +import static org.junit.Assert.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.test.context.junit4.SpringRunner; +import static org.hamcrest.CoreMatchers.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ComponentScanAnnotationFilterApp.class) +public class ComponentScanAnnotationFilterAppIntegrationTest { + + @Test + public void testBean() { + ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAnnotationFilterApp.class); + List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) + .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAnnotationFilterApp")) + .collect(Collectors.toList()); + assertThat(beans.size(), equalTo(1)); + assertThat(beans.get(0), equalTo("elephant")); + } +} diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java new file mode 100644 index 0000000000..fa8d12723f --- /dev/null +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java @@ -0,0 +1,30 @@ +package com.baeldung.componentscan.filter.aspectj; + +import static org.junit.Assert.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.test.context.junit4.SpringRunner; +import static org.hamcrest.CoreMatchers.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ComponentScanAspectJFilterApp.class) +public class ComponentScanAspectJFilterAppIntegrationTest { + + @Test + public void testBean() { + ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAspectJFilterApp.class); + List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) + .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp")) + .collect(Collectors.toList()); + assertThat(beans.size(), equalTo(1)); + assertThat(beans.get(0), equalTo("elephant")); + } +} diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java new file mode 100644 index 0000000000..460be8e8ba --- /dev/null +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java @@ -0,0 +1,31 @@ +package com.baeldung.componentscan.filter.assignable; + +import static org.junit.Assert.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.test.context.junit4.SpringRunner; +import static org.hamcrest.CoreMatchers.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ComponentScanAssignableTypeFilterApp.class) +public class ComponentScanAssignableTypeFilterAppIntegrationTest { + + @Test + public void testBean() { + ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAssignableTypeFilterApp.class); + List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) + .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAssignableTypeFilterApp")) + .collect(Collectors.toList()); + assertThat(beans.size(), equalTo(2)); + assertThat(beans.contains("cat"), equalTo(true)); + assertThat(beans.contains("elephant"), equalTo(true)); + } +} diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java new file mode 100644 index 0000000000..f47c0123fa --- /dev/null +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java @@ -0,0 +1,30 @@ +package com.baeldung.componentscan.filter.custom; + +import static org.junit.Assert.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.test.context.junit4.SpringRunner; +import static org.hamcrest.CoreMatchers.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ComponentScanCustomFilterApp.class) +public class ComponentScanCustomFilterAppIntegrationTest { + + @Test + public void testBean() { + ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class); + List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) + .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp")) + .collect(Collectors.toList()); + assertThat(beans.size(), equalTo(1)); + assertThat(beans.get(0), equalTo("cat")); + } +} diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java new file mode 100644 index 0000000000..4fccbd776e --- /dev/null +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java @@ -0,0 +1,31 @@ +package com.baeldung.componentscan.filter.regex; + +import static org.junit.Assert.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.test.context.junit4.SpringRunner; +import static org.hamcrest.CoreMatchers.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ComponentScanRegexFilterApp.class) +public class ComponentScanRegexFilterAppIntegrationTest { + + @Test + public void testBean() { + ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanRegexFilterApp.class); + List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) + .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanRegexFilterApp")) + .collect(Collectors.toList()); + assertThat(beans.size(), equalTo(2)); + assertThat(beans.contains("cat"), equalTo(true)); + assertThat(beans.contains("elephant"), equalTo(true)); + } +} From b2908200f137c3dc7a47bc41cc497a2aa6aa8b0b Mon Sep 17 00:00:00 2001 From: Justin Albano Date: Sun, 29 Sep 2019 23:28:45 -0400 Subject: [PATCH 093/107] BAEL-3225: Added Spring example for error handling best practices. (#7854) --- .../baeldung/repository/BookRepository.java | 25 +++++++ .../web/controller/ApiExceptionHandler.java | 22 ++++++ .../web/controller/BookController.java | 25 +++++++ .../main/java/com/baeldung/web/dto/Book.java | 32 ++++++++ .../baeldung/web/error/ApiErrorResponse.java | 29 ++++++++ .../web/error/BookNotFoundException.java | 19 +++++ .../repository/BookRepositoryUnitTest.java | 60 +++++++++++++++ .../BookControllerIntegrationTest.java | 74 +++++++++++++++++++ 8 files changed, 286 insertions(+) create mode 100644 spring-rest-simple/src/main/java/com/baeldung/repository/BookRepository.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/web/controller/ApiExceptionHandler.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/web/controller/BookController.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/web/dto/Book.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/web/error/ApiErrorResponse.java create mode 100644 spring-rest-simple/src/main/java/com/baeldung/web/error/BookNotFoundException.java create mode 100644 spring-rest-simple/src/test/java/com/baeldung/repository/BookRepositoryUnitTest.java create mode 100644 spring-rest-simple/src/test/java/com/baeldung/web/controller/BookControllerIntegrationTest.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/repository/BookRepository.java b/spring-rest-simple/src/main/java/com/baeldung/repository/BookRepository.java new file mode 100644 index 0000000000..239d74b19c --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/repository/BookRepository.java @@ -0,0 +1,25 @@ +package com.baeldung.repository; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.springframework.stereotype.Repository; + +import com.baeldung.web.dto.Book; + +@Repository +public class BookRepository { + + private List books = new ArrayList<>(); + + public Optional findById(long id) { + return books.stream() + .filter(book -> book.getId() == id) + .findFirst(); + } + + public void add(Book book) { + books.add(book); + } +} diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/controller/ApiExceptionHandler.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/ApiExceptionHandler.java new file mode 100644 index 0000000000..e7f0ac3510 --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/ApiExceptionHandler.java @@ -0,0 +1,22 @@ +package com.baeldung.web.controller; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import com.baeldung.web.error.ApiErrorResponse; +import com.baeldung.web.error.BookNotFoundException; + +@RestControllerAdvice +public class ApiExceptionHandler { + + @ExceptionHandler(BookNotFoundException.class) + public ResponseEntity handleApiException( + BookNotFoundException ex) { + ApiErrorResponse response = + new ApiErrorResponse("error-0001", + "No book found with ID " + ex.getId()); + return new ResponseEntity<>(response, HttpStatus.NOT_FOUND); + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/controller/BookController.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/BookController.java new file mode 100644 index 0000000000..126b40517d --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/BookController.java @@ -0,0 +1,25 @@ +package com.baeldung.web.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.repository.BookRepository; +import com.baeldung.web.dto.Book; +import com.baeldung.web.error.BookNotFoundException; + +@RestController +@RequestMapping("/api/book") +public class BookController { + + @Autowired + private BookRepository repository; + + @GetMapping("/{id}") + public Book findById(@PathVariable long id) { + return repository.findById(id) + .orElseThrow(() -> new BookNotFoundException(id)); + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/dto/Book.java b/spring-rest-simple/src/main/java/com/baeldung/web/dto/Book.java new file mode 100644 index 0000000000..9ccd640319 --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/web/dto/Book.java @@ -0,0 +1,32 @@ +package com.baeldung.web.dto; + +public class Book { + + private long id; + private String title; + private String author; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/error/ApiErrorResponse.java b/spring-rest-simple/src/main/java/com/baeldung/web/error/ApiErrorResponse.java new file mode 100644 index 0000000000..a67a7a3f2f --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/web/error/ApiErrorResponse.java @@ -0,0 +1,29 @@ +package com.baeldung.web.error; + +public class ApiErrorResponse { + + private String error; + private String message; + + public ApiErrorResponse(String error, String message) { + super(); + this.error = error; + this.message = message; + } + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/error/BookNotFoundException.java b/spring-rest-simple/src/main/java/com/baeldung/web/error/BookNotFoundException.java new file mode 100644 index 0000000000..ad93ef7f20 --- /dev/null +++ b/spring-rest-simple/src/main/java/com/baeldung/web/error/BookNotFoundException.java @@ -0,0 +1,19 @@ +package com.baeldung.web.error; + +@SuppressWarnings("serial") +public class BookNotFoundException extends RuntimeException { + + private long id; + + public BookNotFoundException(long id) { + this.id = id; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/test/java/com/baeldung/repository/BookRepositoryUnitTest.java b/spring-rest-simple/src/test/java/com/baeldung/repository/BookRepositoryUnitTest.java new file mode 100644 index 0000000000..dd64f302fe --- /dev/null +++ b/spring-rest-simple/src/test/java/com/baeldung/repository/BookRepositoryUnitTest.java @@ -0,0 +1,60 @@ +package com.baeldung.repository; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.Optional; + +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.web.dto.Book; + +public class BookRepositoryUnitTest { + + private BookRepository repository; + + @Before + public void setUp() { + repository = new BookRepository(); + } + + @Test + public void givenNoBooks_WhenFindById_ThenReturnEmptyOptional() { + assertFalse(repository.findById(1).isPresent()); + } + + @Test + public void givenOneMatchingBook_WhenFindById_ThenReturnEmptyOptional() { + + long id = 1; + Book expected = bookWithId(id); + + repository.add(expected); + + Optional found = repository.findById(id); + + assertTrue(found.isPresent()); + assertEquals(expected, found.get()); + } + + private static Book bookWithId(long id) { + Book book = new Book(); + book.setId(id); + return book; + } + + @Test + public void givenOneNonMatchingBook_WhenFindById_ThenReturnEmptyOptional() { + + long id = 1; + Book expected = bookWithId(id); + + repository.add(expected); + + Optional found = repository.findById(id + 1); + + assertFalse(found.isPresent()); + } +} \ No newline at end of file diff --git a/spring-rest-simple/src/test/java/com/baeldung/web/controller/BookControllerIntegrationTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/controller/BookControllerIntegrationTest.java new file mode 100644 index 0000000000..3bf5ce3c3d --- /dev/null +++ b/spring-rest-simple/src/test/java/com/baeldung/web/controller/BookControllerIntegrationTest.java @@ -0,0 +1,74 @@ +package com.baeldung.web.controller; + +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import java.util.Optional; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; + +import com.baeldung.Application; +import com.baeldung.repository.BookRepository; +import com.baeldung.web.dto.Book; +import com.baeldung.web.error.ApiErrorResponse; +import com.fasterxml.jackson.databind.ObjectMapper; + +@RunWith(SpringRunner.class) +@WebMvcTest(BookController.class) +@ComponentScan(basePackageClasses = Application.class) +public class BookControllerIntegrationTest { + + private static final ObjectMapper MAPPER = new ObjectMapper(); + + @Autowired + private MockMvc mvc; + + @MockBean + private BookRepository repository; + + @Test + public void givenNoExistingBooks_WhenGetBookWithId1_ThenErrorReturned() throws Exception { + + long id = 1; + + doReturn(Optional.empty()).when(repository).findById(eq(id)); + + mvc.perform(get("/api/book/{id}", id)) + .andExpect(status().isNotFound()) + .andExpect(content().json(MAPPER.writeValueAsString(new ApiErrorResponse("error-0001", "No book found with ID " + id)))); + } + + @Test + public void givenMatchingBookExists_WhenGetBookWithId1_ThenBookReturned() throws Exception { + + long id = 1; + Book book = book(id, "foo", "bar"); + + doReturn(Optional.of(book)).when(repository).findById(eq(id)); + + mvc.perform(get("/api/book/{id}", id)) + .andExpect(status().isOk()) + .andExpect(content().json(MAPPER.writeValueAsString(book))); + } + + private static Book book(long id, String title, String author) { + + Book book = new Book(); + + book.setId(id); + book.setTitle(title); + book.setAuthor(author); + + return book; + } +} \ No newline at end of file From ff75b7ace2d4476ea7e4ba3d98e733286060617e Mon Sep 17 00:00:00 2001 From: dhruba619 Date: Mon, 30 Sep 2019 09:24:04 +0200 Subject: [PATCH 094/107] BAEL-2974 Logger vs System.out --- .../log4j2/Log4j2ComparisonSysout.java | 18 ++++++++++++++++++ .../logging/log4j2/Log4j2Example.java | 19 +++++++++++++++++++ .../log4j2/src/test/resources/log4j2.xml | 3 +-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java create mode 100644 logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java diff --git a/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java new file mode 100644 index 0000000000..53592082b6 --- /dev/null +++ b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2ComparisonSysout.java @@ -0,0 +1,18 @@ +package com.baeldung.logging.log4j2; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.PrintStream; + +public class Log4j2ComparisonSysout { + + public static void main(String[] args) throws FileNotFoundException { + PrintStream outStream = new PrintStream(new File("outFile.txt")); + System.setOut(outStream); + System.out.println("This is a baeldung article"); + + PrintStream errStream = new PrintStream(new File("errFile.txt")); + System.setErr(errStream); + System.err.println("This is a baeldung article error"); + } +} diff --git a/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java new file mode 100644 index 0000000000..b870924cf3 --- /dev/null +++ b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/Log4j2Example.java @@ -0,0 +1,19 @@ +package com.baeldung.logging.log4j2; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +public class Log4j2Example { + + private static final Logger logger = LogManager.getLogger(Log4j2Example.class); + + public static void main(String[] args) { + logger.debug("Debug log message"); + logger.info("Info log message"); + logger.error("Error log message"); + logger.warn("Warn log message"); + logger.fatal("Fatal log message"); + logger.trace("Trace log message"); + } + +} diff --git a/logging-modules/log4j2/src/test/resources/log4j2.xml b/logging-modules/log4j2/src/test/resources/log4j2.xml index 246ffb0707..ee26bcecf2 100644 --- a/logging-modules/log4j2/src/test/resources/log4j2.xml +++ b/logging-modules/log4j2/src/test/resources/log4j2.xml @@ -5,8 +5,7 @@ - + From d3cbbf0725b01f2a126e83873dfcb58487e43b9f Mon Sep 17 00:00:00 2001 From: Amy DeGregorio Date: Mon, 30 Sep 2019 10:17:53 -0400 Subject: [PATCH 095/107] BAEL-3329 (#7915) * BAEL-3222 Example Code and update to spring-boot-admin examples * BAEL-3329 Fix integration tests * BAEL-3329 Fix integration tests * Upgrade to Spring Boot 2.1.8.RELEASE --- spring-boot-admin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-admin/pom.xml b/spring-boot-admin/pom.xml index b2ced767eb..1c933723e7 100644 --- a/spring-boot-admin/pom.xml +++ b/spring-boot-admin/pom.xml @@ -30,7 +30,7 @@ - 2.1.7.RELEASE + 2.1.8.RELEASE \ No newline at end of file From d4d31dcc4b588cb8881f4c29cfdc84f1a8505447 Mon Sep 17 00:00:00 2001 From: Justin Albano Date: Mon, 30 Sep 2019 18:00:44 -0400 Subject: [PATCH 096/107] BAEL-3225: Corrected failing integration tests. --- .../java/com/baeldung/web/controller/mediatypes/TestConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java b/spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java index 4bbfa2818e..bc644af428 100644 --- a/spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java @@ -5,7 +5,7 @@ import org.springframework.context.annotation.Configuration; @Configuration -@ComponentScan({ "com.baeldung.web" }) +@ComponentScan({ "com.baeldung.web", "com.baeldung.repository" }) public class TestConfig { } From fad7aa6a66e40ec48213bc9a13fa8a01da155103 Mon Sep 17 00:00:00 2001 From: Maciej Andrearczyk Date: Tue, 1 Oct 2019 19:05:07 +0200 Subject: [PATCH 097/107] BAEL-3285 - code reformatted --- .../simultaneous}/Client.java | 15 ++++++--------- .../simultaneous}/Item.java | 2 +- .../simultaneous}/User.java | 2 +- .../simultaneous}/UserWithItem.java | 2 +- .../simultaneous}/ClientIntegrationTest.java | 11 ++++------- 5 files changed, 13 insertions(+), 19 deletions(-) rename spring-5-reactive-client/src/main/java/com/baeldung/reactive/{simultaneouswebclient => webclient/simultaneous}/Client.java (87%) rename spring-5-reactive-client/src/main/java/com/baeldung/reactive/{simultaneouswebclient => webclient/simultaneous}/Item.java (84%) rename spring-5-reactive-client/src/main/java/com/baeldung/reactive/{simultaneouswebclient => webclient/simultaneous}/User.java (84%) rename spring-5-reactive-client/src/main/java/com/baeldung/reactive/{simultaneouswebclient => webclient/simultaneous}/UserWithItem.java (84%) rename spring-5-reactive-client/src/test/java/com/baeldung/reactive/{simultaneouswebclient => webclient/simultaneous}/ClientIntegrationTest.java (87%) diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java similarity index 87% rename from spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java rename to spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java index 4fbb904564..3c6623cb02 100644 --- a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Client.java +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.simultaneouswebclient; +package com.baeldung.reactive.webclient.simultaneous; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; @@ -16,24 +16,21 @@ public class Client { } public Mono getUser(int id) { - return webClient - .get() + return webClient.get() .uri("/user/{id}", id) .retrieve() .bodyToMono(User.class); } public Mono getItem(int id) { - return webClient - .get() + return webClient.get() .uri("/item/{id}", id) .retrieve() .bodyToMono(Item.class); } public Mono getOtherUser(int id) { - return webClient - .get() + return webClient.get() .uri("/otheruser/{id}", id) .retrieve() .bodyToMono(User.class); @@ -45,7 +42,7 @@ public class Client { .runOn(Schedulers.elastic()) .flatMap(this::getUser) .collectSortedList((u1, u2) -> u2.id() - u1.id()) - .block(); + .block(); } public List fetchUserAndOtherUser(int id) { @@ -61,6 +58,6 @@ public class Client { Mono item = getItem(itemId).subscribeOn(Schedulers.elastic()); return Mono.zip(user, item, UserWithItem::new) - .block(); + .block(); } } diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Item.java similarity index 84% rename from spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java rename to spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Item.java index 5584e1896d..5b8260743b 100644 --- a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/Item.java +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.simultaneouswebclient; +package com.baeldung.reactive.webclient.simultaneous; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/User.java similarity index 84% rename from spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java rename to spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/User.java index e080538227..0e1cc2cd76 100644 --- a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/User.java +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/User.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.simultaneouswebclient; +package com.baeldung.reactive.webclient.simultaneous; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/UserWithItem.java similarity index 84% rename from spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java rename to spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/UserWithItem.java index d19a324e55..96dcfe994e 100644 --- a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/simultaneouswebclient/UserWithItem.java +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/UserWithItem.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.simultaneouswebclient; +package com.baeldung.reactive.webclient.simultaneous; public class UserWithItem { private User user; diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java similarity index 87% rename from spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java rename to spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java index e5b707d384..99efd34f9f 100644 --- a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/simultaneouswebclient/ClientIntegrationTest.java +++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.simultaneouswebclient; +package com.baeldung.reactive.webclient.simultaneous; import org.junit.Test; import org.junit.Before; @@ -8,7 +8,6 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import com.github.tomakehurst.wiremock.WireMockServer; -import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -43,17 +42,15 @@ public class ClientIntegrationTest { int singleRequestTime = 1000; for (int i = 1; i <= requestsNumber; i++) { - stubFor( - get(urlEqualTo("/user/" + i)).willReturn(aResponse() - .withFixedDelay(singleRequestTime) + stubFor(get(urlEqualTo("/user/" + i)).willReturn(aResponse().withFixedDelay(singleRequestTime) .withStatus(200) .withHeader("Content-Type", "application/json") .withBody(String.format("{ \"id\": %d }", i)))); } List userIds = IntStream.rangeClosed(1, requestsNumber) - .boxed() - .collect(Collectors.toList()); + .boxed() + .collect(Collectors.toList()); Client client = new Client("http://localhost:8089"); From 40159003668e73275dc8629e1040a33bca0b5adb Mon Sep 17 00:00:00 2001 From: "devender.kumar" Date: Tue, 1 Oct 2019 07:30:43 +0200 Subject: [PATCH 098/107] rename test cases to follow BDD style --- .../ComponentScanAnnotationFilterAppIntegrationTest.java | 2 +- .../aspectj/ComponentScanAspectJFilterAppIntegrationTest.java | 2 +- .../ComponentScanAssignableTypeFilterAppIntegrationTest.java | 2 +- .../custom/ComponentScanCustomFilterAppIntegrationTest.java | 2 +- .../regex/ComponentScanRegexFilterAppIntegrationTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java index ed984a3beb..9eb0b67c21 100644 --- a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterAppIntegrationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*; public class ComponentScanAnnotationFilterAppIntegrationTest { @Test - public void testBean() { + public void whenAnnotationFilterIsUsed_thenComponentScanShouldRegisterBeanAnnotatedWithAnimalAnootation() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAnnotationFilterApp.class); List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAnnotationFilterApp")) diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java index fa8d12723f..44ee7534a8 100644 --- a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*; public class ComponentScanAspectJFilterAppIntegrationTest { @Test - public void testBean() { + public void whenAspectJFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingAspectJCreteria() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAspectJFilterApp.class); List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp")) diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java index 460be8e8ba..3e5c7ee4f7 100644 --- a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/assignable/ComponentScanAssignableTypeFilterAppIntegrationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*; public class ComponentScanAssignableTypeFilterAppIntegrationTest { @Test - public void testBean() { + public void whenAssignableTypeFilterIsUsed_thenComponentScanShouldRegisterBeanOfAssignableTypeAndItsSubClass() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAssignableTypeFilterApp.class); List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAssignableTypeFilterApp")) diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java index f47c0123fa..097214a2cf 100644 --- a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/custom/ComponentScanCustomFilterAppIntegrationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*; public class ComponentScanCustomFilterAppIntegrationTest { @Test - public void testBean() { + public void whenCustomFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingCustomFilter() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class); List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp")) diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java index 4fccbd776e..3163581c37 100644 --- a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/regex/ComponentScanRegexFilterAppIntegrationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*; public class ComponentScanRegexFilterAppIntegrationTest { @Test - public void testBean() { + public void whenRegexFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingRegex() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanRegexFilterApp.class); List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanRegexFilterApp")) From b4e41095c13f981a6adf331e7c1502285e98c0ed Mon Sep 17 00:00:00 2001 From: "devender.kumar" Date: Tue, 1 Oct 2019 16:40:50 +0200 Subject: [PATCH 099/107] Fix test case --- .../aspectj/ComponentScanAspectJFilterAppIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java index 44ee7534a8..945a0085f6 100644 --- a/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java +++ b/spring-boot-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java @@ -22,7 +22,7 @@ public class ComponentScanAspectJFilterAppIntegrationTest { public void whenAspectJFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingAspectJCreteria() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAspectJFilterApp.class); List beans = Arrays.stream(applicationContext.getBeanDefinitionNames()) - .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp")) + .filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAspectJFilterApp")) .collect(Collectors.toList()); assertThat(beans.size(), equalTo(1)); assertThat(beans.get(0), equalTo("elephant")); From da1db18bc939e05c0ae67fdddc48e2398623f78c Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Tue, 1 Oct 2019 22:33:11 +0300 Subject: [PATCH 100/107] Fix CDI package names (#7715) * Fix beans.xsd location for JavaEE 7 * Fix cdi2observers package names --- .../application/BootstrappingApplication.java | 31 ++++++++++--------- .../cdi2observers/events/ExampleEvent.java | 28 ++++++++--------- .../events/ExampleEventSource.java | 28 ++++++++--------- .../AnotherExampleEventObserver.java | 25 ++++++++------- .../observers/ExampleEventObserver.java | 26 ++++++++-------- .../cdi2observers/services/TextService.java | 16 +++++----- cdi/src/main/resources/META-INF/beans.xml | 7 +++-- .../tests/TextServiceUnitTest.java | 29 ++++++++--------- .../TimeLoggerFactoryUnitTest.java | 1 - 9 files changed, 97 insertions(+), 94 deletions(-) diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java index 4896408502..dc0bdeb951 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java @@ -1,15 +1,16 @@ -package com.baeldung.cdi.cdi2observers.application; - -import com.baeldung.cdi.cdi2observers.events.ExampleEvent; -import javax.enterprise.inject.se.SeContainer; -import javax.enterprise.inject.se.SeContainerInitializer; - -public class BootstrappingApplication { - - public static void main(String... args) { - SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance(); - try (SeContainer container = containerInitializer.initialize()) { - container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!")); - } - } -} +package com.baeldung.cdi2observers.application; + +import com.baeldung.cdi2observers.events.ExampleEvent; + +import javax.enterprise.inject.se.SeContainer; +import javax.enterprise.inject.se.SeContainerInitializer; + +public class BootstrappingApplication { + + public static void main(String... args) { + SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance(); + try (SeContainer container = containerInitializer.initialize()) { + container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!")); + } + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java index a2329d2ef1..9adfad4d39 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java @@ -1,14 +1,14 @@ -package com.baeldung.cdi.cdi2observers.events; - -public class ExampleEvent { - - private final String eventMessage; - - public ExampleEvent(String eventMessage) { - this.eventMessage = eventMessage; - } - - public String getEventMessage() { - return eventMessage; - } -} +package com.baeldung.cdi2observers.events; + +public class ExampleEvent { + + private final String eventMessage; + + public ExampleEvent(String eventMessage) { + this.eventMessage = eventMessage; + } + + public String getEventMessage() { + return eventMessage; + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java index f37030778a..5a0aa0b5e3 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java @@ -1,14 +1,14 @@ -package com.baeldung.cdi.cdi2observers.events; - -import javax.enterprise.event.Event; -import javax.inject.Inject; - -public class ExampleEventSource { - - @Inject - Event exampleEvent; - - public void fireEvent() { - exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!")); - } -} +package com.baeldung.cdi2observers.events; + +import javax.enterprise.event.Event; +import javax.inject.Inject; + +public class ExampleEventSource { + + @Inject + Event exampleEvent; + + public void fireEvent() { + exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!")); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java index 34520c2b3d..3af48af13f 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java @@ -1,12 +1,13 @@ -package com.baeldung.cdi.cdi2observers.observers; - -import com.baeldung.cdi.cdi2observers.events.ExampleEvent; -import javax.annotation.Priority; -import javax.enterprise.event.Observes; - -public class AnotherExampleEventObserver { - - public String onEvent(@Observes @Priority(2) ExampleEvent event) { - return event.getEventMessage(); - } -} +package com.baeldung.cdi2observers.observers; + +import com.baeldung.cdi2observers.events.ExampleEvent; + +import javax.annotation.Priority; +import javax.enterprise.event.Observes; + +public class AnotherExampleEventObserver { + + public String onEvent(@Observes @Priority(2) ExampleEvent event) { + return event.getEventMessage(); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java index b3522b2ad0..33fdc43bbb 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java @@ -1,13 +1,13 @@ -package com.baeldung.cdi.cdi2observers.observers; - -import com.baeldung.cdi.cdi2observers.events.ExampleEvent; -import com.baeldung.cdi.cdi2observers.services.TextService; -import javax.annotation.Priority; -import javax.enterprise.event.Observes; - -public class ExampleEventObserver { - - public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) { - return textService.parseText(event.getEventMessage()); - } -} +package com.baeldung.cdi2observers.observers; + +import com.baeldung.cdi2observers.events.ExampleEvent; +import com.baeldung.cdi2observers.services.TextService; +import javax.annotation.Priority; +import javax.enterprise.event.Observes; + +public class ExampleEventObserver { + + public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) { + return textService.parseText(event.getEventMessage()); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java index 47788a0657..eabe031223 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java @@ -1,8 +1,8 @@ -package com.baeldung.cdi.cdi2observers.services; - -public class TextService { - - public String parseText(String text) { - return text.toUpperCase(); - } -} +package com.baeldung.cdi2observers.services; + +public class TextService { + + public String parseText(String text) { + return text.toUpperCase(); + } +} diff --git a/cdi/src/main/resources/META-INF/beans.xml b/cdi/src/main/resources/META-INF/beans.xml index d41b35e7d9..144e9e567f 100644 --- a/cdi/src/main/resources/META-INF/beans.xml +++ b/cdi/src/main/resources/META-INF/beans.xml @@ -1,7 +1,8 @@ - + + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" + bean-discovery-mode="all"> com.baeldung.interceptor.AuditedInterceptor diff --git a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java index deecf13f9a..1b976144aa 100644 --- a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java +++ b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java @@ -1,14 +1,15 @@ -package com.baeldung.cdi.cdi2observers.tests; - -import com.baeldung.cdi.cdi2observers.services.TextService; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; - -public class TextServiceUnitTest { - - @Test - public void givenTextServiceInstance_whenCalledparseText_thenCorrect() { - TextService textService = new TextService(); - assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG"); - } -} +package com.baeldung.test.cdi2observers.tests; + +import com.baeldung.cdi2observers.services.TextService; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class TextServiceUnitTest { + + @Test + public void givenTextServiceInstance_whenCalledparseText_thenCorrect() { + TextService textService = new TextService(); + assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG"); + } +} diff --git a/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java b/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java index caf2ed32b5..b22f189373 100644 --- a/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java +++ b/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java @@ -6,7 +6,6 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; public class TimeLoggerFactoryUnitTest { - @Test public void givenTimeLoggerFactory_whenCalledgetTimeLogger_thenOneAssertion() { TimeLoggerFactory timeLoggerFactory = new TimeLoggerFactory(); From daad1ef9221c6598e6626eeb56ec8750baf26740 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 2 Oct 2019 05:47:40 +0900 Subject: [PATCH 101/107] remove obsolete runfromjunit module (#7751) --- testing-modules/junit-4/README.md | 1 + testing-modules/pom.xml | 1 - .../src/main/resources/logback.xml | 13 ---------- .../junit4/runfromjava/FirstUnitTest.java | 25 ------------------- .../junit4/runfromjava/SecondUnitTest.java | 18 ------------- .../junit5/runfromjava/FirstUnitTest.java | 24 ------------------ .../junit5/runfromjava/SecondUnitTest.java | 18 ------------- testing-modules/testing-libraries/README.md | 2 +- 8 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 testing-modules/runjunitfromjava/src/main/resources/logback.xml delete mode 100644 testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/FirstUnitTest.java delete mode 100644 testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/SecondUnitTest.java delete mode 100644 testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/FirstUnitTest.java delete mode 100644 testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/SecondUnitTest.java diff --git a/testing-modules/junit-4/README.md b/testing-modules/junit-4/README.md index dd975daf58..d19a0a1e47 100644 --- a/testing-modules/junit-4/README.md +++ b/testing-modules/junit-4/README.md @@ -3,3 +3,4 @@ - [Guide to JUnit 4 Rules](https://www.baeldung.com/junit-4-rules) - [Custom JUnit 4 Test Runners](http://www.baeldung.com/junit-4-custom-runners) - [Introduction to JUnitParams](http://www.baeldung.com/junit-params) +- [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) diff --git a/testing-modules/pom.xml b/testing-modules/pom.xml index 6400a2d7e7..5934db00ff 100644 --- a/testing-modules/pom.xml +++ b/testing-modules/pom.xml @@ -29,7 +29,6 @@ parallel-tests-junit rest-assured rest-testing - selenium-junit-testng spring-testing test-containers diff --git a/testing-modules/runjunitfromjava/src/main/resources/logback.xml b/testing-modules/runjunitfromjava/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/testing-modules/runjunitfromjava/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/FirstUnitTest.java b/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/FirstUnitTest.java deleted file mode 100644 index 588a1e5d66..0000000000 --- a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/FirstUnitTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.junit4.runfromjava; - -import org.junit.Test; - -import static org.junit.Assert.assertTrue; - - -public class FirstUnitTest { - - @Test - public void whenThis_thenThat() { - assertTrue(true); - } - - @Test - public void whenSomething_thenSomething() { - assertTrue(true); - } - - @Test - public void whenSomethingElse_thenSomethingElse() { - assertTrue(true); - } - -} diff --git a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/SecondUnitTest.java b/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/SecondUnitTest.java deleted file mode 100644 index e2d75021cf..0000000000 --- a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit4/runfromjava/SecondUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.junit4.runfromjava; - -import org.junit.Test; - -import static org.junit.Assert.assertTrue; - -public class SecondUnitTest { - - @Test - public void whenSomething_thenSomething() { - assertTrue(true); - } - - @Test - public void whensomethingElse_thenSomethingElse() { - assertTrue(true); - } -} diff --git a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/FirstUnitTest.java b/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/FirstUnitTest.java deleted file mode 100644 index 57c505781d..0000000000 --- a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/FirstUnitTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.junit5.runfromjava; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -class FirstUnitTest { - - @Test - void whenThis_thenThat() { - assertTrue(true); - } - - @Test - void whenSomething_thenSomething() { - assertTrue(true); - } - - @Test - void whenSomethingElse_thenSomethingElse() { - assertTrue(true); - } - -} diff --git a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/SecondUnitTest.java b/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/SecondUnitTest.java deleted file mode 100644 index fbfb68898b..0000000000 --- a/testing-modules/runjunitfromjava/src/test/java/com/baeldung/junit5/runfromjava/SecondUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.junit5.runfromjava; - -import org.junit.jupiter.api.RepeatedTest; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -class SecondUnitTest { - - @RepeatedTest(10) - void whenSomething_thenSomething() { - assertTrue(true); - } - - @RepeatedTest(5) - void whenSomethingElse_thenSomethingElse() { - assertTrue(true); - } -} diff --git a/testing-modules/testing-libraries/README.md b/testing-modules/testing-libraries/README.md index 0cd9ca7f2e..7191989224 100644 --- a/testing-modules/testing-libraries/README.md +++ b/testing-modules/testing-libraries/README.md @@ -6,5 +6,5 @@ - [Cucumber and Scenario Outline](http://www.baeldung.com/cucumber-scenario-outline) - [Cucumber Java 8 Support](http://www.baeldung.com/cucumber-java-8-support) - [Introduction to Lambda Behave](http://www.baeldung.com/lambda-behave) -- [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) + From dc9a78ab18018f55764b4e64ca26c706211876c5 Mon Sep 17 00:00:00 2001 From: David Calap Date: Tue, 1 Oct 2019 23:33:50 +0200 Subject: [PATCH 102/107] BAEL-3323 Finding an element in a list using Kotlin - Initial commit --- .../kotlin/com/baeldung/lists/ListsTest.kt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt new file mode 100644 index 0000000000..8515a6f078 --- /dev/null +++ b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt @@ -0,0 +1,25 @@ +package com.baeldung.lambda + +import org.junit.jupiter.api.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class ListsTest { + + var batmans: List = listOf("Christian Bale", "Michael Keaton", "Ben Affleck", "George Clooney") + + @Test + fun whenFindASpecificItem_thenItemIsReturned() { + //Returns the first element matching the given predicate, or null if no such element was found. + val theFirstBatman = batmans.find { actor -> "Michael Keaton".equals(actor) } + assertEquals(theFirstBatman, "Michael Keaton") + } + + @Test + fun whenFilterWithPredicate_thenMatchingItemsAreReturned() { + //Returns a list containing only elements matching the given predicate. + val theCoolestBatmans = batmans.filter { actor -> actor.contains("a") } + assertTrue(theCoolestBatmans.contains("Christian Bale") && theCoolestBatmans.contains("Michael Keaton")) + } + +} \ No newline at end of file From 30bf670ba4514a54d082f726965e1ca092a93f8e Mon Sep 17 00:00:00 2001 From: David Calap Date: Wed, 2 Oct 2019 09:19:21 +0200 Subject: [PATCH 103/107] BAEL-3323 filterNot example added. Rename package, class and file --- .../baeldung/lists/{ListsTest.kt => ListsUnitTest.kt} | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) rename core-kotlin-2/src/test/kotlin/com/baeldung/lists/{ListsTest.kt => ListsUnitTest.kt} (68%) diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt similarity index 68% rename from core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt rename to core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt index 8515a6f078..1e7136d08b 100644 --- a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsTest.kt +++ b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt @@ -1,10 +1,10 @@ -package com.baeldung.lambda +package com.baeldung.lists import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class ListsTest { +class ListsUnitTest { var batmans: List = listOf("Christian Bale", "Michael Keaton", "Ben Affleck", "George Clooney") @@ -22,4 +22,11 @@ class ListsTest { assertTrue(theCoolestBatmans.contains("Christian Bale") && theCoolestBatmans.contains("Michael Keaton")) } + @Test + fun whenFilterNotWithPredicate_thenMatchingItemsAreReturned() { + //Returns a list containing only elements not matching the given predicate. + val theMehBatmans = batmans.filterNot { actor -> actor.contains("a") } + assertTrue(!theMehBatmans.contains("Christian Bale") && !theMehBatmans.contains("Michael Keaton")) + } + } \ No newline at end of file From 0478d4600794329e08b22a67c07daca5dad9404b Mon Sep 17 00:00:00 2001 From: David Calap Date: Wed, 2 Oct 2019 09:22:55 +0200 Subject: [PATCH 104/107] BAEL-3323 new check added to example --- .../src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt index 1e7136d08b..6fa7983689 100644 --- a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt +++ b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt @@ -2,6 +2,7 @@ package com.baeldung.lists import org.junit.jupiter.api.Test import kotlin.test.assertEquals +import kotlin.test.assertFalse import kotlin.test.assertTrue class ListsUnitTest { @@ -26,7 +27,8 @@ class ListsUnitTest { fun whenFilterNotWithPredicate_thenMatchingItemsAreReturned() { //Returns a list containing only elements not matching the given predicate. val theMehBatmans = batmans.filterNot { actor -> actor.contains("a") } - assertTrue(!theMehBatmans.contains("Christian Bale") && !theMehBatmans.contains("Michael Keaton")) + assertFalse(theMehBatmans.contains("Christian Bale") && theMehBatmans.contains("Michael Keaton")) + assertTrue(theMehBatmans.contains("Ben Affleck") && theMehBatmans.contains("George Clooney")) } } \ No newline at end of file From 4aeef357e3e46b54474919ea60bf18f8ee1820cc Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 2 Oct 2019 21:16:24 +0800 Subject: [PATCH 105/107] Bi-monthly test fix - BAEL-16797 (#7822) * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Create README.md * Update README.md * Create README.md * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --- algorithms-miscellaneous-2/README.md | 4 ++-- algorithms-sorting/README.md | 1 + apache-olingo/README.md | 1 + core-groovy-2/README.md | 1 + core-java-modules/core-java-8-2/README.md | 2 +- core-java-modules/core-java-arrays/README.md | 3 ++- core-java-modules/core-java-lang-oop-2/README.md | 3 ++- core-java-modules/core-java-lang-operators/README.md | 6 ++++++ core-java-modules/core-java-lang/README.md | 1 + core-java-modules/core-java-security/README.md | 1 + docker/README.md | 3 +++ java-numbers-2/README.md | 1 + java-strings-2/README.md | 1 + javax-servlets/README.md | 1 + javaxval/README.md | 1 + jhipster/jhipster-monolithic/README.md | 1 + libraries-data/README.md | 1 + patterns/dipmodular/README.md | 3 +++ persistence-modules/spring-data-eclipselink/README.md | 1 + spring-5-mvc/README.md | 1 + spring-5-reactive-2/README.md | 1 + spring-boot-bootstrap/README.md | 1 + spring-boot-ops/README.md | 3 ++- spring-mvc-java/README.md | 1 + .../src/main/java/org/baeldung/jdbcauthentication/README.md | 3 +++ testing-modules/easymock/README.md | 3 +++ xml/README.md | 1 + 27 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 core-java-modules/core-java-lang-operators/README.md create mode 100644 docker/README.md create mode 100644 patterns/dipmodular/README.md create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/README.md create mode 100644 testing-modules/easymock/README.md diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md index 745b106963..76727a1d4f 100644 --- a/algorithms-miscellaneous-2/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -1,10 +1,10 @@ ## Relevant articles: -- [Dijkstra Algorithm in Java](https://www.baeldung.com/java-dijkstra) +- [Dijkstra Shortest Path Algorithm in Java](https://www.baeldung.com/java-dijkstra) - [Introduction to Cobertura](https://www.baeldung.com/cobertura) - [Test a Linked List for Cyclicity](https://www.baeldung.com/java-linked-list-cyclicity) - [Introduction to JGraphT](https://www.baeldung.com/jgrapht) - [A Maze Solver in Java](https://www.baeldung.com/java-solve-maze) - [Create a Sudoku Solver in Java](https://www.baeldung.com/java-sudoku) - [Displaying Money Amounts in Words](https://www.baeldung.com/java-money-into-words) -- [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations) \ No newline at end of file +- [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations) diff --git a/algorithms-sorting/README.md b/algorithms-sorting/README.md index 968d51aecf..49130d7e52 100644 --- a/algorithms-sorting/README.md +++ b/algorithms-sorting/README.md @@ -7,3 +7,4 @@ - [Heap Sort in Java](https://www.baeldung.com/java-heap-sort) - [Shell Sort in Java](https://www.baeldung.com/java-shell-sort) - [Counting Sort in Java](https://www.baeldung.com/java-counting-sort) +- [Sorting Strings by Contained Numbers in Java](https://www.baeldung.com/java-sort-strings-contained-numbers) diff --git a/apache-olingo/README.md b/apache-olingo/README.md index bfbdc97700..22fa6b3b51 100644 --- a/apache-olingo/README.md +++ b/apache-olingo/README.md @@ -1,3 +1,4 @@ ## Relevant articles: - [OData Protocol Guide](https://www.baeldung.com/odata) +- [Intro to OData with Olingo](https://www.baeldung.com/olingo) diff --git a/core-groovy-2/README.md b/core-groovy-2/README.md index 1211dae76d..2eb542a1ac 100644 --- a/core-groovy-2/README.md +++ b/core-groovy-2/README.md @@ -9,3 +9,4 @@ - [Working with XML in Groovy](https://www.baeldung.com/groovy-xml) - [Integrating Groovy into Java Applications](https://www.baeldung.com/groovy-java-applications) - [Concatenate Strings with Groovy](https://www.baeldung.com/groovy-concatenate-strings) +- [Metaprogramming in Groovy](https://www.baeldung.com/groovy-metaprogramming) diff --git a/core-java-modules/core-java-8-2/README.md b/core-java-modules/core-java-8-2/README.md index d11510b2aa..4952cf4eb7 100644 --- a/core-java-modules/core-java-8-2/README.md +++ b/core-java-modules/core-java-8-2/README.md @@ -5,6 +5,6 @@ ### Relevant Articles: - [Anonymous Classes in Java](http://www.baeldung.com/) - [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) -- [Run JAR Application With Command Line Arguments](https://www.baeldung.com/java-run-jar-with-arguments) +- [Run a Java Application from the Command Line](https://www.baeldung.com/java-run-jar-with-arguments) - [Java 8 Stream skip() vs limit()](https://www.baeldung.com/java-stream-skip-vs-limit) - [Guide to Java BiFunction Interface](https://www.baeldung.com/java-bifunction-interface) diff --git a/core-java-modules/core-java-arrays/README.md b/core-java-modules/core-java-arrays/README.md index 088e927910..36d2d4c4ad 100644 --- a/core-java-modules/core-java-arrays/README.md +++ b/core-java-modules/core-java-arrays/README.md @@ -10,6 +10,7 @@ - [Multi-Dimensional Arrays In Java](https://www.baeldung.com/java-jagged-arrays) - [Find Sum and Average in a Java Array](https://www.baeldung.com/java-array-sum-average) - [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) -- [How to Invert an Array in Java](https://www.baeldung.com/java-invert-array) +- [Read and Write User Input in Java](https://www.baeldung.com/java-console-input-output) +- [How to Reverse an Array in Java](http://www.baeldung.com/java-invert-array) - [Sorting Arrays in Java](https://www.baeldung.com/java-sorting-arrays) - [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array) diff --git a/core-java-modules/core-java-lang-oop-2/README.md b/core-java-modules/core-java-lang-oop-2/README.md index 096e4ee002..3d2ecc3a09 100644 --- a/core-java-modules/core-java-lang-oop-2/README.md +++ b/core-java-modules/core-java-lang-oop-2/README.md @@ -13,4 +13,5 @@ - [Immutable Objects in Java](https://www.baeldung.com/java-immutable-object) - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](https://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) -- [Static and Default Methods in Interfaces in Java](https://www.baeldung.com/java-static-default-methods) \ No newline at end of file +- [Composition, Aggregation, and Association in Java](https://www.baeldung.com/java-composition-aggregation-association) +- [Static and Default Methods in Interfaces in Java](https://www.baeldung.com/java-static-default-methods) diff --git a/core-java-modules/core-java-lang-operators/README.md b/core-java-modules/core-java-lang-operators/README.md new file mode 100644 index 0000000000..280c630882 --- /dev/null +++ b/core-java-modules/core-java-lang-operators/README.md @@ -0,0 +1,6 @@ +## Relevant Articles: +- [Guide to the Diamond Operator in Java](https://www.baeldung.com/java-diamond-operator) +- [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) +- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) +- [Java instanceof Operator](https://www.baeldung.com/java-instanceof) +- [A Guide to Increment and Decrement Unary Operators in Java](https://www.baeldung.com/java-unary-operators) diff --git a/core-java-modules/core-java-lang/README.md b/core-java-modules/core-java-lang/README.md index f3b6d3d8e5..ac91751600 100644 --- a/core-java-modules/core-java-lang/README.md +++ b/core-java-modules/core-java-lang/README.md @@ -38,3 +38,4 @@ - [Attaching Values to Java Enum](https://www.baeldung.com/java-enum-values) - [Variable Scope in Java](https://www.baeldung.com/java-variable-scope) - [Java Classes and Objects](https://www.baeldung.com/java-classes-objects) +- [A Guide to Java Enums](https://www.baeldung.com/a-guide-to-java-enums) diff --git a/core-java-modules/core-java-security/README.md b/core-java-modules/core-java-security/README.md index a833ca30bb..00449575b0 100644 --- a/core-java-modules/core-java-security/README.md +++ b/core-java-modules/core-java-security/README.md @@ -11,3 +11,4 @@ - [SHA-256 and SHA3-256 Hashing in Java](https://www.baeldung.com/sha-256-hashing-java) - [Enabling TLS v1.2 in Java 7](https://www.baeldung.com/java-7-tls-v12) - [The Java SecureRandom Class](https://www.baeldung.com/java-secure-random) +- [An Introduction to Java SASL](https://www.baeldung.com/java-sasl) diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..7948b3d663 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,3 @@ +## Relevant Articles: + +- [Introduction to Docker Compose](https://www.baeldung.com/docker-compose) diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md index 1d2919aa63..9872497950 100644 --- a/java-numbers-2/README.md +++ b/java-numbers-2/README.md @@ -8,3 +8,4 @@ - [Check If a Number Is Prime in Java](http://www.baeldung.com/java-prime-numbers) - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) - [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple) +- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) diff --git a/java-strings-2/README.md b/java-strings-2/README.md index ad0a46fd96..1afecf0d74 100644 --- a/java-strings-2/README.md +++ b/java-strings-2/README.md @@ -24,3 +24,4 @@ - [Checking If a String Is a Repeated Substring](https://www.baeldung.com/java-repeated-substring) - [How to Reverse a String in Java](https://www.baeldung.com/java-reverse-string) - [String toLowerCase and toUpperCase Methods in Java](https://www.baeldung.com/java-string-convert-case) +- [Guide to StreamTokenizer](https://www.baeldung.com/java-streamtokenizer) diff --git a/javax-servlets/README.md b/javax-servlets/README.md index 3c3b17996b..7db11c4d3a 100644 --- a/javax-servlets/README.md +++ b/javax-servlets/README.md @@ -7,3 +7,4 @@ - [Returning a JSON Response from a Servlet](http://www.baeldung.com/servlet-json-response) - [Java EE Servlet Exception Handling](http://www.baeldung.com/servlet-exceptions) - [Context and Servlet Initialization Parameters](http://www.baeldung.com/context-servlet-initialization-param) +- [The Difference between getRequestURI and getPathInfo in HttpServletRequest](https://www.baeldung.com/http-servlet-request-requesturi-pathinfo) diff --git a/javaxval/README.md b/javaxval/README.md index fadd174166..ed9a5024c3 100644 --- a/javaxval/README.md +++ b/javaxval/README.md @@ -7,3 +7,4 @@ - [Validating Container Elements with Bean Validation 2.0](http://www.baeldung.com/bean-validation-container-elements) - [Method Constraints with Bean Validation 2.0](http://www.baeldung.com/javax-validation-method-constraints) - [Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean Validation](https://www.baeldung.com/java-bean-validation-not-null-empty-blank) +- [Javax BigDecimal Validation](https://www.baeldung.com/javax-bigdecimal-validation) diff --git a/jhipster/jhipster-monolithic/README.md b/jhipster/jhipster-monolithic/README.md index 65cc51ad88..de7c6ded74 100644 --- a/jhipster/jhipster-monolithic/README.md +++ b/jhipster/jhipster-monolithic/README.md @@ -1,6 +1,7 @@ ## Relevant Articles - [Intro to JHipster](https://www.baeldung.com/jhipster) +- [Creating New Roles and Authorities in JHipster](https://www.baeldung.com/jhipster-new-roles) # baeldung diff --git a/libraries-data/README.md b/libraries-data/README.md index 92c546c258..c7eb028b4c 100644 --- a/libraries-data/README.md +++ b/libraries-data/README.md @@ -14,3 +14,4 @@ - [Guide to Ebean ORM](https://www.baeldung.com/ebean-orm) - [Introduction to Kafka Connectors](https://www.baeldung.com/kafka-connectors-guide) - [Kafka Connect Example with MQTT and MongoDB](https://www.baeldung.com/kafka-connect-mqtt-mongodb) +- [Building a Data Pipeline with Flink and Kafka](https://www.baeldung.com/kafka-flink-data-pipeline) diff --git a/patterns/dipmodular/README.md b/patterns/dipmodular/README.md new file mode 100644 index 0000000000..ba46158b8c --- /dev/null +++ b/patterns/dipmodular/README.md @@ -0,0 +1,3 @@ +## Relevant Articles: + +- [The Dependency Inversion Principle in Java](https://www.baeldung.com/java-dependency-inversion-principle) diff --git a/persistence-modules/spring-data-eclipselink/README.md b/persistence-modules/spring-data-eclipselink/README.md index 7981470488..a2518fdb99 100644 --- a/persistence-modules/spring-data-eclipselink/README.md +++ b/persistence-modules/spring-data-eclipselink/README.md @@ -1,3 +1,4 @@ ### Relevant articles - [A Guide to EclipseLink with Spring](http://www.baeldung.com/spring-eclipselink) +- [Pessimistic Locking in JPA](https://www.baeldung.com/jpa-pessimistic-locking) diff --git a/spring-5-mvc/README.md b/spring-5-mvc/README.md index 2b57df3b71..d3216187f9 100644 --- a/spring-5-mvc/README.md +++ b/spring-5-mvc/README.md @@ -5,3 +5,4 @@ This module contains articles about Spring 5 model-view-controller (MVC) pattern ### Relevant Articles: - [Spring Boot and Kotlin](http://www.baeldung.com/spring-boot-kotlin) - [Spring MVC Streaming and SSE Request Processing](https://www.baeldung.com/spring-mvc-sse-streams) +- [Interface Driven Controllers in Spring](https://www.baeldung.com/spring-interface-driven-controllers) diff --git a/spring-5-reactive-2/README.md b/spring-5-reactive-2/README.md index 1d21425fb8..8d1d9e1f8e 100644 --- a/spring-5-reactive-2/README.md +++ b/spring-5-reactive-2/README.md @@ -3,4 +3,5 @@ This module contains articles about reactive Spring 5 - [Spring WebClient vs. RestTemplate](https://www.baeldung.com/spring-webclient-resttemplate) +- [Spring WebClient Filters](https://www.baeldung.com/spring-webclient-filters) - More articles: [[<-- prev]](/spring-5-reactive) diff --git a/spring-boot-bootstrap/README.md b/spring-boot-bootstrap/README.md index 82ec384c86..6dd1582a20 100644 --- a/spring-boot-bootstrap/README.md +++ b/spring-boot-bootstrap/README.md @@ -9,3 +9,4 @@ This module contains articles about bootstrapping Spring Boot applications. - [Deploy a Spring Boot Application to Google App Engine](https://www.baeldung.com/spring-boot-google-app-engine) - [Deploy a Spring Boot Application to OpenShift](https://www.baeldung.com/spring-boot-deploy-openshift) - [Deploy a Spring Boot Application to AWS Beanstalk](https://www.baeldung.com/spring-boot-deploy-aws-beanstalk) +- [Guide to @SpringBootConfiguration in Spring Boot](https://www.baeldung.com/springbootconfiguration-annotation) diff --git a/spring-boot-ops/README.md b/spring-boot-ops/README.md index 58e63bcdc7..71b00b63b0 100644 --- a/spring-boot-ops/README.md +++ b/spring-boot-ops/README.md @@ -16,4 +16,5 @@ This module contains articles about Spring Boot Operations - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) - - More articles: [[next -->]](/spring-boot-ops-2) \ No newline at end of file + - [Running a Spring Boot App with Maven vs an Executable War/Jar](https://www.baeldung.com/spring-boot-run-maven-vs-executable-jar) + - More articles: [[next -->]](/spring-boot-ops-2) diff --git a/spring-mvc-java/README.md b/spring-mvc-java/README.md index e946fab3f2..ed9ee20f66 100644 --- a/spring-mvc-java/README.md +++ b/spring-mvc-java/README.md @@ -20,3 +20,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [A Quick Example of Spring Websockets’ @SendToUser Annotation](http://www.baeldung.com/spring-websockets-sendtouser) - [Working with Date Parameters in Spring](https://www.baeldung.com/spring-date-parameters) - [A Java Web Application Without a web.xml](https://www.baeldung.com/java-web-app-without-web-xml) +- [The HttpMediaTypeNotAcceptableException in Spring MVC](https://www.baeldung.com/spring-httpmediatypenotacceptable) diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/README.md b/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/README.md new file mode 100644 index 0000000000..a7cdfec7d8 --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Spring Security: Exploring JDBC Authentication](https://www.baeldung.com/spring-security-jdbc-authentication) diff --git a/testing-modules/easymock/README.md b/testing-modules/easymock/README.md new file mode 100644 index 0000000000..c24ffa9099 --- /dev/null +++ b/testing-modules/easymock/README.md @@ -0,0 +1,3 @@ +## Relevant Articles + +- [Mocking a Void Method with EasyMock](https://www.baeldung.com/easymock-mocking-void-method) diff --git a/xml/README.md b/xml/README.md index f125955089..1872568574 100644 --- a/xml/README.md +++ b/xml/README.md @@ -8,4 +8,5 @@ This module contains articles about eXtensible Markup Language (XML) - [XML Libraries Support in Java](http://www.baeldung.com/java-xml-libraries) - [DOM parsing with Xerces](http://www.baeldung.com/java-xerces-dom-parsing) - [Write an org.w3.dom.Document to a File](https://www.baeldung.com/java-write-xml-document-file) +- [Modifying an XML Attribute in Java](https://www.baeldung.com/java-modify-xml-attribute) - [Convert XML to HTML in Java](https://www.baeldung.com/java-convert-xml-to-html) From 93f31a8ac2bbc166d71c8ed84bb14d16ef0f1b05 Mon Sep 17 00:00:00 2001 From: Maciej Andrearczyk Date: Wed, 2 Oct 2019 18:32:00 +0200 Subject: [PATCH 106/107] BAEL-3285 | Fixed test name, added logging --- .../com/baeldung/reactive/webclient/simultaneous/Client.java | 5 +++++ .../webclient/simultaneous/ClientIntegrationTest.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java index 3c6623cb02..9afe50af58 100644 --- a/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java +++ b/spring-5-reactive-client/src/main/java/com/baeldung/reactive/webclient/simultaneous/Client.java @@ -6,9 +6,12 @@ import reactor.core.publisher.Flux; import reactor.core.scheduler.Schedulers; import java.util.List; +import java.util.logging.Logger; public class Client { + private static final Logger LOG = Logger.getLogger(Client.class.getName()); + private WebClient webClient; public Client(String uri) { @@ -16,6 +19,8 @@ public class Client { } public Mono getUser(int id) { + LOG.info(String.format("Calling getUser(%d)", id)); + return webClient.get() .uri("/user/{id}", id) .retrieve() diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java index 99efd34f9f..0acedf15b0 100644 --- a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java +++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/webclient/simultaneous/ClientIntegrationTest.java @@ -36,7 +36,7 @@ public class ClientIntegrationTest { } @Test - public void checkIfCallsAreExecutedSimultaneously() { + public void givenClient_whenFetchingUsers_thenExecutionTimeIsLessThanDouble() { // Arrange int requestsNumber = 5; int singleRequestTime = 1000; From e2f6187f35a327ac9e762cba7c167dcf97167c2a Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 2 Oct 2019 11:30:08 -0600 Subject: [PATCH 107/107] Update links to https (#7931) * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * Update README.md * https added * https added * Update README.md * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added * https added --- akka-streams/README.md | 2 +- algorithms-genetic/README.md | 4 +- algorithms-miscellaneous-3/README.md | 6 +- algorithms-sorting/README.md | 2 +- animal-sniffer-mvn-plugin/README.md | 2 +- annotations/readme.md | 2 +- antlr/README.md | 2 +- apache-avro/README.md | 2 +- apache-bval/README.md | 2 +- apache-curator/README.md | 2 +- apache-cxf/README.md | 8 +-- apache-meecrowave/README.md | 2 +- apache-opennlp/README.md | 2 +- apache-poi/README.md | 6 +- apache-shiro/README.md | 2 +- apache-solrj/README.md | 2 +- apache-spark/README.md | 2 +- apache-thrift/README.md | 2 +- apache-tika/README.md | 2 +- apache-velocity/README.md | 2 +- apache-zookeeper/README.md | 2 +- asciidoctor/README.md | 4 +- asm/README.md | 2 +- atomix/README.md | 2 +- autovalue/README.md | 4 +- aws-lambda/README.md | 4 +- aws/README.md | 16 ++--- axon/README.md | 2 +- azure/README.md | 2 +- blade/README.md | 2 +- bootique/README.md | 2 +- cdi/README.md | 4 +- checker-plugin/README.md | 2 +- core-groovy-2/README.md | 1 - core-groovy/README.md | 6 +- core-kotlin/README.md | 62 ++++++++--------- couchbase/README.md | 10 +-- dagger/README.md | 2 +- deeplearning4j/README.md | 2 +- disruptor/README.md | 2 +- dozer/README.md | 2 +- drools/README.MD | 6 +- dubbo/README.md | 2 +- ethereum/README.md | 6 +- feign/README.md | 4 +- geotools/README.md | 2 +- google-cloud/README.md | 2 +- google-web-toolkit/README.md | 2 +- gradle/README.md | 8 +-- grails/README.md | 2 +- graphql/graphql-java/README.md | 2 +- grpc/README.md | 2 +- gson/README.md | 6 +- guava-collections-set/README.md | 6 +- guava-collections/README.md | 26 +++---- guava-io/README.md | 4 +- guava/README.md | 20 +++--- guice/README.md | 2 +- hazelcast/README.md | 2 +- httpclient-simple/README.md | 12 ++-- httpclient/README.md | 20 +++--- hystrix/README.md | 4 +- image-processing/README.md | 2 +- immutables/README.md | 2 +- jackson-simple/README.md | 12 ++-- jackson/README.md | 46 ++++++------- java-collections-conversions/README.md | 12 ++-- java-dates/README.md | 40 +++++------ java-ee-8-security-api/README.md | 2 +- java-lite/README.md | 4 +- java-numbers-2/README.md | 8 +-- java-rmi/README.md | 2 +- java-spi/README.md | 2 +- java-streams/README.md | 18 ++--- java-strings-2/README.md | 6 +- java-strings-ops/README.md | 22 +++--- java-strings/README.md | 18 ++--- java-vavr-stream/README.md | 2 +- java-websocket/README.md | 2 +- javafx/README.md | 2 +- javax-servlets/README.md | 16 ++--- javaxval/README.md | 6 +- jaxb/README.md | 2 +- jee-7-security/README.md | 2 +- jee-7/README.md | 12 ++-- jersey/README.md | 2 +- jgit/README.md | 2 +- jgroups/README.md | 2 +- jjwt/README.md | 2 +- jmeter/README.md | 4 +- jmh/README.md | 2 +- jni/README.md | 2 +- jooby/README.md | 2 +- jsf/README.md | 8 +-- json-path/README.md | 4 +- json/README.md | 12 ++-- jsoup/README.md | 2 +- jws/README.md | 2 +- kotlin-js/README.md | 2 +- kotlin-libraries/README.md | 12 ++-- lagom/README.md | 2 +- libraries-apache-commons/README.md | 2 +- libraries-data-2/README.md | 18 ++--- libraries-data-3/README.md | 2 +- libraries-data/README.md | 20 +++--- libraries-http/README.md | 16 ++--- libraries-server/README.md | 12 ++-- libraries-testing/README.md | 14 ++-- libraries/README.md | 68 +++++++++---------- linkrest/README.md | 2 +- logging-modules/README.md | 4 +- lombok/README.md | 4 +- lucene/README.md | 4 +- mapstruct/README.md | 2 +- maven-all/maven/README.md | 16 ++--- maven-archetype/README.md | 2 +- mesos-marathon/README.md | 2 +- metrics/README.md | 6 +- micronaut/README.md | 2 +- microprofile/README.md | 2 +- ml/README.md | 2 +- msf4j/README.md | 2 +- muleesb/README.md | 2 +- mustache/README.md | 4 +- mybatis/README.md | 2 +- orika/README.md | 2 +- osgi/readme.md | 2 +- pdf/README.md | 4 +- performance-tests/README.md | 4 +- play-framework/README.md | 6 +- protobuffer/README.md | 2 +- rabbitmq/README.md | 2 +- raml/README.MD | 2 +- ratpack/README.md | 6 +- reactor-core/README.md | 4 +- resteasy/README.md | 6 +- rule-engines/README.md | 2 +- rxjava-2/README.md | 8 +-- rxjava/README.md | 24 +++---- saas/README.md | 2 +- spark-java/README.md | 2 +- spring-4/README.md | 4 +- spring-5-data-reactive/README.md | 4 +- spring-5-mvc/README.md | 2 +- spring-5-reactive-security/README.md | 6 +- spring-5-reactive/README.md | 18 ++--- spring-5-security-oauth/README.md | 2 +- spring-5-security/README.md | 6 +- spring-5/README.md | 14 ++-- spring-activiti/README.md | 8 +-- spring-akka/README.md | 2 +- spring-all/README.md | 40 +++++------ spring-aop/README.md | 8 +-- spring-batch/README.md | 8 +-- spring-bom/README.md | 2 +- spring-boot-admin/README.md | 2 +- spring-boot-autoconfiguration/README.md | 2 +- spring-boot-bootstrap/README.md | 4 +- spring-boot-camel/README.md | 2 +- spring-boot-cli/README.md | 2 +- spring-boot-client/README.MD | 4 +- spring-boot-ctx-fluent/README.md | 2 +- spring-boot-custom-starter/README.md | 4 +- spring-boot-flowable/README.md | 2 +- spring-boot-gradle/README.md | 4 +- spring-boot-jasypt/README.md | 2 +- spring-boot-keycloak/README.md | 2 +- spring-boot-kotlin/README.md | 2 +- spring-boot-logging-log4j2/README.md | 2 +- spring-boot-mvc/README.md | 18 ++--- spring-boot-ops/README.md | 20 +++--- spring-boot-properties/README.md | 12 ++-- spring-boot-property-exp/README.md | 4 +- spring-boot-rest/README.md | 24 +++---- spring-boot-security/README.md | 4 +- spring-boot-vue/README.md | 2 +- spring-boot/README.MD | 48 ++++++------- spring-cloud-bus/README.md | 2 +- spring-cloud-cli/README.md | 2 +- spring-core-2/README.md | 6 +- spring-core/README.md | 14 ++-- spring-cucumber/README.md | 2 +- spring-data-rest-querydsl/README.md | 2 +- spring-data-rest/README.md | 14 ++-- spring-di/README.md | 10 +-- spring-dispatcher-servlet/README.md | 2 +- spring-drools/README.md | 2 +- spring-ejb/README.md | 12 ++-- spring-exceptions/README.md | 12 ++-- spring-freemarker/README.md | 2 +- spring-integration/README.md | 4 +- spring-jenkins-pipeline/README.md | 4 +- spring-jersey/README.md | 4 +- spring-jinq/README.md | 2 +- spring-jms/README.md | 2 +- spring-jooq/README.md | 4 +- spring-kafka/README.md | 2 +- spring-katharsis/README.md | 4 +- spring-ldap/README.md | 4 +- spring-mobile/README.md | 2 +- spring-mockito/README.md | 4 +- spring-mvc-basics/README.md | 18 ++--- spring-mvc-forms-jsp/README.md | 8 +-- spring-mvc-forms-thymeleaf/README.md | 4 +- spring-mvc-java/README.md | 22 +++--- spring-mvc-kotlin/README.md | 6 +- spring-mvc-simple/README.md | 12 ++-- spring-mvc-velocity/README.md | 2 +- spring-mvc-webflow/README.md | 2 +- spring-mvc-xml/README.md | 13 ++-- spring-protobuf/README.md | 2 +- spring-quartz/README.md | 4 +- spring-reactive-kotlin/README.md | 2 +- spring-reactor/README.md | 2 +- spring-remoting/README.md | 10 +-- spring-rest-angular/README.md | 2 +- spring-rest-full/README.md | 6 +- spring-rest-hal-browser/README.md | 2 +- spring-rest-query-language/README.md | 12 ++-- spring-rest-shell/README.md | 2 +- spring-rest-simple/README.md | 10 +-- spring-rest/README.md | 34 +++++----- spring-resttemplate/README.md | 8 +-- spring-roo/README.md | 2 +- spring-security-acl/README.md | 2 +- spring-security-cache-control/README.md | 2 +- spring-security-core/README.md | 8 +-- spring-security-mvc-boot/README.md | 14 ++-- spring-security-mvc-custom/README.md | 14 ++-- spring-security-mvc-digest-auth/README.md | 4 +- spring-security-mvc-ldap/README.md | 4 +- spring-security-mvc-login/README.md | 14 ++-- .../README.md | 2 +- spring-security-mvc-socket/README.md | 4 +- spring-security-mvc/README.md | 4 +- spring-security-openid/README.md | 2 +- spring-security-react/README.md | 2 +- spring-security-rest-basic-auth/README.md | 6 +- spring-security-rest-custom/README.md | 4 +- spring-security-rest/README.md | 14 ++-- spring-security-sso/README.md | 2 +- spring-security-stormpath/README.md | 2 +- spring-security-thymeleaf/README.MD | 2 +- spring-security-x509/README.md | 2 +- spring-sleuth/README.md | 2 +- spring-social-login/README.md | 2 +- spring-spel/README.md | 2 +- spring-state-machine/README.md | 2 +- spring-static-resources/README.md | 6 +- spring-swagger-codegen/README.md | 2 +- spring-thymeleaf/README.md | 28 ++++---- spring-vertx/README.md | 2 +- spring-webflux-amqp/README.md | 2 +- spring-zuul/README.md | 2 +- static-analysis/README.md | 4 +- stripe/README.md | 2 +- structurizr/README.md | 2 +- struts-2/README.md | 2 +- twilio/README.md | 2 +- twitter4j/README.md | 2 +- undertow/README.md | 2 +- vaadin/README.md | 2 +- vavr/README.md | 24 +++---- vertx-and-rxjava/README.md | 2 +- vertx/README.md | 2 +- vraptor/README.md | 5 +- wicket/README.md | 4 +- xml/README.md | 8 +-- xstream/README.md | 6 +- 269 files changed, 861 insertions(+), 882 deletions(-) diff --git a/akka-streams/README.md b/akka-streams/README.md index 7f2751422b..5f71991def 100644 --- a/akka-streams/README.md +++ b/akka-streams/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [Guide to Akka Streams](http://www.baeldung.com/akka-streams) +- [Guide to Akka Streams](https://www.baeldung.com/akka-streams) diff --git a/algorithms-genetic/README.md b/algorithms-genetic/README.md index 39f8d59eee..124e9c09e5 100644 --- a/algorithms-genetic/README.md +++ b/algorithms-genetic/README.md @@ -1,6 +1,6 @@ ## Relevant articles: -- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics) -- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization) +- [Introduction to Jenetics Library](https://www.baeldung.com/jenetics) +- [Ant Colony Optimization](https://www.baeldung.com/java-ant-colony-optimization) - [Design a Genetic Algorithm in Java](https://www.baeldung.com/java-genetic-algorithm) - [The Traveling Salesman Problem in Java](https://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) diff --git a/algorithms-miscellaneous-3/README.md b/algorithms-miscellaneous-3/README.md index 843407f047..d2d73ec8a1 100644 --- a/algorithms-miscellaneous-3/README.md +++ b/algorithms-miscellaneous-3/README.md @@ -2,10 +2,10 @@ - [Java Two Pointer Technique](https://www.baeldung.com/java-two-pointer-technique) - [Implementing Simple State Machines with Java Enums](https://www.baeldung.com/java-enum-simple-state-machine) -- [Converting Between Roman and Arabic Numerals in Java](http://www.baeldung.com/java-convert-roman-arabic) -- [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity) +- [Converting Between Roman and Arabic Numerals in Java](https://www.baeldung.com/java-convert-roman-arabic) +- [Practical Java Examples of the Big O Notation](https://www.baeldung.com/java-algorithm-complexity) - [Checking If a List Is Sorted in Java](https://www.baeldung.com/java-check-if-list-sorted) - [Checking if a Java Graph has a Cycle](https://www.baeldung.com/java-graph-has-a-cycle) - [A Guide to the Folding Technique in Java](https://www.baeldung.com/folding-hashing-technique) - [Creating a Triangle with for Loops in Java](https://www.baeldung.com/java-print-triangle) -- [Efficient Word Frequency Calculator in Java](https://www.baeldung.com/java-word-frequency) \ No newline at end of file +- [Efficient Word Frequency Calculator in Java](https://www.baeldung.com/java-word-frequency) diff --git a/algorithms-sorting/README.md b/algorithms-sorting/README.md index 49130d7e52..903865046a 100644 --- a/algorithms-sorting/README.md +++ b/algorithms-sorting/README.md @@ -1,6 +1,6 @@ ## Relevant articles: -- [Bubble Sort in Java](http://www.baeldung.com/java-bubble-sort) +- [Bubble Sort in Java](https://www.baeldung.com/java-bubble-sort) - [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) - [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort) - [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort) diff --git a/animal-sniffer-mvn-plugin/README.md b/animal-sniffer-mvn-plugin/README.md index 4c7c381da4..e292fe29ca 100644 --- a/animal-sniffer-mvn-plugin/README.md +++ b/animal-sniffer-mvn-plugin/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -[Introduction to Animal Sniffer Maven Plugin](http://www.baeldung.com/maven-animal-sniffer) +[Introduction to Animal Sniffer Maven Plugin](https://www.baeldung.com/maven-animal-sniffer) diff --git a/annotations/readme.md b/annotations/readme.md index 2b052803e6..dc40a7e116 100644 --- a/annotations/readme.md +++ b/annotations/readme.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Java Annotation Processing and Creating a Builder](http://www.baeldung.com/java-annotation-processing-builder) +- [Java Annotation Processing and Creating a Builder](https://www.baeldung.com/java-annotation-processing-builder) diff --git a/antlr/README.md b/antlr/README.md index 419d9ddfbb..b6dac4aa4b 100644 --- a/antlr/README.md +++ b/antlr/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Java with ANTLR](http://www.baeldung.com/java-antlr) +- [Java with ANTLR](https://www.baeldung.com/java-antlr) diff --git a/apache-avro/README.md b/apache-avro/README.md index 32d84ecc76..45ae6e2b9b 100644 --- a/apache-avro/README.md +++ b/apache-avro/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Guide to Apache Avro](http://www.baeldung.com/java-apache-avro) +- [Guide to Apache Avro](https://www.baeldung.com/java-apache-avro) diff --git a/apache-bval/README.md b/apache-bval/README.md index 80ea149993..a9b3979828 100644 --- a/apache-bval/README.md +++ b/apache-bval/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Intro to Apache BVal](http://www.baeldung.com/apache-bval) +- [Intro to Apache BVal](https://www.baeldung.com/apache-bval) diff --git a/apache-curator/README.md b/apache-curator/README.md index 9bda573292..30336d7cdc 100644 --- a/apache-curator/README.md +++ b/apache-curator/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Introduction to Apache Curator](http://www.baeldung.com/apache-curator) +- [Introduction to Apache Curator](https://www.baeldung.com/apache-curator) diff --git a/apache-cxf/README.md b/apache-cxf/README.md index d03999dce3..87413df8c9 100644 --- a/apache-cxf/README.md +++ b/apache-cxf/README.md @@ -1,6 +1,6 @@ ## Relevant Articles: -- [Introduction to Apache CXF Aegis Data Binding](http://www.baeldung.com/aegis-data-binding-in-apache-cxf) -- [Apache CXF Support for RESTful Web Services](http://www.baeldung.com/apache-cxf-rest-api) -- [A Guide to Apache CXF with Spring](http://www.baeldung.com/apache-cxf-with-spring) -- [Introduction to Apache CXF](http://www.baeldung.com/introduction-to-apache-cxf) +- [Introduction to Apache CXF Aegis Data Binding](https://www.baeldung.com/aegis-data-binding-in-apache-cxf) +- [Apache CXF Support for RESTful Web Services](https://www.baeldung.com/apache-cxf-rest-api) +- [A Guide to Apache CXF with Spring](https://www.baeldung.com/apache-cxf-with-spring) +- [Introduction to Apache CXF](https://www.baeldung.com/introduction-to-apache-cxf) - [Server-Sent Events (SSE) In JAX-RS](https://www.baeldung.com/java-ee-jax-rs-sse) diff --git a/apache-meecrowave/README.md b/apache-meecrowave/README.md index 42b93a383e..0dea60816b 100644 --- a/apache-meecrowave/README.md +++ b/apache-meecrowave/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: ================================ -- [Building a Microservice with Apache Meecrowave](http://www.baeldung.com/apache-meecrowave) +- [Building a Microservice with Apache Meecrowave](https://www.baeldung.com/apache-meecrowave) diff --git a/apache-opennlp/README.md b/apache-opennlp/README.md index 2e9fa0e384..006ca588f2 100644 --- a/apache-opennlp/README.md +++ b/apache-opennlp/README.md @@ -1,3 +1,3 @@ ### Relevant Articles -- [Intro to Apache OpenNLP](http://www.baeldung.com/apache-open-nlp) +- [Intro to Apache OpenNLP](https://www.baeldung.com/apache-open-nlp) diff --git a/apache-poi/README.md b/apache-poi/README.md index 862981991d..8ffd8ef517 100644 --- a/apache-poi/README.md +++ b/apache-poi/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Microsoft Word Processing in Java with Apache POI](http://www.baeldung.com/java-microsoft-word-with-apache-poi) -- [Working with Microsoft Excel in Java](http://www.baeldung.com/java-microsoft-excel) -- [Creating a MS PowerPoint Presentation in Java](http://www.baeldung.com/apache-poi-slideshow) +- [Microsoft Word Processing in Java with Apache POI](https://www.baeldung.com/java-microsoft-word-with-apache-poi) +- [Working with Microsoft Excel in Java](https://www.baeldung.com/java-microsoft-excel) +- [Creating a MS PowerPoint Presentation in Java](https://www.baeldung.com/apache-poi-slideshow) diff --git a/apache-shiro/README.md b/apache-shiro/README.md index bc3480b266..85f2a99a59 100644 --- a/apache-shiro/README.md +++ b/apache-shiro/README.md @@ -1,2 +1,2 @@ ### Relevant articles -- [Introduction to Apache Shiro](http://www.baeldung.com/apache-shiro) +- [Introduction to Apache Shiro](https://www.baeldung.com/apache-shiro) diff --git a/apache-solrj/README.md b/apache-solrj/README.md index 7a32becb64..55f35b90a7 100644 --- a/apache-solrj/README.md +++ b/apache-solrj/README.md @@ -1,4 +1,4 @@ ## Apache Solrj Tutorials Project ### Relevant Articles -- [Guide to Solr in Java with Apache Solrj](http://www.baeldung.com/apache-solrj) +- [Guide to Solr in Java with Apache Solrj](https://www.baeldung.com/apache-solrj) diff --git a/apache-spark/README.md b/apache-spark/README.md index a4dce212b4..a867fd57ff 100644 --- a/apache-spark/README.md +++ b/apache-spark/README.md @@ -1,4 +1,4 @@ ### Relevant articles -- [Introduction to Apache Spark](http://www.baeldung.com/apache-spark) +- [Introduction to Apache Spark](https://www.baeldung.com/apache-spark) - [Building a Data Pipeline with Kafka, Spark Streaming and Cassandra](https://www.baeldung.com/kafka-spark-data-pipeline) diff --git a/apache-thrift/README.md b/apache-thrift/README.md index d8b9195dcc..b90192f342 100644 --- a/apache-thrift/README.md +++ b/apache-thrift/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Working with Apache Thrift](http://www.baeldung.com/apache-thrift) +- [Working with Apache Thrift](https://www.baeldung.com/apache-thrift) diff --git a/apache-tika/README.md b/apache-tika/README.md index b92a7bebf1..6f5fd054ca 100644 --- a/apache-tika/README.md +++ b/apache-tika/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Content Analysis with Apache Tika](http://www.baeldung.com/apache-tika) +- [Content Analysis with Apache Tika](https://www.baeldung.com/apache-tika) diff --git a/apache-velocity/README.md b/apache-velocity/README.md index 53c67f847e..0d659a0381 100644 --- a/apache-velocity/README.md +++ b/apache-velocity/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Introduction to Apache Velocity](http://www.baeldung.com/apache-velocity) +- [Introduction to Apache Velocity](https://www.baeldung.com/apache-velocity) diff --git a/apache-zookeeper/README.md b/apache-zookeeper/README.md index 6bddcfd5a8..d3ef944b0e 100644 --- a/apache-zookeeper/README.md +++ b/apache-zookeeper/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Getting Started with Java and Zookeeper](http://www.baeldung.com/java-zookeeper) +- [Getting Started with Java and Zookeeper](https://www.baeldung.com/java-zookeeper) diff --git a/asciidoctor/README.md b/asciidoctor/README.md index 2124907e87..e8bf55792b 100644 --- a/asciidoctor/README.md +++ b/asciidoctor/README.md @@ -1,4 +1,4 @@ ### Relevant articles -- [Generating a Book with Asciidoctor](http://www.baeldung.com/asciidoctor-book) -- [Introduction to Asciidoctor in Java](http://www.baeldung.com/asciidoctor) +- [Generating a Book with Asciidoctor](https://www.baeldung.com/asciidoctor-book) +- [Introduction to Asciidoctor in Java](https://www.baeldung.com/asciidoctor) diff --git a/asm/README.md b/asm/README.md index 50d9c34324..d12ee1ce13 100644 --- a/asm/README.md +++ b/asm/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [A Guide to Java Bytecode Manipulation with ASM](http://www.baeldung.com/java-asm) +- [A Guide to Java Bytecode Manipulation with ASM](https://www.baeldung.com/java-asm) diff --git a/atomix/README.md b/atomix/README.md index fb22eec8dc..c544458974 100644 --- a/atomix/README.md +++ b/atomix/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Introduction to Atomix](http://www.baeldung.com/atomix) +- [Introduction to Atomix](https://www.baeldung.com/atomix) diff --git a/autovalue/README.md b/autovalue/README.md index f33ff6899f..7defca1161 100644 --- a/autovalue/README.md +++ b/autovalue/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Introduction to AutoValue](http://www.baeldung.com/introduction-to-autovalue) -- [Introduction to AutoFactory](http://www.baeldung.com/autofactory) +- [Introduction to AutoValue](https://www.baeldung.com/introduction-to-autovalue) +- [Introduction to AutoFactory](https://www.baeldung.com/autofactory) - [Google AutoService](https://www.baeldung.com/google-autoservice) diff --git a/aws-lambda/README.md b/aws-lambda/README.md index 921b699bdd..a8f9f3e98a 100644 --- a/aws-lambda/README.md +++ b/aws-lambda/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Using AWS Lambda with API Gateway](http://www.baeldung.com/aws-lambda-api-gateway) -- [Introduction to AWS Serverless Application Model](http://www.baeldung.com/aws-serverless) +- [Using AWS Lambda with API Gateway](https://www.baeldung.com/aws-lambda-api-gateway) +- [Introduction to AWS Serverless Application Model](https://www.baeldung.com/aws-serverless) diff --git a/aws/README.md b/aws/README.md index d14ea8a75e..b97db02723 100644 --- a/aws/README.md +++ b/aws/README.md @@ -1,11 +1,11 @@ ### Relevant articles -- [AWS Lambda Using DynamoDB With Java](http://www.baeldung.com/aws-lambda-dynamodb-java) -- [AWS S3 with Java](http://www.baeldung.com/aws-s3-java) -- [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) -- [Managing EC2 Instances in Java](http://www.baeldung.com/ec2-java) -- [Multipart Uploads in Amazon S3 with Java](http://www.baeldung.com/aws-s3-multipart-upload) -- [Integration Testing with a Local DynamoDB Instance](http://www.baeldung.com/dynamodb-local-integration-tests) -- [Using the JetS3t Java Client With Amazon S3](http://www.baeldung.com/jets3t-amazon-s3) -- [Managing Amazon SQS Queues in Java](http://www.baeldung.com/aws-queues-java) +- [AWS Lambda Using DynamoDB With Java](https://www.baeldung.com/aws-lambda-dynamodb-java) +- [AWS S3 with Java](https://www.baeldung.com/aws-s3-java) +- [AWS Lambda With Java](https://www.baeldung.com/java-aws-lambda) +- [Managing EC2 Instances in Java](https://www.baeldung.com/ec2-java) +- [Multipart Uploads in Amazon S3 with Java](https://www.baeldung.com/aws-s3-multipart-upload) +- [Integration Testing with a Local DynamoDB Instance](https://www.baeldung.com/dynamodb-local-integration-tests) +- [Using the JetS3t Java Client With Amazon S3](https://www.baeldung.com/jets3t-amazon-s3) +- [Managing Amazon SQS Queues in Java](https://www.baeldung.com/aws-queues-java) - [Guide to AWS Aurora RDS with Java](https://www.baeldung.com/aws-aurora-rds-java) diff --git a/axon/README.md b/axon/README.md index f1ae5d00d8..8938be7ec2 100644 --- a/axon/README.md +++ b/axon/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [A Guide to the Axon Framework](http://www.baeldung.com/axon-cqrs-event-sourcing) +- [A Guide to the Axon Framework](https://www.baeldung.com/axon-cqrs-event-sourcing) diff --git a/azure/README.md b/azure/README.md index ae8c443660..3c70622b85 100644 --- a/azure/README.md +++ b/azure/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Deploy a Spring Boot App to Azure](http://www.baeldung.com/spring-boot-azure) +- [Deploy a Spring Boot App to Azure](https://www.baeldung.com/spring-boot-azure) diff --git a/blade/README.md b/blade/README.md index 1f2a00ed3f..202494330f 100644 --- a/blade/README.md +++ b/blade/README.md @@ -1,5 +1,5 @@ ### Relevant Articles: -- [Blade – A Complete Guidebook](http://www.baeldung.com/blade) +- [Blade – A Complete Guidebook](https://www.baeldung.com/blade) Run Integration Tests with `mvn integration-test` diff --git a/bootique/README.md b/bootique/README.md index 2ef898fcf7..beb61c2a78 100644 --- a/bootique/README.md +++ b/bootique/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Introduction to Bootique](http://www.baeldung.com/bootique) +- [Introduction to Bootique](https://www.baeldung.com/bootique) diff --git a/cdi/README.md b/cdi/README.md index bfb635be9e..69ce285d7b 100644 --- a/cdi/README.md +++ b/cdi/README.md @@ -1,5 +1,5 @@ ### Relevant Articles: -- [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) -- [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi) +- [CDI Interceptor vs Spring AspectJ](https://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) +- [An Introduction to CDI (Contexts and Dependency Injection) in Java](https://www.baeldung.com/java-ee-cdi) - [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification) diff --git a/checker-plugin/README.md b/checker-plugin/README.md index f4534b09e8..5c73b86f91 100644 --- a/checker-plugin/README.md +++ b/checker-plugin/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [The Checker Framework – Pluggable Type Systems for Java](http://www.baeldung.com/checker-framework) +- [The Checker Framework – Pluggable Type Systems for Java](https://www.baeldung.com/checker-framework) diff --git a/core-groovy-2/README.md b/core-groovy-2/README.md index 2eb542a1ac..1dbfbd07a5 100644 --- a/core-groovy-2/README.md +++ b/core-groovy-2/README.md @@ -2,7 +2,6 @@ ## Relevant articles: -- [String Matching in Groovy](http://www.baeldung.com/) - [Template Engines in Groovy](https://www.baeldung.com/groovy-template-engines) - [Groovy def Keyword](https://www.baeldung.com/groovy-def-keyword) - [Pattern Matching in Strings in Groovy](https://www.baeldung.com/groovy-pattern-matching) diff --git a/core-groovy/README.md b/core-groovy/README.md index 321c37be8d..2e62884b1f 100644 --- a/core-groovy/README.md +++ b/core-groovy/README.md @@ -2,8 +2,8 @@ ## Relevant articles: -- [JDBC with Groovy](http://www.baeldung.com/jdbc-groovy) -- [Working with JSON in Groovy](http://www.baeldung.com/groovy-json) +- [JDBC with Groovy](https://www.baeldung.com/jdbc-groovy) +- [Working with JSON in Groovy](https://www.baeldung.com/groovy-json) - [Reading a File in Groovy](https://www.baeldung.com/groovy-file-read) - [Types of Strings in Groovy](https://www.baeldung.com/groovy-strings) - [A Quick Guide to Iterating a Map in Groovy](https://www.baeldung.com/groovy-map-iterating) @@ -12,4 +12,4 @@ - [Finding Elements in Collections in Groovy](https://www.baeldung.com/groovy-collections-find-elements) - [Lists in Groovy](https://www.baeldung.com/groovy-lists) - [Converting a String to a Date in Groovy](https://www.baeldung.com/groovy-string-to-date) -- [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io) \ No newline at end of file +- [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io) diff --git a/core-kotlin/README.md b/core-kotlin/README.md index 3392db9171..2728fd4ea0 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -1,36 +1,36 @@ ## Relevant articles: -- [Introduction to the Kotlin Language](http://www.baeldung.com/kotlin) -- [Guide to the “when{}” Block in Kotlin](http://www.baeldung.com/kotlin-when) -- [Comprehensive Guide to Null Safety in Kotlin](http://www.baeldung.com/kotlin-null-safety) -- [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability) -- [Difference Between “==” and “===” operators in Kotlin](http://www.baeldung.com/kotlin-equality-operators) -- [Generics in Kotlin](http://www.baeldung.com/kotlin-generics) -- [Introduction to Kotlin Coroutines](http://www.baeldung.com/kotlin-coroutines) -- [Destructuring Declarations in Kotlin](http://www.baeldung.com/kotlin-destructuring-declarations) -- [Lazy Initialization in Kotlin](http://www.baeldung.com/kotlin-lazy-initialization) -- [Overview of Kotlin Collections API](http://www.baeldung.com/kotlin-collections-api) -- [Converting a List to Map in Kotlin](http://www.baeldung.com/kotlin-list-to-map) -- [Data Classes in Kotlin](http://www.baeldung.com/kotlin-data-classes) -- [Delegated Properties in Kotlin](http://www.baeldung.com/kotlin-delegated-properties) -- [Sealed Classes in Kotlin](http://www.baeldung.com/kotlin-sealed-classes) -- [JUnit 5 for Kotlin Developers](http://www.baeldung.com/junit-5-kotlin) -- [Extension Methods in Kotlin](http://www.baeldung.com/kotlin-extension-methods) -- [Infix Functions in Kotlin](http://www.baeldung.com/kotlin-infix-functions) -- [Try-with-resources in Kotlin](http://www.baeldung.com/kotlin-try-with-resources) -- [Regular Expressions in Kotlin](http://www.baeldung.com/kotlin-regular-expressions) -- [Objects in Kotlin](http://www.baeldung.com/kotlin-objects) -- [Reading from a File in Kotlin](http://www.baeldung.com/kotlin-read-file) -- [Guide to Kotlin @JvmField](http://www.baeldung.com/kotlin-jvm-field-annotation) -- [Filtering Kotlin Collections](http://www.baeldung.com/kotlin-filter-collection) -- [Writing to a File in Kotlin](http://www.baeldung.com/kotlin-write-file) -- [Lambda Expressions in Kotlin](http://www.baeldung.com/kotlin-lambda-expressions) -- [Kotlin String Templates](http://www.baeldung.com/kotlin-string-template) -- [Working with Enums in Kotlin](http://www.baeldung.com/kotlin-enum) -- [Create a Java and Kotlin Project with Maven](http://www.baeldung.com/kotlin-maven-java-project) -- [Reflection with Kotlin](http://www.baeldung.com/kotlin-reflection) -- [Get a Random Number in Kotlin](http://www.baeldung.com/kotlin-random-number) -- [Idiomatic Logging in Kotlin](http://www.baeldung.com/kotlin-logging) +- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin) +- [Guide to the “when{}” Block in Kotlin](https://www.baeldung.com/kotlin-when) +- [Comprehensive Guide to Null Safety in Kotlin](https://www.baeldung.com/kotlin-null-safety) +- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability) +- [Difference Between “==” and “===” operators in Kotlin](https://www.baeldung.com/kotlin-equality-operators) +- [Generics in Kotlin](https://www.baeldung.com/kotlin-generics) +- [Introduction to Kotlin Coroutines](https://www.baeldung.com/kotlin-coroutines) +- [Destructuring Declarations in Kotlin](https://www.baeldung.com/kotlin-destructuring-declarations) +- [Lazy Initialization in Kotlin](https://www.baeldung.com/kotlin-lazy-initialization) +- [Overview of Kotlin Collections API](https://www.baeldung.com/kotlin-collections-api) +- [Converting a List to Map in Kotlin](https://www.baeldung.com/kotlin-list-to-map) +- [Data Classes in Kotlin](https://www.baeldung.com/kotlin-data-classes) +- [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties) +- [Sealed Classes in Kotlin](https://www.baeldung.com/kotlin-sealed-classes) +- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin) +- [Extension Methods in Kotlin](https://www.baeldung.com/kotlin-extension-methods) +- [Infix Functions in Kotlin](https://www.baeldung.com/kotlin-infix-functions) +- [Try-with-resources in Kotlin](https://www.baeldung.com/kotlin-try-with-resources) +- [Regular Expressions in Kotlin](https://www.baeldung.com/kotlin-regular-expressions) +- [Objects in Kotlin](https://www.baeldung.com/kotlin-objects) +- [Reading from a File in Kotlin](https://www.baeldung.com/kotlin-read-file) +- [Guide to Kotlin @JvmField](https://www.baeldung.com/kotlin-jvm-field-annotation) +- [Filtering Kotlin Collections](https://www.baeldung.com/kotlin-filter-collection) +- [Writing to a File in Kotlin](https://www.baeldung.com/kotlin-write-file) +- [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions) +- [Kotlin String Templates](https://www.baeldung.com/kotlin-string-template) +- [Working with Enums in Kotlin](https://www.baeldung.com/kotlin-enum) +- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) +- [Reflection with Kotlin](https://www.baeldung.com/kotlin-reflection) +- [Get a Random Number in Kotlin](https://www.baeldung.com/kotlin-random-number) +- [Idiomatic Logging in Kotlin](https://www.baeldung.com/kotlin-logging) - [Kotlin Constructors](https://www.baeldung.com/kotlin-constructors) - [Creational Design Patterns in Kotlin: Builder](https://www.baeldung.com/kotlin-builder-pattern) - [Kotlin Nested and Inner Classes](https://www.baeldung.com/kotlin-inner-classes) diff --git a/couchbase/README.md b/couchbase/README.md index 7a99ce4299..c4c7df97da 100644 --- a/couchbase/README.md +++ b/couchbase/README.md @@ -1,11 +1,11 @@ ## Couchbase SDK Tutorial Project ### Relevant Articles: -- [Introduction to Couchbase SDK for Java](http://www.baeldung.com/java-couchbase-sdk) -- [Using Couchbase in a Spring Application](http://www.baeldung.com/couchbase-sdk-spring) -- [Asynchronous Batch Operations in Couchbase](http://www.baeldung.com/async-batch-operations-in-couchbase) -- [Querying Couchbase with MapReduce Views](http://www.baeldung.com/couchbase-query-mapreduce-view) -- [Querying Couchbase with N1QL](http://www.baeldung.com/n1ql-couchbase) +- [Introduction to Couchbase SDK for Java](https://www.baeldung.com/java-couchbase-sdk) +- [Using Couchbase in a Spring Application](https://www.baeldung.com/couchbase-sdk-spring) +- [Asynchronous Batch Operations in Couchbase](https://www.baeldung.com/async-batch-operations-in-couchbase) +- [Querying Couchbase with MapReduce Views](https://www.baeldung.com/couchbase-query-mapreduce-view) +- [Querying Couchbase with N1QL](https://www.baeldung.com/n1ql-couchbase) ### Overview This Maven project contains the Java code for the Couchbase entities and Spring services diff --git a/dagger/README.md b/dagger/README.md index 72cba3d3f2..81dc161ca1 100644 --- a/dagger/README.md +++ b/dagger/README.md @@ -1,3 +1,3 @@ ### Relevant articles: -- [Introduction to Dagger 2](http://www.baeldung.com/dagger-2) +- [Introduction to Dagger 2](https://www.baeldung.com/dagger-2) diff --git a/deeplearning4j/README.md b/deeplearning4j/README.md index 14e585cd97..eb1e19daa1 100644 --- a/deeplearning4j/README.md +++ b/deeplearning4j/README.md @@ -2,4 +2,4 @@ This is a sample project for the [deeplearning4j](https://deeplearning4j.org) library. ### Relevant Articles: -- [A Guide to Deeplearning4j](http://www.baeldung.com/deeplearning4j) +- [A Guide to Deeplearning4j](https://www.baeldung.com/deeplearning4j) diff --git a/disruptor/README.md b/disruptor/README.md index 779b1e89c4..8f977d090a 100644 --- a/disruptor/README.md +++ b/disruptor/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Concurrency with LMAX Disruptor – An Introduction](http://www.baeldung.com/lmax-disruptor-concurrency) +- [Concurrency with LMAX Disruptor – An Introduction](https://www.baeldung.com/lmax-disruptor-concurrency) diff --git a/dozer/README.md b/dozer/README.md index 5e104d914c..2e610b836a 100644 --- a/dozer/README.md +++ b/dozer/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [A Guide to Mapping With Dozer](http://www.baeldung.com/dozer) +- [A Guide to Mapping With Dozer](https://www.baeldung.com/dozer) diff --git a/drools/README.MD b/drools/README.MD index 5efbe0d3c3..1ff3dfba20 100644 --- a/drools/README.MD +++ b/drools/README.MD @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Introduction to Drools](http://www.baeldung.com/drools) -- [Drools Using Rules from Excel Files](http://www.baeldung.com/drools-excel) -- [An Example of Backward Chaining in Drools](http://www.baeldung.com/drools-backward-chaining) +- [Introduction to Drools](https://www.baeldung.com/drools) +- [Drools Using Rules from Excel Files](https://www.baeldung.com/drools-excel) +- [An Example of Backward Chaining in Drools](https://www.baeldung.com/drools-backward-chaining) diff --git a/dubbo/README.md b/dubbo/README.md index 0a4cd9a204..566efe28f5 100644 --- a/dubbo/README.md +++ b/dubbo/README.md @@ -1,4 +1,4 @@ ## Relevant articles: -- [Introduction to Dubbo](http://www.baeldung.com/dubbo) +- [Introduction to Dubbo](https://www.baeldung.com/dubbo) diff --git a/ethereum/README.md b/ethereum/README.md index d06ca09636..7eccea7135 100644 --- a/ethereum/README.md +++ b/ethereum/README.md @@ -1,6 +1,6 @@ ## Ethereum ### Relevant Articles: -- [Introduction to EthereumJ](http://www.baeldung.com/ethereumj) -- [Creating and Deploying Smart Contracts with Solidity](http://www.baeldung.com/smart-contracts-ethereum-solidity) -- [Lightweight Ethereum Clients Using Web3j](http://www.baeldung.com/web3j) +- [Introduction to EthereumJ](https://www.baeldung.com/ethereumj) +- [Creating and Deploying Smart Contracts with Solidity](https://www.baeldung.com/smart-contracts-ethereum-solidity) +- [Lightweight Ethereum Clients Using Web3j](https://www.baeldung.com/web3j) diff --git a/feign/README.md b/feign/README.md index da04c40cdc..5aa0e3f56f 100644 --- a/feign/README.md +++ b/feign/README.md @@ -6,5 +6,5 @@ This is the implementation of a [spring-hypermedia-api][1] client using Feign. ### Relevant Articles: -- [Intro to Feign](http://www.baeldung.com/intro-to-feign) -- [Introduction to SLF4J](http://www.baeldung.com/slf4j-with-log4j2-logback) +- [Intro to Feign](https://www.baeldung.com/intro-to-feign) +- [Introduction to SLF4J](https://www.baeldung.com/slf4j-with-log4j2-logback) diff --git a/geotools/README.md b/geotools/README.md index 188ff0fddb..98f1e2c283 100644 --- a/geotools/README.md +++ b/geotools/README.md @@ -1,3 +1,3 @@ ### Relevant Articles -[Introduction to GeoTools](http://www.baeldung.com/geo-tools) +[Introduction to GeoTools](https://www.baeldung.com/geo-tools) diff --git a/google-cloud/README.md b/google-cloud/README.md index 87ca17eac4..c6c49b88bf 100644 --- a/google-cloud/README.md +++ b/google-cloud/README.md @@ -1,7 +1,7 @@ ## Google Cloud Tutorial Project ### Relevant Article: -- [Intro to Google Cloud Storage With Java](http://www.baeldung.com/java-google-cloud-storage) +- [Intro to Google Cloud Storage With Java](https://www.baeldung.com/java-google-cloud-storage) ### Overview This Maven project contains the Java code for the article linked above. diff --git a/google-web-toolkit/README.md b/google-web-toolkit/README.md index 3526fe9962..d2a8b324ec 100644 --- a/google-web-toolkit/README.md +++ b/google-web-toolkit/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Introduction to GWT](http://www.baeldung.com/gwt) +- [Introduction to GWT](https://www.baeldung.com/gwt) diff --git a/gradle/README.md b/gradle/README.md index 14e460f225..0ad0ff3e45 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -1,6 +1,6 @@ ## Relevant articles: -- [Introduction to Gradle](http://www.baeldung.com/gradle) -- [Writing Custom Gradle Plugins](http://www.baeldung.com/gradle-create-plugin) -- [Creating a Fat Jar in Gradle](http://www.baeldung.com/gradle-fat-jar) -- [A Custom Task in Gradle](http://www.baeldung.com/gradle-custom-task) +- [Introduction to Gradle](https://www.baeldung.com/gradle) +- [Writing Custom Gradle Plugins](https://www.baeldung.com/gradle-create-plugin) +- [Creating a Fat Jar in Gradle](https://www.baeldung.com/gradle-fat-jar) +- [A Custom Task in Gradle](https://www.baeldung.com/gradle-custom-task) - [Using JUnit 5 with Gradle](https://www.baeldung.com/junit-5-gradle) diff --git a/grails/README.md b/grails/README.md index faa50a7efd..b93ac5de2e 100644 --- a/grails/README.md +++ b/grails/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [Build an MVC Web Application with Grails](http://www.baeldung.com/grails-mvc-application) +- [Build an MVC Web Application with Grails](https://www.baeldung.com/grails-mvc-application) diff --git a/graphql/graphql-java/README.md b/graphql/graphql-java/README.md index 0033524209..240b62f6b4 100644 --- a/graphql/graphql-java/README.md +++ b/graphql/graphql-java/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Introduction to GraphQL](http://www.baeldung.com/graphql) +- [Introduction to GraphQL](https://www.baeldung.com/graphql) diff --git a/grpc/README.md b/grpc/README.md index 5a60ca2e7e..17128dd19f 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Introduction to gRPC](http://www.baeldung.com/grpc-introduction) +- [Introduction to gRPC](https://www.baeldung.com/grpc-introduction) diff --git a/gson/README.md b/gson/README.md index 268116a2ac..8b882f2d3e 100644 --- a/gson/README.md +++ b/gson/README.md @@ -4,9 +4,9 @@ ### Relevant Articles: -- [Gson Deserialization Cookbook](http://www.baeldung.com/gson-deserialization-guide) -- [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson) -- [Exclude Fields from Serialization in Gson](http://www.baeldung.com/gson-exclude-fields-serialization) +- [Gson Deserialization Cookbook](https://www.baeldung.com/gson-deserialization-guide) +- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson) +- [Exclude Fields from Serialization in Gson](https://www.baeldung.com/gson-exclude-fields-serialization) - [Save Data to a JSON File with Gson](https://www.baeldung.com/gson-save-file) - [Convert JSON to a Map Using Gson](https://www.baeldung.com/gson-json-to-map) - [Working with Primitive Values in Gson](https://www.baeldung.com/java-gson-primitives) diff --git a/guava-collections-set/README.md b/guava-collections-set/README.md index c36d9e0b61..e24552aae8 100644 --- a/guava-collections-set/README.md +++ b/guava-collections-set/README.md @@ -2,7 +2,7 @@ ## Relevant Articles: -- [Guava – Sets](http://www.baeldung.com/guava-sets) -- [Guide to Guava RangeSet](http://www.baeldung.com/guava-rangeset) -- [Guava Set + Function = Map](http://www.baeldung.com/guava-set-function-map-tutorial) +- [Guava – Sets](https://www.baeldung.com/guava-sets) +- [Guide to Guava RangeSet](https://www.baeldung.com/guava-rangeset) +- [Guava Set + Function = Map](https://www.baeldung.com/guava-set-function-map-tutorial) - [Guide to Guava Multiset](https://www.baeldung.com/guava-multiset) diff --git a/guava-collections/README.md b/guava-collections/README.md index e919a98c2b..95397f0ff0 100644 --- a/guava-collections/README.md +++ b/guava-collections/README.md @@ -4,17 +4,17 @@ ### Relevant Articles: -- [Guava Collections Cookbook](http://www.baeldung.com/guava-collections) -- [Guava Ordering Cookbook](http://www.baeldung.com/guava-order) -- [Hamcrest Collections Cookbook](http://www.baeldung.com/hamcrest-collections-arrays) -- [Partition a List in Java](http://www.baeldung.com/java-list-split) -- [Filtering and Transforming Collections in Guava](http://www.baeldung.com/guava-filter-and-transform-a-collection) -- [Guava – Join and Split Collections](http://www.baeldung.com/guava-joiner-and-splitter-tutorial) -- [Guava – Lists](http://www.baeldung.com/guava-lists) -- [Guava – Maps](http://www.baeldung.com/guava-maps) -- [Guide to Guava Multimap](http://www.baeldung.com/guava-multimap) -- [Guide to Guava RangeMap](http://www.baeldung.com/guava-rangemap) -- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) +- [Guava Collections Cookbook](https://www.baeldung.com/guava-collections) +- [Guava Ordering Cookbook](https://www.baeldung.com/guava-order) +- [Hamcrest Collections Cookbook](https://www.baeldung.com/hamcrest-collections-arrays) +- [Partition a List in Java](https://www.baeldung.com/java-list-split) +- [Filtering and Transforming Collections in Guava](https://www.baeldung.com/guava-filter-and-transform-a-collection) +- [Guava – Join and Split Collections](https://www.baeldung.com/guava-joiner-and-splitter-tutorial) +- [Guava – Lists](https://www.baeldung.com/guava-lists) +- [Guava – Maps](https://www.baeldung.com/guava-maps) +- [Guide to Guava Multimap](https://www.baeldung.com/guava-multimap) +- [Guide to Guava RangeMap](https://www.baeldung.com/guava-rangemap) +- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](https://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) -- [Guide to Guava Table](http://www.baeldung.com/guava-table) -- [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map) \ No newline at end of file +- [Guide to Guava Table](https://www.baeldung.com/guava-table) +- [Guide to Guava ClassToInstanceMap](https://www.baeldung.com/guava-class-to-instance-map) diff --git a/guava-io/README.md b/guava-io/README.md index df7775a36d..0737accbed 100644 --- a/guava-io/README.md +++ b/guava-io/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Using Guava CountingOutputStream](http://www.baeldung.com/guava-counting-outputstream) -- [Guava – Write to File, Read from File](http://www.baeldung.com/guava-write-to-file-read-from-file) +- [Using Guava CountingOutputStream](https://www.baeldung.com/guava-counting-outputstream) +- [Guava – Write to File, Read from File](https://www.baeldung.com/guava-write-to-file-read-from-file) diff --git a/guava/README.md b/guava/README.md index d3bbbf6de5..a9694daf0b 100644 --- a/guava/README.md +++ b/guava/README.md @@ -2,14 +2,14 @@ ## Guava Examples ### Relevant Articles: -- [Guava Functional Cookbook](http://www.baeldung.com/guava-functions-predicates) -- [Guide to Guava’s Ordering](http://www.baeldung.com/guava-ordering) -- [Guide to Guava’s PreConditions](http://www.baeldung.com/guava-preconditions) -- [Introduction to Guava CacheLoader](http://www.baeldung.com/guava-cacheloader) -- [Introduction to Guava Memoizer](http://www.baeldung.com/guava-memoizer) -- [Guide to Guava’s EventBus](http://www.baeldung.com/guava-eventbus) -- [Guide to Guava’s Reflection Utilities](http://www.baeldung.com/guava-reflection) -- [Guide to Mathematical Utilities in Guava](http://www.baeldung.com/guava-math) -- [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter) -- [Quick Guide to the Guava RateLimiter](http://www.baeldung.com/guava-rate-limiter) +- [Guava Functional Cookbook](https://www.baeldung.com/guava-functions-predicates) +- [Guide to Guava’s Ordering](https://www.baeldung.com/guava-ordering) +- [Guide to Guava’s PreConditions](https://www.baeldung.com/guava-preconditions) +- [Introduction to Guava CacheLoader](https://www.baeldung.com/guava-cacheloader) +- [Introduction to Guava Memoizer](https://www.baeldung.com/guava-memoizer) +- [Guide to Guava’s EventBus](https://www.baeldung.com/guava-eventbus) +- [Guide to Guava’s Reflection Utilities](https://www.baeldung.com/guava-reflection) +- [Guide to Mathematical Utilities in Guava](https://www.baeldung.com/guava-math) +- [Bloom Filter in Java using Guava](https://www.baeldung.com/guava-bloom-filter) +- [Quick Guide to the Guava RateLimiter](https://www.baeldung.com/guava-rate-limiter) diff --git a/guice/README.md b/guice/README.md index 77c788c363..cc3a8755c0 100644 --- a/guice/README.md +++ b/guice/README.md @@ -1,5 +1,5 @@ ## Google Guice Tutorials Project ### Relevant Articles -- [Guide to Google Guice](http://www.baeldung.com/guice) +- [Guide to Google Guice](https://www.baeldung.com/guice) - [Guice vs Spring – Dependency Injection](https://www.baeldung.com/guice-spring-dependency-injection) diff --git a/hazelcast/README.md b/hazelcast/README.md index 7adb13f2af..8ba6dc122b 100644 --- a/hazelcast/README.md +++ b/hazelcast/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Guide to Hazelcast with Java](http://www.baeldung.com/java-hazelcast) +- [Guide to Hazelcast with Java](https://www.baeldung.com/java-hazelcast) - [Introduction to Hazelcast Jet](https://www.baeldung.com/hazelcast-jet) diff --git a/httpclient-simple/README.md b/httpclient-simple/README.md index e3535a133e..13a539d794 100644 --- a/httpclient-simple/README.md +++ b/httpclient-simple/README.md @@ -1,12 +1,12 @@ ========= ## This module contains articles that are part of the HTTPClient Ebook -- [HttpClient 4 – Get the Status Code](http://www.baeldung.com/httpclient-status-code) -- [HttpClient with SSL](http://www.baeldung.com/httpclient-ssl) -- [HttpClient Timeout](http://www.baeldung.com/httpclient-timeout) -- [HttpClient 4 – Send Custom Cookie](http://www.baeldung.com/httpclient-4-cookies) -- [Custom HTTP Header with the HttpClient](http://www.baeldung.com/httpclient-custom-http-header) -- [HttpClient Basic Authentication](http://www.baeldung.com/httpclient-4-basic-authentication) +- [HttpClient 4 – Get the Status Code](https://www.baeldung.com/httpclient-status-code) +- [HttpClient with SSL](https://www.baeldung.com/httpclient-ssl) +- [HttpClient Timeout](https://www.baeldung.com/httpclient-timeout) +- [HttpClient 4 – Send Custom Cookie](https://www.baeldung.com/httpclient-4-cookies) +- [Custom HTTP Header with the HttpClient](https://www.baeldung.com/httpclient-custom-http-header) +- [HttpClient Basic Authentication](https://www.baeldung.com/httpclient-4-basic-authentication) - [Posting with HttpClient](https://www.baeldung.com/httpclient-post-http-request) diff --git a/httpclient/README.md b/httpclient/README.md index a5fc29b089..6bce5567ec 100644 --- a/httpclient/README.md +++ b/httpclient/README.md @@ -7,13 +7,13 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [HttpClient 4 – Cancel Request](http://www.baeldung.com/httpclient-cancel-request) -- [HttpClient 4 Cookbook](http://www.baeldung.com/httpclient4) -- [Unshorten URLs with HttpClient](http://www.baeldung.com/unshorten-url-httpclient) -- [HttpClient 4 – Follow Redirects for POST](http://www.baeldung.com/httpclient-redirect-on-http-post) -- [Multipart Upload with HttpClient 4](http://www.baeldung.com/httpclient-multipart-upload) -- [HttpAsyncClient Tutorial](http://www.baeldung.com/httpasyncclient-tutorial) -- [HttpClient 4 Tutorial](http://www.baeldung.com/httpclient-guide) -- [Advanced HttpClient Configuration](http://www.baeldung.com/httpclient-advanced-config) -- [HttpClient 4 – Do Not Follow Redirects](http://www.baeldung.com/httpclient-stop-follow-redirect) -- [Custom User-Agent in HttpClient 4](http://www.baeldung.com/httpclient-user-agent-header) +- [HttpClient 4 – Cancel Request](https://www.baeldung.com/httpclient-cancel-request) +- [HttpClient 4 Cookbook](https://www.baeldung.com/httpclient4) +- [Unshorten URLs with HttpClient](https://www.baeldung.com/unshorten-url-httpclient) +- [HttpClient 4 – Follow Redirects for POST](https://www.baeldung.com/httpclient-redirect-on-http-post) +- [Multipart Upload with HttpClient 4](https://www.baeldung.com/httpclient-multipart-upload) +- [HttpAsyncClient Tutorial](https://www.baeldung.com/httpasyncclient-tutorial) +- [HttpClient 4 Tutorial](https://www.baeldung.com/httpclient-guide) +- [Advanced HttpClient Configuration](https://www.baeldung.com/httpclient-advanced-config) +- [HttpClient 4 – Do Not Follow Redirects](https://www.baeldung.com/httpclient-stop-follow-redirect) +- [Custom User-Agent in HttpClient 4](https://www.baeldung.com/httpclient-user-agent-header) diff --git a/hystrix/README.md b/hystrix/README.md index cc5c8a197f..f35518bce3 100644 --- a/hystrix/README.md +++ b/hystrix/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Hystrix Integration with Existing Spring Application](http://www.baeldung.com/hystrix-integration-with-spring-aop) -- [Introduction to Hystrix](http://www.baeldung.com/introduction-to-hystrix) +- [Hystrix Integration with Existing Spring Application](https://www.baeldung.com/hystrix-integration-with-spring-aop) +- [Introduction to Hystrix](https://www.baeldung.com/introduction-to-hystrix) diff --git a/image-processing/README.md b/image-processing/README.md index 48604bdb1f..2dd74d7c47 100644 --- a/image-processing/README.md +++ b/image-processing/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Working with Images in Java](http://www.baeldung.com/java-images) +- [Working with Images in Java](https://www.baeldung.com/java-images) diff --git a/immutables/README.md b/immutables/README.md index b69a14f035..2ea4f4fe50 100644 --- a/immutables/README.md +++ b/immutables/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Introduction to Immutables](http://www.baeldung.com/immutables) +- [Introduction to Immutables](https://www.baeldung.com/immutables) diff --git a/jackson-simple/README.md b/jackson-simple/README.md index be647e22d5..79538c6929 100644 --- a/jackson-simple/README.md +++ b/jackson-simple/README.md @@ -5,9 +5,9 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Jackson Ignore Properties on Marshalling](http://www.baeldung.com/jackson-ignore-properties-on-serialization) -- [Jackson Unmarshalling json with Unknown Properties](http://www.baeldung.com/jackson-deserialize-json-unknown-properties) -- [Jackson Annotation Examples](http://www.baeldung.com/jackson-annotations) -- [Intro to the Jackson ObjectMapper](http://www.baeldung.com/jackson-object-mapper-tutorial) -- [Ignore Null Fields with Jackson](http://www.baeldung.com/jackson-ignore-null-fields) -- [Jackson – Change Name of Field](http://www.baeldung.com/jackson-name-of-property) +- [Jackson Ignore Properties on Marshalling](https://www.baeldung.com/jackson-ignore-properties-on-serialization) +- [Jackson Unmarshalling json with Unknown Properties](https://www.baeldung.com/jackson-deserialize-json-unknown-properties) +- [Jackson Annotation Examples](https://www.baeldung.com/jackson-annotations) +- [Intro to the Jackson ObjectMapper](https://www.baeldung.com/jackson-object-mapper-tutorial) +- [Ignore Null Fields with Jackson](https://www.baeldung.com/jackson-ignore-null-fields) +- [Jackson – Change Name of Field](https://www.baeldung.com/jackson-name-of-property) diff --git a/jackson/README.md b/jackson/README.md index 01d9419a27..fb7f6c4127 100644 --- a/jackson/README.md +++ b/jackson/README.md @@ -6,29 +6,29 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Jackson – Unmarshall to Collection/Array](http://www.baeldung.com/jackson-collection-array) -- [Jackson – Custom Serializer](http://www.baeldung.com/jackson-custom-serialization) -- [Getting Started with Custom Deserialization in Jackson](http://www.baeldung.com/jackson-deserialization) -- [Jackson Exceptions – Problems and Solutions](http://www.baeldung.com/jackson-exception) -- [Jackson Date](http://www.baeldung.com/jackson-serialize-dates) -- [Jackson – Bidirectional Relationships](http://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion) -- [Jackson JSON Tutorial](http://www.baeldung.com/jackson) -- [Jackson – Working with Maps and nulls](http://www.baeldung.com/jackson-map-null-values-or-null-key) -- [Jackson – Decide What Fields Get Serialized/Deserialized](http://www.baeldung.com/jackson-field-serializable-deserializable-or-not) -- [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson) -- [XML Serialization and Deserialization with Jackson](http://www.baeldung.com/jackson-xml-serialization-and-deserialization) -- [More Jackson Annotations](http://www.baeldung.com/jackson-advanced-annotations) -- [Inheritance with Jackson](http://www.baeldung.com/jackson-inheritance) -- [Guide to @JsonFormat in Jackson](http://www.baeldung.com/jackson-jsonformat) -- [Using Optional with Jackson](http://www.baeldung.com/jackson-optional) -- [Map Serialization and Deserialization with Jackson](http://www.baeldung.com/jackson-map) -- [Jackson Streaming API](http://www.baeldung.com/jackson-streaming-api) -- [Jackson – JsonMappingException (No serializer found for class)](http://www.baeldung.com/jackson-jsonmappingexception) -- [How To Serialize Enums as JSON Objects with Jackson](http://www.baeldung.com/jackson-serialize-enums) -- [Jackson – Marshall String to JsonNode](http://www.baeldung.com/jackson-json-to-jsonnode) -- [Jackson – Unmarshall to Collection/Array](http://www.baeldung.com/jackson-collection-array) -- [Serialize Only Fields that meet a Custom Criteria with Jackson](http://www.baeldung.com/jackson-serialize-field-custom-criteria) -- [Mapping Nested Values with Jackson](http://www.baeldung.com/jackson-nested-values) +- [Jackson – Unmarshall to Collection/Array](https://www.baeldung.com/jackson-collection-array) +- [Jackson – Custom Serializer](https://www.baeldung.com/jackson-custom-serialization) +- [Getting Started with Custom Deserialization in Jackson](https://www.baeldung.com/jackson-deserialization) +- [Jackson Exceptions – Problems and Solutions](https://www.baeldung.com/jackson-exception) +- [Jackson Date](https://www.baeldung.com/jackson-serialize-dates) +- [Jackson – Bidirectional Relationships](https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion) +- [Jackson JSON Tutorial](https://www.baeldung.com/jackson) +- [Jackson – Working with Maps and nulls](https://www.baeldung.com/jackson-map-null-values-or-null-key) +- [Jackson – Decide What Fields Get Serialized/Deserialized](https://www.baeldung.com/jackson-field-serializable-deserializable-or-not) +- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson) +- [XML Serialization and Deserialization with Jackson](https://www.baeldung.com/jackson-xml-serialization-and-deserialization) +- [More Jackson Annotations](https://www.baeldung.com/jackson-advanced-annotations) +- [Inheritance with Jackson](https://www.baeldung.com/jackson-inheritance) +- [Guide to @JsonFormat in Jackson](https://www.baeldung.com/jackson-jsonformat) +- [Using Optional with Jackson](https://www.baeldung.com/jackson-optional) +- [Map Serialization and Deserialization with Jackson](https://www.baeldung.com/jackson-map) +- [Jackson Streaming API](https://www.baeldung.com/jackson-streaming-api) +- [Jackson – JsonMappingException (No serializer found for class)](https://www.baeldung.com/jackson-jsonmappingexception) +- [How To Serialize Enums as JSON Objects with Jackson](https://www.baeldung.com/jackson-serialize-enums) +- [Jackson – Marshall String to JsonNode](https://www.baeldung.com/jackson-json-to-jsonnode) +- [Jackson – Unmarshall to Collection/Array](https://www.baeldung.com/jackson-collection-array) +- [Serialize Only Fields that meet a Custom Criteria with Jackson](https://www.baeldung.com/jackson-serialize-field-custom-criteria) +- [Mapping Nested Values with Jackson](https://www.baeldung.com/jackson-nested-values) - [Convert XML to JSON Using Jackson](https://www.baeldung.com/jackson-convert-xml-json) - [Deserialize Immutable Objects with Jackson](https://www.baeldung.com/jackson-deserialize-immutable-objects) - [Mapping a Dynamic JSON Object with Jackson](https://www.baeldung.com/jackson-mapping-dynamic-object) diff --git a/java-collections-conversions/README.md b/java-collections-conversions/README.md index 614f20f186..e80f29f519 100644 --- a/java-collections-conversions/README.md +++ b/java-collections-conversions/README.md @@ -3,12 +3,12 @@ ## Java Collections Cookbooks and Examples ### Relevant Articles: -- [Converting between an Array and a List in Java](http://www.baeldung.com/convert-array-to-list-and-list-to-array) -- [Converting between an Array and a Set in Java](http://www.baeldung.com/convert-array-to-set-and-set-to-array) -- [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list) -- [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set) -- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) -- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map) +- [Converting between an Array and a List in Java](https://www.baeldung.com/convert-array-to-list-and-list-to-array) +- [Converting between an Array and a Set in Java](https://www.baeldung.com/convert-array-to-set-and-set-to-array) +- [Converting between a List and a Set in Java](https://www.baeldung.com/convert-list-to-set-and-set-to-list) +- [Convert a Map to an Array, List or Set in Java](https://www.baeldung.com/convert-map-values-to-array-list-set) +- [Converting a List to String in Java](https://www.baeldung.com/java-list-to-string) +- [How to Convert List to Map in Java](https://www.baeldung.com/java-list-to-map) - [Array to String Conversions](https://www.baeldung.com/java-array-to-string) - [Converting a Collection to ArrayList in Java](https://www.baeldung.com/java-convert-collection-arraylist) - [Java 8 Collectors toMap](https://www.baeldung.com/java-collectors-tomap) diff --git a/java-dates/README.md b/java-dates/README.md index 7da309924d..3a215f9094 100644 --- a/java-dates/README.md +++ b/java-dates/README.md @@ -3,25 +3,25 @@ ## Java Dates Cookbooks and Examples ### Relevant Articles: -- [TemporalAdjuster in Java](http://www.baeldung.com/java-temporal-adjuster) -- [Handling Daylight Savings Time in Java](http://www.baeldung.com/java-daylight-savings) -- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) -- [Difference Between Two Dates in Java](http://www.baeldung.com/java-date-difference) -- [RegEx for matching Date Pattern in Java](http://www.baeldung.com/java-date-regular-expressions) -- [Migrating to the New Java 8 Date Time API](http://www.baeldung.com/migrating-to-java-8-date-time-api) -- [Introduction to the Java 8 Date/Time API](http://www.baeldung.com/java-8-date-time-intro) -- [Get the Current Date, Time and Timestamp in Java 8](http://www.baeldung.com/current-date-time-and-timestamp-in-java-8) -- [Get Date Without Time in Java](http://www.baeldung.com/java-date-without-time) -- [How to Get All Dates Between Two Dates?](http://www.baeldung.com/java-between-dates) -- [Convert Date to LocalDate or LocalDateTime and Back](http://www.baeldung.com/java-date-to-localdate-and-localdatetime) -- [Display All Time Zones With GMT And UTC in Java](http://www.baeldung.com/java-time-zones) -- [Extracting Year, Month and Day from Date in Java](http://www.baeldung.com/java-year-month-day) -- [Guide to java.util.GregorianCalendar](http://www.baeldung.com/java-gregorian-calendar) -- [Measure Elapsed Time in Java](http://www.baeldung.com/java-measure-elapsed-time) -- [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end) -- [Calculate Age in Java](http://www.baeldung.com/java-get-age) -- [Increment Date in Java](http://www.baeldung.com/java-increment-date) -- [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) +- [TemporalAdjuster in Java](https://www.baeldung.com/java-temporal-adjuster) +- [Handling Daylight Savings Time in Java](https://www.baeldung.com/java-daylight-savings) +- [Period and Duration in Java](https://www.baeldung.com/java-period-duration) +- [Difference Between Two Dates in Java](https://www.baeldung.com/java-date-difference) +- [RegEx for matching Date Pattern in Java](https://www.baeldung.com/java-date-regular-expressions) +- [Migrating to the New Java 8 Date Time API](https://www.baeldung.com/migrating-to-java-8-date-time-api) +- [Introduction to the Java 8 Date/Time API](https://www.baeldung.com/java-8-date-time-intro) +- [Get the Current Date, Time and Timestamp in Java 8](https://www.baeldung.com/current-date-time-and-timestamp-in-java-8) +- [Get Date Without Time in Java](https://www.baeldung.com/java-date-without-time) +- [How to Get All Dates Between Two Dates?](https://www.baeldung.com/java-between-dates) +- [Convert Date to LocalDate or LocalDateTime and Back](https://www.baeldung.com/java-date-to-localdate-and-localdatetime) +- [Display All Time Zones With GMT And UTC in Java](https://www.baeldung.com/java-time-zones) +- [Extracting Year, Month and Day from Date in Java](https://www.baeldung.com/java-year-month-day) +- [Guide to java.util.GregorianCalendar](https://www.baeldung.com/java-gregorian-calendar) +- [Measure Elapsed Time in Java](https://www.baeldung.com/java-measure-elapsed-time) +- [How to Get the Start and the End of a Day using Java](https://www.baeldung.com/java-day-start-end) +- [Calculate Age in Java](https://www.baeldung.com/java-get-age) +- [Increment Date in Java](https://www.baeldung.com/java-increment-date) +- [Add Hours To a Date In Java](https://www.baeldung.com/java-add-hours-date) - [Guide to DateTimeFormatter](https://www.baeldung.com/java-datetimeformatter) - [Format ZonedDateTime to String](https://www.baeldung.com/java-format-zoned-datetime-string) - [Convert Between java.time.Instant and java.sql.Timestamp](https://www.baeldung.com/java-time-instant-to-java-sql-timestamp) @@ -29,4 +29,4 @@ - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) - [Differences Between ZonedDateTime and OffsetDateTime](https://www.baeldung.com/java-zoneddatetime-offsetdatetime) -- [Introduction to Joda-Time](http://www.baeldung.com/joda-time) +- [Introduction to Joda-Time](https://www.baeldung.com/joda-time) diff --git a/java-ee-8-security-api/README.md b/java-ee-8-security-api/README.md index 1735419236..5ecce2b4cc 100644 --- a/java-ee-8-security-api/README.md +++ b/java-ee-8-security-api/README.md @@ -1,3 +1,3 @@ ### Relevant articles - - [Java EE 8 Security API](http://www.baeldung.com/java-ee-8-security) + - [Java EE 8 Security API](https://www.baeldung.com/java-ee-8-security) diff --git a/java-lite/README.md b/java-lite/README.md index a4e2edd49f..5221b832f9 100644 --- a/java-lite/README.md +++ b/java-lite/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [A Guide to JavaLite – Building a RESTful CRUD application](http://www.baeldung.com/javalite-rest) -- [Introduction to ActiveWeb](http://www.baeldung.com/activeweb) +- [A Guide to JavaLite – Building a RESTful CRUD application](https://www.baeldung.com/javalite-rest) +- [Introduction to ActiveWeb](https://www.baeldung.com/activeweb) diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md index 9872497950..5c6f46b05b 100644 --- a/java-numbers-2/README.md +++ b/java-numbers-2/README.md @@ -2,10 +2,10 @@ - [Lossy Conversion in Java](https://www.baeldung.com/java-lossy-conversion) - [A Guide to the Java Math Class](https://www.baeldung.com/java-lang-math) - [Calculate the Area of a Circle in Java](https://www.baeldung.com/java-calculate-circle-area) -- [NaN in Java](http://www.baeldung.com/java-not-a-number) -- [Generating Prime Numbers in Java](http://www.baeldung.com/java-generate-prime-numbers) -- [Using Math.pow in Java](http://www.baeldung.com/java-math-pow) -- [Check If a Number Is Prime in Java](http://www.baeldung.com/java-prime-numbers) +- [NaN in Java](https://www.baeldung.com/java-not-a-number) +- [Generating Prime Numbers in Java](https://www.baeldung.com/java-generate-prime-numbers) +- [Using Math.pow in Java](https://www.baeldung.com/java-math-pow) +- [Check If a Number Is Prime in Java](https://www.baeldung.com/java-prime-numbers) - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) - [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple) - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) diff --git a/java-rmi/README.md b/java-rmi/README.md index 4d12060395..201c4c8e66 100644 --- a/java-rmi/README.md +++ b/java-rmi/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [Getting Started with Java RMI](http://www.baeldung.com/java-rmi) +- [Getting Started with Java RMI](https://www.baeldung.com/java-rmi) diff --git a/java-spi/README.md b/java-spi/README.md index d2658c42fe..25e2d10da4 100644 --- a/java-spi/README.md +++ b/java-spi/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Java Service Provider Interface](http://www.baeldung.com/java-spi) +- [Java Service Provider Interface](https://www.baeldung.com/java-spi) diff --git a/java-streams/README.md b/java-streams/README.md index 0c9588c47e..0d26c182ba 100644 --- a/java-streams/README.md +++ b/java-streams/README.md @@ -3,15 +3,15 @@ ## Java Streams Cookbooks and Examples ### Relevant Articles: -- [The Java 8 Stream API Tutorial](http://www.baeldung.com/java-8-streams) -- [Introduction to Java 8 Streams](http://www.baeldung.com/java-8-streams-introduction) -- [Java 8 and Infinite Streams](http://www.baeldung.com/java-inifinite-streams) -- [Java 8 Stream findFirst() vs. findAny()](http://www.baeldung.com/java-stream-findfirst-vs-findany) -- [How to Get the Last Element of a Stream in Java?](http://www.baeldung.com/java-stream-last-element) -- [“Stream has already been operated upon or closed” Exception in Java](http://www.baeldung.com/java-stream-operated-upon-or-closed-exception) -- [Iterable to Stream in Java](http://www.baeldung.com/java-iterable-to-stream) -- [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices) -- [Primitive Type Streams in Java 8](http://www.baeldung.com/java-8-primitive-streams) +- [The Java 8 Stream API Tutorial](https://www.baeldung.com/java-8-streams) +- [Introduction to Java 8 Streams](https://www.baeldung.com/java-8-streams-introduction) +- [Java 8 and Infinite Streams](https://www.baeldung.com/java-inifinite-streams) +- [Java 8 Stream findFirst() vs. findAny()](https://www.baeldung.com/java-stream-findfirst-vs-findany) +- [How to Get the Last Element of a Stream in Java?](https://www.baeldung.com/java-stream-last-element) +- [“Stream has already been operated upon or closed” Exception in Java](https://www.baeldung.com/java-stream-operated-upon-or-closed-exception) +- [Iterable to Stream in Java](https://www.baeldung.com/java-iterable-to-stream) +- [How to Iterate Over a Stream With Indices](https://www.baeldung.com/java-stream-indices) +- [Primitive Type Streams in Java 8](https://www.baeldung.com/java-8-primitive-streams) - [Stream Ordering in Java](https://www.baeldung.com/java-stream-ordering) - [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) - [Java Stream Filter with Lambda Expression](https://www.baeldung.com/java-stream-filter-lambda) diff --git a/java-strings-2/README.md b/java-strings-2/README.md index 1afecf0d74..166a8a2b1f 100644 --- a/java-strings-2/README.md +++ b/java-strings-2/README.md @@ -3,8 +3,8 @@ - [Java Localization – Formatting Messages](https://www.baeldung.com/java-localization-messages-formatting) - [Check If a String Contains a Substring](https://www.baeldung.com/java-string-contains-substring) - [Removing Stopwords from a String in Java](https://www.baeldung.com/java-string-remove-stopwords) -- [Java – Generate Random String](http://www.baeldung.com/java-random-string) -- [Image to Base64 String Conversion](http://www.baeldung.com/java-base64-image-string) +- [Java – Generate Random String](https://www.baeldung.com/java-random-string) +- [Image to Base64 String Conversion](https://www.baeldung.com/java-base64-image-string) - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) - [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) - [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char) @@ -12,7 +12,7 @@ - [Pad a String with Zeros or Spaces in Java](https://www.baeldung.com/java-pad-string) - [Remove Emojis from a Java String](https://www.baeldung.com/java-string-remove-emojis) - [Convert a Comma Separated String to a List in Java](https://www.baeldung.com/java-string-with-separator-to-list) -- [Guide to java.util.Formatter](http://www.baeldung.com/java-string-formatter) +- [Guide to java.util.Formatter](https://www.baeldung.com/java-string-formatter) - [Remove Leading and Trailing Characters from a String](https://www.baeldung.com/java-remove-trailing-characters) - [Concatenating Strings In Java](https://www.baeldung.com/java-strings-concatenation) - [Java String Interview Questions and Answers](https://www.baeldung.com/java-string-interview-questions) diff --git a/java-strings-ops/README.md b/java-strings-ops/README.md index d909f171a7..d9c28dab0d 100644 --- a/java-strings-ops/README.md +++ b/java-strings-ops/README.md @@ -3,20 +3,20 @@ ## Java Strings Cookbooks and Examples ### Relevant Articles: -- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) -- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) +- [Convert char to String in Java](https://www.baeldung.com/java-convert-char-to-string) +- [Convert String to int or Integer in Java](https://www.baeldung.com/java-convert-string-to-int-or-integer) - [Java String Conversions](https://www.baeldung.com/java-string-conversions) -- [Check if a String is a Palindrome](http://www.baeldung.com/java-palindrome) -- [Comparing Strings in Java](http://www.baeldung.com/java-compare-strings) -- [Check If a String Is Numeric in Java](http://www.baeldung.com/java-check-string-number) +- [Check if a String is a Palindrome](https://www.baeldung.com/java-palindrome) +- [Comparing Strings in Java](https://www.baeldung.com/java-compare-strings) +- [Check If a String Is Numeric in Java](https://www.baeldung.com/java-check-string-number) - [Get Substring from String in Java](https://www.baeldung.com/java-substring) -- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string) +- [How to Remove the Last Character of a String?](https://www.baeldung.com/java-remove-last-character-of-string) - [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) -- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars) -- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool) -- [Split a String in Java](http://www.baeldung.com/java-split-string) +- [Count Occurrences of a Char in a String](https://www.baeldung.com/java-count-chars) +- [Guide to Java String Pool](https://www.baeldung.com/java-string-pool) +- [Split a String in Java](https://www.baeldung.com/java-split-string) - [Common String Operations in Java](https://www.baeldung.com/java-string-operations) - [Convert String to Byte Array and Reverse in Java](https://www.baeldung.com/java-string-to-byte-array) - [Java toString() Method](https://www.baeldung.com/java-tostring) -- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) -- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer) \ No newline at end of file +- [CharSequence vs. String in Java](https://www.baeldung.com/java-char-sequence-string) +- [StringBuilder and StringBuffer in Java](https://www.baeldung.com/java-string-builder-string-buffer) diff --git a/java-strings/README.md b/java-strings/README.md index ef536b4099..5b2a327877 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -3,14 +3,14 @@ ## Java Strings Cookbooks and Examples ### Relevant Articles: -- [String Operations with Java Streams](http://www.baeldung.com/java-stream-operations-on-strings) -- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) -- [Java 8 StringJoiner](http://www.baeldung.com/java-string-joiner) -- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) -- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) -- [Use char[] Array Over a String for Manipulating Passwords in Java?](http://www.baeldung.com/java-storing-passwords) -- [Convert a String to Title Case](http://www.baeldung.com/java-string-title-case) -- [Compact Strings in Java 9](http://www.baeldung.com/java-9-compact-string) +- [String Operations with Java Streams](https://www.baeldung.com/java-stream-operations-on-strings) +- [Converting String to Stream of chars](https://www.baeldung.com/java-string-to-stream) +- [Java 8 StringJoiner](https://www.baeldung.com/java-string-joiner) +- [Converting Strings to Enums in Java](https://www.baeldung.com/java-string-to-enum) +- [Quick Guide to the Java StringTokenizer](https://www.baeldung.com/java-stringtokenizer) +- [Use char[] Array Over a String for Manipulating Passwords in Java?](https://www.baeldung.com/java-storing-passwords) +- [Convert a String to Title Case](https://www.baeldung.com/java-string-title-case) +- [Compact Strings in Java 9](https://www.baeldung.com/java-9-compact-string) - [Java Check a String for Lowercase/Uppercase Letter, Special Character and Digit](https://www.baeldung.com/java-lowercase-uppercase-special-character-digit-regex) - [Convert java.util.Date to String](https://www.baeldung.com/java-util-date-to-string) - [Converting a Stack Trace to a String in Java](https://www.baeldung.com/java-stacktrace-to-string) @@ -20,4 +20,4 @@ - [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) - [Adding a Newline Character to a String in Java](https://www.baeldung.com/java-string-newline) - [Remove or Replace part of a String in Java](https://www.baeldung.com/java-remove-replace-string-part) -- [Replace a Character at a Specific Index in a String in Java](https://www.baeldung.com/java-replace-character-at-index) \ No newline at end of file +- [Replace a Character at a Specific Index in a String in Java](https://www.baeldung.com/java-replace-character-at-index) diff --git a/java-vavr-stream/README.md b/java-vavr-stream/README.md index 64299cde11..901978a1d8 100644 --- a/java-vavr-stream/README.md +++ b/java-vavr-stream/README.md @@ -1,5 +1,5 @@ ### Relevant Articles: -- [Java Streams vs Vavr Streams](http://www.baeldung.com/vavr-java-streams) +- [Java Streams vs Vavr Streams](https://www.baeldung.com/vavr-java-streams) diff --git a/java-websocket/README.md b/java-websocket/README.md index f9f0784043..87cbb3fa5c 100644 --- a/java-websocket/README.md +++ b/java-websocket/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [A Guide to the Java API for WebSocket](http://www.baeldung.com/java-websockets) +- [A Guide to the Java API for WebSocket](https://www.baeldung.com/java-websockets) diff --git a/javafx/README.md b/javafx/README.md index 66c81f17ad..7214321141 100644 --- a/javafx/README.md +++ b/javafx/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: --[Introduction to JavaFX](http://www.baeldung.com/javafx) +-[Introduction to JavaFX](https://www.baeldung.com/javafx) diff --git a/javax-servlets/README.md b/javax-servlets/README.md index 7db11c4d3a..8254a78c4c 100644 --- a/javax-servlets/README.md +++ b/javax-servlets/README.md @@ -1,10 +1,10 @@ ### Relevant Articles: -- [Introduction to Java Servlets](http://www.baeldung.com/intro-to-servlets) -- [An MVC Example with Servlets and JSP](http://www.baeldung.com/mvc-servlet-jsp) -- [Handling Cookies and a Session in a Java Servlet](http://www.baeldung.com/java-servlet-cookies-session) -- [Uploading Files with Servlets and JSP](http://www.baeldung.com/upload-file-servlet) -- [Example of Downloading File in a Servlet](http://www.baeldung.com/servlet-download-file) -- [Returning a JSON Response from a Servlet](http://www.baeldung.com/servlet-json-response) -- [Java EE Servlet Exception Handling](http://www.baeldung.com/servlet-exceptions) -- [Context and Servlet Initialization Parameters](http://www.baeldung.com/context-servlet-initialization-param) +- [Introduction to Java Servlets](https://www.baeldung.com/intro-to-servlets) +- [An MVC Example with Servlets and JSP](https://www.baeldung.com/mvc-servlet-jsp) +- [Handling Cookies and a Session in a Java Servlet](https://www.baeldung.com/java-servlet-cookies-session) +- [Uploading Files with Servlets and JSP](https://www.baeldung.com/upload-file-servlet) +- [Example of Downloading File in a Servlet](https://www.baeldung.com/servlet-download-file) +- [Returning a JSON Response from a Servlet](https://www.baeldung.com/servlet-json-response) +- [Java EE Servlet Exception Handling](https://www.baeldung.com/servlet-exceptions) +- [Context and Servlet Initialization Parameters](https://www.baeldung.com/context-servlet-initialization-param) - [The Difference between getRequestURI and getPathInfo in HttpServletRequest](https://www.baeldung.com/http-servlet-request-requesturi-pathinfo) diff --git a/javaxval/README.md b/javaxval/README.md index ed9a5024c3..b141bc7859 100644 --- a/javaxval/README.md +++ b/javaxval/README.md @@ -3,8 +3,8 @@ ## Java Bean Validation Examples ### Relevant Articles: -- [Java Bean Validation Basics](http://www.baeldung.com/javax-validation) -- [Validating Container Elements with Bean Validation 2.0](http://www.baeldung.com/bean-validation-container-elements) -- [Method Constraints with Bean Validation 2.0](http://www.baeldung.com/javax-validation-method-constraints) +- [Java Bean Validation Basics](https://www.baeldung.com/javax-validation) +- [Validating Container Elements with Bean Validation 2.0](https://www.baeldung.com/bean-validation-container-elements) +- [Method Constraints with Bean Validation 2.0](https://www.baeldung.com/javax-validation-method-constraints) - [Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean Validation](https://www.baeldung.com/java-bean-validation-not-null-empty-blank) - [Javax BigDecimal Validation](https://www.baeldung.com/javax-bigdecimal-validation) diff --git a/jaxb/README.md b/jaxb/README.md index 4b603fca00..bdaef90279 100644 --- a/jaxb/README.md +++ b/jaxb/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Guide to JAXB](http://www.baeldung.com/jaxb) +- [Guide to JAXB](https://www.baeldung.com/jaxb) diff --git a/jee-7-security/README.md b/jee-7-security/README.md index 314de6d957..70d451382c 100644 --- a/jee-7-security/README.md +++ b/jee-7-security/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Securing Java EE with Spring Security](http://www.baeldung.com/java-ee-spring-security) +- [Securing Java EE with Spring Security](https://www.baeldung.com/java-ee-spring-security) diff --git a/jee-7/README.md b/jee-7/README.md index c57863651d..2ae7335ce0 100644 --- a/jee-7/README.md +++ b/jee-7/README.md @@ -1,9 +1,9 @@ ### Relevant Articles: -- [Scheduling in Java EE](http://www.baeldung.com/scheduling-in-java-enterprise-edition) -- [JSON Processing in Java EE 7](http://www.baeldung.com/jee7-json) -- [Converters, Listeners and Validators in Java EE 7](http://www.baeldung.com/java-ee7-converter-listener-validator) -- [Introduction to JAX-WS](http://www.baeldung.com/jax-ws) -- [A Guide to Java EE Web-Related Annotations](http://www.baeldung.com/javaee-web-annotations) -- [Introduction to Testing with Arquillian](http://www.baeldung.com/arquillian) +- [Scheduling in Java EE](https://www.baeldung.com/scheduling-in-java-enterprise-edition) +- [JSON Processing in Java EE 7](https://www.baeldung.com/jee7-json) +- [Converters, Listeners and Validators in Java EE 7](https://www.baeldung.com/java-ee7-converter-listener-validator) +- [Introduction to JAX-WS](https://www.baeldung.com/jax-ws) +- [A Guide to Java EE Web-Related Annotations](https://www.baeldung.com/javaee-web-annotations) +- [Introduction to Testing with Arquillian](https://www.baeldung.com/arquillian) - [Java EE 7 Batch Processing](https://www.baeldung.com/java-ee-7-batch-processing) - [The Difference Between CDI and EJB Singleton](https://www.baeldung.com/jee-cdi-vs-ejb-singleton) diff --git a/jersey/README.md b/jersey/README.md index 126dc542ba..1db89ec723 100644 --- a/jersey/README.md +++ b/jersey/README.md @@ -1,4 +1,4 @@ -- [Jersey Filters and Interceptors](http://www.baeldung.com/jersey-filters-interceptors) +- [Jersey Filters and Interceptors](https://www.baeldung.com/jersey-filters-interceptors) - [Jersey MVC Support](https://www.baeldung.com/jersey-mvc) - [Bean Validation in Jersey](https://www.baeldung.com/jersey-bean-validation) - [Set a Response Body in JAX-RS](https://www.baeldung.com/jax-rs-response) diff --git a/jgit/README.md b/jgit/README.md index 5c65f1101b..d89104293d 100644 --- a/jgit/README.md +++ b/jgit/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [A Guide to JGit](http://www.baeldung.com/jgit) +- [A Guide to JGit](https://www.baeldung.com/jgit) diff --git a/jgroups/README.md b/jgroups/README.md index 0921fa98a1..128007bb7e 100644 --- a/jgroups/README.md +++ b/jgroups/README.md @@ -1,7 +1,7 @@ ## Reliable Messaging with JGroups Tutorial Project ### Relevant Article: -- [Reliable Messaging with JGroups](http://www.baeldung.com/jgroups) +- [Reliable Messaging with JGroups](https://www.baeldung.com/jgroups) ### Overview This Maven project contains the Java code for the article linked above. diff --git a/jjwt/README.md b/jjwt/README.md index ed18363dfc..04a85f3ded 100644 --- a/jjwt/README.md +++ b/jjwt/README.md @@ -45,4 +45,4 @@ Available commands (assumes httpie - https://github.com/jkbrzt/httpie): ## Relevant articles: -- [Supercharge Java Authentication with JSON Web Tokens (JWTs)](http://www.baeldung.com/java-json-web-tokens-jjwt) +- [Supercharge Java Authentication with JSON Web Tokens (JWTs)](https://www.baeldung.com/java-json-web-tokens-jjwt) diff --git a/jmeter/README.md b/jmeter/README.md index e3f9d1a4db..58522067b2 100644 --- a/jmeter/README.md +++ b/jmeter/README.md @@ -42,5 +42,5 @@ Enjoy it :) ### Relevant Articles: -- [Intro to Performance Testing using JMeter](http://www.baeldung.com/jmeter) -- [Configure Jenkins to Run and Show JMeter Tests](http://www.baeldung.com/jenkins-and-jmeter) +- [Intro to Performance Testing using JMeter](https://www.baeldung.com/jmeter) +- [Configure Jenkins to Run and Show JMeter Tests](https://www.baeldung.com/jenkins-and-jmeter) diff --git a/jmh/README.md b/jmh/README.md index 9c5a70e3c2..6876615328 100644 --- a/jmh/README.md +++ b/jmh/README.md @@ -1,4 +1,4 @@ ## Relevant articles: -- [Microbenchmarking with Java](http://www.baeldung.com/java-microbenchmark-harness) +- [Microbenchmarking with Java](https://www.baeldung.com/java-microbenchmark-harness) diff --git a/jni/README.md b/jni/README.md index 663cafb0c0..daaeb7819f 100644 --- a/jni/README.md +++ b/jni/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: -- [Guide to JNI (Java Native Interface)](http://www.baeldung.com/jni) +- [Guide to JNI (Java Native Interface)](https://www.baeldung.com/jni) diff --git a/jooby/README.md b/jooby/README.md index aa867b2c56..bf8c580633 100644 --- a/jooby/README.md +++ b/jooby/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Introduction to Jooby](http://www.baeldung.com/jooby) +- [Introduction to Jooby](https://www.baeldung.com/jooby) diff --git a/jsf/README.md b/jsf/README.md index d96c1eb8e3..65735cc406 100644 --- a/jsf/README.md +++ b/jsf/README.md @@ -1,5 +1,5 @@ ### Relevant Articles: -- [Guide to JSF Expression Language 3.0](http://www.baeldung.com/jsf-expression-language-el-3) -- [Introduction to JSF EL 2](http://www.baeldung.com/intro-to-jsf-expression-language) -- [JavaServer Faces (JSF) with Spring](http://www.baeldung.com/spring-jsf) -- [Introduction to Primefaces](http://www.baeldung.com/jsf-primefaces) +- [Guide to JSF Expression Language 3.0](https://www.baeldung.com/jsf-expression-language-el-3) +- [Introduction to JSF EL 2](https://www.baeldung.com/intro-to-jsf-expression-language) +- [JavaServer Faces (JSF) with Spring](https://www.baeldung.com/spring-jsf) +- [Introduction to Primefaces](https://www.baeldung.com/jsf-primefaces) diff --git a/json-path/README.md b/json-path/README.md index 7a84ea7bde..41cc72a842 100644 --- a/json-path/README.md +++ b/json-path/README.md @@ -1,4 +1,4 @@ ## Relevant articles: -- [Introduction to JsonPath](http://www.baeldung.com/guide-to-jayway-jsonpath) -- [Count with JsonPath](http://www.baeldung.com/jsonpath-count) +- [Introduction to JsonPath](https://www.baeldung.com/guide-to-jayway-jsonpath) +- [Count with JsonPath](https://www.baeldung.com/jsonpath-count) diff --git a/json/README.md b/json/README.md index 7ef4cc9b01..96acedd0b1 100644 --- a/json/README.md +++ b/json/README.md @@ -3,13 +3,13 @@ ## Fast-Json ### Relevant Articles: -- [Introduction to JSON Schema in Java](http://www.baeldung.com/introduction-to-json-schema-in-java) -- [A Guide to FastJson](http://www.baeldung.com/fastjson) -- [Introduction to JSONForms](http://www.baeldung.com/introduction-to-jsonforms) -- [Introduction to JsonPath](http://www.baeldung.com/guide-to-jayway-jsonpath) -- [Introduction to JSON-Java (org.json)](http://www.baeldung.com/java-org-json) +- [Introduction to JSON Schema in Java](https://www.baeldung.com/introduction-to-json-schema-in-java) +- [A Guide to FastJson](https://www.baeldung.com/fastjson) +- [Introduction to JSONForms](https://www.baeldung.com/introduction-to-jsonforms) +- [Introduction to JsonPath](https://www.baeldung.com/guide-to-jayway-jsonpath) +- [Introduction to JSON-Java (org.json)](https://www.baeldung.com/java-org-json) - [Overview of JSON Pointer](https://www.baeldung.com/json-pointer) -- [Introduction to the JSON Binding API (JSR 367) in Java](http://www.baeldung.com/java-json-binding-api) +- [Introduction to the JSON Binding API (JSR 367) in Java](https://www.baeldung.com/java-json-binding-api) - [Get a Value by Key in a JSONArray](https://www.baeldung.com/java-jsonarray-get-value-by-key) - [Iterating Over an Instance of org.json.JSONObject](https://www.baeldung.com/jsonobject-iteration) - [Escape JSON String in Java](https://www.baeldung.com/java-json-escaping) diff --git a/jsoup/README.md b/jsoup/README.md index 8728cc7c4e..7624ce77bf 100644 --- a/jsoup/README.md +++ b/jsoup/README.md @@ -3,7 +3,7 @@ ## jsoup Example Project ### Relevant Articles: -- [Parsing HTML in Java with Jsoup](http://www.baeldung.com/java-with-jsoup) +- [Parsing HTML in Java with Jsoup](https://www.baeldung.com/java-with-jsoup) ### Build the Project diff --git a/jws/README.md b/jws/README.md index 428d8b650d..b939941d22 100644 --- a/jws/README.md +++ b/jws/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [A Guide to the Java Web Start](http://www.baeldung.com/java-web-start) +- [A Guide to the Java Web Start](https://www.baeldung.com/java-web-start) diff --git a/kotlin-js/README.md b/kotlin-js/README.md index 445ad6da9a..84d0c70427 100644 --- a/kotlin-js/README.md +++ b/kotlin-js/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Kotlin and Javascript](http://www.baeldung.com/kotlin-javascript) +- [Kotlin and Javascript](https://www.baeldung.com/kotlin-javascript) diff --git a/kotlin-libraries/README.md b/kotlin-libraries/README.md index 94359193b6..6ad90c1cd2 100644 --- a/kotlin-libraries/README.md +++ b/kotlin-libraries/README.md @@ -1,14 +1,14 @@ ## Relevant articles: -- [Kotlin with Mockito](http://www.baeldung.com/kotlin-mockito) -- [HTTP Requests with Kotlin and khttp](http://www.baeldung.com/kotlin-khttp) -- [Kotlin Dependency Injection with Kodein](http://www.baeldung.com/kotlin-kodein-dependency-injection) -- [Writing Specifications with Kotlin and Spek](http://www.baeldung.com/kotlin-spek) -- [Processing JSON with Kotlin and Klaxson](http://www.baeldung.com/kotlin-json-klaxson) +- [Kotlin with Mockito](https://www.baeldung.com/kotlin-mockito) +- [HTTP Requests with Kotlin and khttp](https://www.baeldung.com/kotlin-khttp) +- [Kotlin Dependency Injection with Kodein](https://www.baeldung.com/kotlin-kodein-dependency-injection) +- [Writing Specifications with Kotlin and Spek](https://www.baeldung.com/kotlin-spek) +- [Processing JSON with Kotlin and Klaxson](https://www.baeldung.com/kotlin-json-klaxson) - [Guide to the Kotlin Exposed Framework](https://www.baeldung.com/kotlin-exposed-persistence) - [Working with Dates in Kotlin](https://www.baeldung.com/kotlin-dates) - [Introduction to Arrow in Kotlin](https://www.baeldung.com/kotlin-arrow) - [Kotlin with Ktor](https://www.baeldung.com/kotlin-ktor) - [REST API With Kotlin and Kovert](https://www.baeldung.com/kotlin-kovert) - [MockK: A Mocking Library for Kotlin](https://www.baeldung.com/kotlin-mockk) -- [Kotlin Immutable Collections](https://www.baeldung.com/kotlin-immutable-collections) \ No newline at end of file +- [Kotlin Immutable Collections](https://www.baeldung.com/kotlin-immutable-collections) diff --git a/lagom/README.md b/lagom/README.md index 909fe0dff4..a8070c047c 100644 --- a/lagom/README.md +++ b/lagom/README.md @@ -1,6 +1,6 @@ ### Relevant articles -- [Guide to Reactive Microservices Using Lagom Framework](http://www.baeldung.com/lagom-reactive-microservices) +- [Guide to Reactive Microservices Using Lagom Framework](https://www.baeldung.com/lagom-reactive-microservices) diff --git a/libraries-apache-commons/README.md b/libraries-apache-commons/README.md index ae424cb6c5..7d1f5b8333 100644 --- a/libraries-apache-commons/README.md +++ b/libraries-apache-commons/README.md @@ -8,4 +8,4 @@ - [Apache Commons Chain](https://www.baeldung.com/apache-commons-chain) - [Apache Commons BeanUtils](https://www.baeldung.com/apache-commons-beanutils) - [Histograms with Apache Commons Frequency](https://www.baeldung.com/apache-commons-frequency) -- [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3) \ No newline at end of file +- [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3) diff --git a/libraries-data-2/README.md b/libraries-data-2/README.md index 8101138c0e..ae113e7f70 100644 --- a/libraries-data-2/README.md +++ b/libraries-data-2/README.md @@ -1,11 +1,11 @@ ### Relevant articles -- [Introduction to Apache Flink with Java](http://www.baeldung.com/apache-flink) -- [Guide to the HyperLogLog Algorithm](http://www.baeldung.com/java-hyperloglog) -- [Introduction to Conflict-Free Replicated Data Types](http://www.baeldung.com/java-conflict-free-replicated-data-types) -- [Introduction to javax.measure](http://www.baeldung.com/javax-measure) -- [Introduction To Docx4J](http://www.baeldung.com/docx4j) -- [Interact with Google Sheets from Java](http://www.baeldung.com/google-sheets-java-client) -- [Introduction To OpenCSV](http://www.baeldung.com/opencsv) -- [Introduction to Smooks](http://www.baeldung.com/smooks) -- [A Guide to Infinispan in Java](http://www.baeldung.com/infinispan) +- [Introduction to Apache Flink with Java](https://www.baeldung.com/apache-flink) +- [Guide to the HyperLogLog Algorithm](https://www.baeldung.com/java-hyperloglog) +- [Introduction to Conflict-Free Replicated Data Types](https://www.baeldung.com/java-conflict-free-replicated-data-types) +- [Introduction to javax.measure](https://www.baeldung.com/javax-measure) +- [Introduction To Docx4J](https://www.baeldung.com/docx4j) +- [Interact with Google Sheets from Java](https://www.baeldung.com/google-sheets-java-client) +- [Introduction To OpenCSV](https://www.baeldung.com/opencsv) +- [Introduction to Smooks](https://www.baeldung.com/smooks) +- [A Guide to Infinispan in Java](https://www.baeldung.com/infinispan) diff --git a/libraries-data-3/README.md b/libraries-data-3/README.md index 7f939e7909..6be6eae4a8 100644 --- a/libraries-data-3/README.md +++ b/libraries-data-3/README.md @@ -1,5 +1,5 @@ ### Relevant articles -- [Parsing YAML with SnakeYAML](http://www.baeldung.com/java-snake-yaml) +- [Parsing YAML with SnakeYAML](https://www.baeldung.com/java-snake-yaml) - [Guide to JMapper](https://www.baeldung.com/jmapper) - [An Introduction to SuanShu](https://www.baeldung.com/suanshu) - [Intro to Derive4J](https://www.baeldung.com/derive4j) diff --git a/libraries-data/README.md b/libraries-data/README.md index c7eb028b4c..e1d3c40222 100644 --- a/libraries-data/README.md +++ b/libraries-data/README.md @@ -1,14 +1,14 @@ ### Relevant articles -- [Introduction to Reladomo](http://www.baeldung.com/reladomo) -- [Introduction to ORMLite](http://www.baeldung.com/ormlite) -- [Introduction To Kryo](http://www.baeldung.com/kryo) -- [Introduction to KafkaStreams in Java](http://www.baeldung.com/java-kafka-streams) -- [Guide to Java Data Objects](http://www.baeldung.com/jdo) -- [Intro to JDO Queries 2/2](http://www.baeldung.com/jdo-queries) -- [Introduction to HikariCP](http://www.baeldung.com/hikaricp) -- [Introduction to JCache](http://www.baeldung.com/jcache) -- [A Guide to Apache Ignite](http://www.baeldung.com/apache-ignite) -- [Apache Ignite with Spring Data](http://www.baeldung.com/apache-ignite-spring-data) +- [Introduction to Reladomo](https://www.baeldung.com/reladomo) +- [Introduction to ORMLite](https://www.baeldung.com/ormlite) +- [Introduction To Kryo](https://www.baeldung.com/kryo) +- [Introduction to KafkaStreams in Java](https://www.baeldung.com/java-kafka-streams) +- [Guide to Java Data Objects](https://www.baeldung.com/jdo) +- [Intro to JDO Queries 2/2](https://www.baeldung.com/jdo-queries) +- [Introduction to HikariCP](https://www.baeldung.com/hikaricp) +- [Introduction to JCache](https://www.baeldung.com/jcache) +- [A Guide to Apache Ignite](https://www.baeldung.com/apache-ignite) +- [Apache Ignite with Spring Data](https://www.baeldung.com/apache-ignite-spring-data) - [A Guide to Apache Crunch](https://www.baeldung.com/apache-crunch) - [Intro to Apache Storm](https://www.baeldung.com/apache-storm) - [Guide to Ebean ORM](https://www.baeldung.com/ebean-orm) diff --git a/libraries-http/README.md b/libraries-http/README.md index d5eaed0736..436268e707 100644 --- a/libraries-http/README.md +++ b/libraries-http/README.md @@ -1,11 +1,11 @@ ### Relevant Articles: -- [A Guide to OkHttp](http://www.baeldung.com/guide-to-okhttp) -- [A Guide to Google-Http-Client](http://www.baeldung.com/google-http-client) -- [Asynchronous HTTP with async-http-client in Java](http://www.baeldung.com/async-http-client) -- [WebSockets with AsyncHttpClient](http://www.baeldung.com/async-http-client-websockets) -- [Integrating Retrofit with RxJava](http://www.baeldung.com/retrofit-rxjava) -- [Introduction to Retrofit](http://www.baeldung.com/retrofit) -- [A Guide to Unirest](http://www.baeldung.com/unirest) -- [Creating REST Microservices with Javalin](http://www.baeldung.com/javalin-rest-microservices) \ No newline at end of file +- [A Guide to OkHttp](https://www.baeldung.com/guide-to-okhttp) +- [A Guide to Google-Http-Client](https://www.baeldung.com/google-http-client) +- [Asynchronous HTTP with async-http-client in Java](https://www.baeldung.com/async-http-client) +- [WebSockets with AsyncHttpClient](https://www.baeldung.com/async-http-client-websockets) +- [Integrating Retrofit with RxJava](https://www.baeldung.com/retrofit-rxjava) +- [Introduction to Retrofit](https://www.baeldung.com/retrofit) +- [A Guide to Unirest](https://www.baeldung.com/unirest) +- [Creating REST Microservices with Javalin](https://www.baeldung.com/javalin-rest-microservices) diff --git a/libraries-server/README.md b/libraries-server/README.md index b5392f5883..5245b98139 100644 --- a/libraries-server/README.md +++ b/libraries-server/README.md @@ -1,11 +1,11 @@ ## 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) -- [Programmatically 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) +- [Embedded Jetty Server in Java](https://www.baeldung.com/jetty-embedded) +- [Introduction to Netty](https://www.baeldung.com/netty) +- [Exceptions in Netty](https://www.baeldung.com/netty-exception-handling) +- [Programmatically Create, Configure and Run a Tomcat Server](https://www.baeldung.com/tomcat-programmatic-setup) +- [Creating and Configuring Jetty 9 Server in Java](https://www.baeldung.com/jetty-java-programmatic) +- [Testing Netty with EmbeddedChannel](https://www.baeldung.com/testing-netty-embedded-channel) - [MQTT Client in Java](https://www.baeldung.com/java-mqtt-client) - [Guide to XMPP Smack Client](https://www.baeldung.com/xmpp-smack-chat-client) - [A Guide to NanoHTTPD](https://www.baeldung.com/nanohttpd) diff --git a/libraries-testing/README.md b/libraries-testing/README.md index fb2c7123a3..3f1904dc50 100644 --- a/libraries-testing/README.md +++ b/libraries-testing/README.md @@ -1,9 +1,9 @@ ### Relevant articles -- [Introduction to Serenity BDD](http://www.baeldung.com/serenity-bdd) -- [Introduction to JSONassert](http://www.baeldung.com/jsonassert) -- [Serenity BDD and Screenplay](http://www.baeldung.com/serenity-screenplay) -- [Serenity BDD with Spring and JBehave](http://www.baeldung.com/serenity-spring-jbehave) -- [Introduction to Awaitlity](http://www.baeldung.com/awaitlity-testing) -- [Introduction to Hoverfly in Java](http://www.baeldung.com/hoverfly) -- [Testing with Hamcrest](http://www.baeldung.com/java-junit-hamcrest-guide) \ No newline at end of file +- [Introduction to Serenity BDD](https://www.baeldung.com/serenity-bdd) +- [Introduction to JSONassert](https://www.baeldung.com/jsonassert) +- [Serenity BDD and Screenplay](https://www.baeldung.com/serenity-screenplay) +- [Serenity BDD with Spring and JBehave](https://www.baeldung.com/serenity-spring-jbehave) +- [Introduction to Awaitlity](https://www.baeldung.com/awaitlity-testing) +- [Introduction to Hoverfly in Java](https://www.baeldung.com/hoverfly) +- [Testing with Hamcrest](https://www.baeldung.com/java-junit-hamcrest-guide) diff --git a/libraries/README.md b/libraries/README.md index ebf087ccd8..c15e0d8fb8 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -1,40 +1,40 @@ ### Relevant articles -- [Introduction to Javatuples](http://www.baeldung.com/java-tuples) -- [Introduction to Javassist](http://www.baeldung.com/javassist) -- [Introduction to Apache Flink with Java](http://www.baeldung.com/apache-flink) -- [Intro to JaVers](http://www.baeldung.com/javers) -- [Merging Streams in Java](http://www.baeldung.com/java-merge-streams) -- [Introduction to Quartz](http://www.baeldung.com/quartz) -- [How to Warm Up the JVM](http://www.baeldung.com/java-jvm-warmup) -- [Software Transactional Memory in Java Using Multiverse](http://www.baeldung.com/java-multiverse-stm) -- [Locality-Sensitive Hashing in Java Using Java-LSH](http://www.baeldung.com/locality-sensitive-hashing) -- [Introduction to Neuroph](http://www.baeldung.com/neuroph) -- [Quick Guide to RSS with Rome](http://www.baeldung.com/rome-rss) -- [Introduction to PCollections](http://www.baeldung.com/java-pcollections) -- [Introduction to Eclipse Collections](http://www.baeldung.com/eclipse-collections) -- [DistinctBy in the Java Stream API](http://www.baeldung.com/java-streams-distinct-by) -- [Introduction to NoException](http://www.baeldung.com/no-exception) -- [Spring Yarg Integration](http://www.baeldung.com/spring-yarg) -- [Delete a Directory Recursively in Java](http://www.baeldung.com/java-delete-directory) -- [Guide to JDeferred](http://www.baeldung.com/jdeferred) -- [Introduction to MBassador](http://www.baeldung.com/mbassador) -- [Using Pairs in Java](http://www.baeldung.com/java-pairs) -- [Introduction to Caffeine](http://www.baeldung.com/java-caching-caffeine) -- [Introduction to StreamEx](http://www.baeldung.com/streamex) -- [A Docker Guide for Java](http://www.baeldung.com/docker-java-api) -- [Introduction to Akka Actors in Java](http://www.baeldung.com/akka-actors-java) -- [A Guide to Byte Buddy](http://www.baeldung.com/byte-buddy) -- [Introduction to jOOL](http://www.baeldung.com/jool) -- [Consumer Driven Contracts with Pact](http://www.baeldung.com/pact-junit-consumer-driven-contracts) -- [Introduction to Atlassian Fugue](http://www.baeldung.com/java-fugue) -- [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) -- [Introduction to JavaPoet](http://www.baeldung.com/java-poet) -- [Convert String to Date in Java](http://www.baeldung.com/java-string-to-date) -- [Guide to Resilience4j](http://www.baeldung.com/resilience4j) +- [Introduction to Javatuples](https://www.baeldung.com/java-tuples) +- [Introduction to Javassist](https://www.baeldung.com/javassist) +- [Introduction to Apache Flink with Java](https://www.baeldung.com/apache-flink) +- [Intro to JaVers](https://www.baeldung.com/javers) +- [Merging Streams in Java](https://www.baeldung.com/java-merge-streams) +- [Introduction to Quartz](https://www.baeldung.com/quartz) +- [How to Warm Up the JVM](https://www.baeldung.com/java-jvm-warmup) +- [Software Transactional Memory in Java Using Multiverse](https://www.baeldung.com/java-multiverse-stm) +- [Locality-Sensitive Hashing in Java Using Java-LSH](https://www.baeldung.com/locality-sensitive-hashing) +- [Introduction to Neuroph](https://www.baeldung.com/neuroph) +- [Quick Guide to RSS with Rome](https://www.baeldung.com/rome-rss) +- [Introduction to PCollections](https://www.baeldung.com/java-pcollections) +- [Introduction to Eclipse Collections](https://www.baeldung.com/eclipse-collections) +- [DistinctBy in the Java Stream API](https://www.baeldung.com/java-streams-distinct-by) +- [Introduction to NoException](https://www.baeldung.com/no-exception) +- [Spring Yarg Integration](https://www.baeldung.com/spring-yarg) +- [Delete a Directory Recursively in Java](https://www.baeldung.com/java-delete-directory) +- [Guide to JDeferred](https://www.baeldung.com/jdeferred) +- [Introduction to MBassador](https://www.baeldung.com/mbassador) +- [Using Pairs in Java](https://www.baeldung.com/java-pairs) +- [Introduction to Caffeine](https://www.baeldung.com/java-caching-caffeine) +- [Introduction to StreamEx](https://www.baeldung.com/streamex) +- [A Docker Guide for Java](https://www.baeldung.com/docker-java-api) +- [Introduction to Akka Actors in Java](https://www.baeldung.com/akka-actors-java) +- [A Guide to Byte Buddy](https://www.baeldung.com/byte-buddy) +- [Introduction to jOOL](https://www.baeldung.com/jool) +- [Consumer Driven Contracts with Pact](https://www.baeldung.com/pact-junit-consumer-driven-contracts) +- [Introduction to Atlassian Fugue](https://www.baeldung.com/java-fugue) +- [Publish and Receive Messages with Nats Java Client](https://www.baeldung.com/nats-java-client) +- [Java Concurrency Utility with JCTools](https://www.baeldung.com/java-concurrency-jc-tools) +- [Introduction to JavaPoet](https://www.baeldung.com/java-poet) +- [Convert String to Date in Java](https://www.baeldung.com/java-string-to-date) +- [Guide to Resilience4j](https://www.baeldung.com/resilience4j) - [Exactly Once Processing in Kafka](https://www.baeldung.com/kafka-exactly-once) -- [Implementing a FTP-Client in Java](http://www.baeldung.com/java-ftp-client) +- [Implementing a FTP-Client in Java](https://www.baeldung.com/java-ftp-client) - [Introduction to Functional Java](https://www.baeldung.com/java-functional-library) - [A Guide to the Reflections Library](https://www.baeldung.com/reflections-library) diff --git a/linkrest/README.md b/linkrest/README.md index 33cf930b18..8297b14bb5 100644 --- a/linkrest/README.md +++ b/linkrest/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [Guide to LinkRest](http://www.baeldung.com/linkrest) +- [Guide to LinkRest](https://www.baeldung.com/linkrest) diff --git a/logging-modules/README.md b/logging-modules/README.md index 17405847b1..f5a1acaac1 100644 --- a/logging-modules/README.md +++ b/logging-modules/README.md @@ -3,5 +3,5 @@ ### Relevant Articles: -- [Creating a Custom Logback Appender](http://www.baeldung.com/custom-logback-appender) -- [A Guide To Logback](http://www.baeldung.com/logback) +- [Creating a Custom Logback Appender](https://www.baeldung.com/custom-logback-appender) +- [A Guide To Logback](https://www.baeldung.com/logback) diff --git a/lombok/README.md b/lombok/README.md index 4ff7ca7921..54a0984159 100644 --- a/lombok/README.md +++ b/lombok/README.md @@ -1,6 +1,6 @@ ## Relevant Articles: -- [Introduction to Project Lombok](http://www.baeldung.com/intro-to-project-lombok) -- [Using Lombok’s @Builder Annotation](http://www.baeldung.com/lombok-builder) +- [Introduction to Project Lombok](https://www.baeldung.com/intro-to-project-lombok) +- [Using Lombok’s @Builder Annotation](https://www.baeldung.com/lombok-builder) - [Using Lombok’s @Getter for Boolean Fields](https://www.baeldung.com/lombok-getter-boolean) - [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance) - [Lombok Builder with Default Value](https://www.baeldung.com/lombok-builder-default-value) diff --git a/lucene/README.md b/lucene/README.md index ea7f715480..2bfd8bf4e1 100644 --- a/lucene/README.md +++ b/lucene/README.md @@ -1,5 +1,5 @@ ### Relevant Articles: -- [Introduction to Apache Lucene](http://www.baeldung.com/lucene) -- [A Simple File Search with Lucene](http://www.baeldung.com/lucene-file-search) +- [Introduction to Apache Lucene](https://www.baeldung.com/lucene) +- [A Simple File Search with Lucene](https://www.baeldung.com/lucene-file-search) - [Guide to Lucene Analyzers](https://www.baeldung.com/lucene-analyzers) diff --git a/mapstruct/README.md b/mapstruct/README.md index e279a48f7a..92c55a131d 100644 --- a/mapstruct/README.md +++ b/mapstruct/README.md @@ -1,2 +1,2 @@ ###Relevant Articles: -- [Quick Guide to MapStruct](http://www.baeldung.com/mapstruct) +- [Quick Guide to MapStruct](https://www.baeldung.com/mapstruct) diff --git a/maven-all/maven/README.md b/maven-all/maven/README.md index abe7fc4a80..acf7dfc47b 100644 --- a/maven-all/maven/README.md +++ b/maven-all/maven/README.md @@ -1,13 +1,13 @@ ### Relevant Articles -- [Guide to the Core Maven Plugins](http://www.baeldung.com/core-maven-plugins) -- [Maven Resources Plugin](http://www.baeldung.com/maven-resources-plugin) -- [Maven Compiler Plugin](http://www.baeldung.com/maven-compiler-plugin) -- [Quick Guide to the Maven Surefire Plugin](http://www.baeldung.com/maven-surefire-plugin) -- [The Maven Failsafe Plugin](http://www.baeldung.com/maven-failsafe-plugin) -- [The Maven Verifier Plugin](http://www.baeldung.com/maven-verifier-plugin) -- [The Maven Clean Plugin](http://www.baeldung.com/maven-clean-plugin) -- [Build a Jar with Maven and Ignore the Test Results](http://www.baeldung.com/maven-ignore-test-results) +- [Guide to the Core Maven Plugins](https://www.baeldung.com/core-maven-plugins) +- [Maven Resources Plugin](https://www.baeldung.com/maven-resources-plugin) +- [Maven Compiler Plugin](https://www.baeldung.com/maven-compiler-plugin) +- [Quick Guide to the Maven Surefire Plugin](https://www.baeldung.com/maven-surefire-plugin) +- [The Maven Failsafe Plugin](https://www.baeldung.com/maven-failsafe-plugin) +- [The Maven Verifier Plugin](https://www.baeldung.com/maven-verifier-plugin) +- [The Maven Clean Plugin](https://www.baeldung.com/maven-clean-plugin) +- [Build a Jar with Maven and Ignore the Test Results](https://www.baeldung.com/maven-ignore-test-results) - [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories) - [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test) - [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) diff --git a/maven-archetype/README.md b/maven-archetype/README.md index 71821e3348..b707150854 100644 --- a/maven-archetype/README.md +++ b/maven-archetype/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: ================================ -- [Guide to Maven Archetype](http://www.baeldung.com/maven-archetype) +- [Guide to Maven Archetype](https://www.baeldung.com/maven-archetype) diff --git a/mesos-marathon/README.md b/mesos-marathon/README.md index 1d4d4995a8..09467ebfcb 100644 --- a/mesos-marathon/README.md +++ b/mesos-marathon/README.md @@ -1,5 +1,5 @@ ### Relevant articles -- [Simple Jenkins Pipeline with Marathon and Mesos](http://www.baeldung.com/jenkins-pipeline-with-marathon-mesos) +- [Simple Jenkins Pipeline with Marathon and Mesos](https://www.baeldung.com/jenkins-pipeline-with-marathon-mesos) To run the pipeline, please modify the dockerise.sh file with your own useranema and password for docker login. diff --git a/metrics/README.md b/metrics/README.md index c7772bffa0..d344a2707f 100644 --- a/metrics/README.md +++ b/metrics/README.md @@ -1,5 +1,5 @@ ## Relevant articles: -- [Intro to Dropwizard Metrics](http://www.baeldung.com/dropwizard-metrics) -- [Introduction to Netflix Servo](http://www.baeldung.com/netflix-servo) -- [Quick Guide to Micrometer](http://www.baeldung.com/micrometer) +- [Intro to Dropwizard Metrics](https://www.baeldung.com/dropwizard-metrics) +- [Introduction to Netflix Servo](https://www.baeldung.com/netflix-servo) +- [Quick Guide to Micrometer](https://www.baeldung.com/micrometer) diff --git a/micronaut/README.md b/micronaut/README.md index 10a68ff2f8..0a39cf9e33 100644 --- a/micronaut/README.md +++ b/micronaut/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Introduction to Micronaut Framework](http://www.baeldung.com/micronaut) +- [Introduction to Micronaut Framework](https://www.baeldung.com/micronaut) diff --git a/microprofile/README.md b/microprofile/README.md index 1a28487e89..7525ee5bff 100644 --- a/microprofile/README.md +++ b/microprofile/README.md @@ -1,3 +1,3 @@ ### Relevant articles: -- [Building Microservices with Eclipse MicroProfile](http://www.baeldung.com/eclipse-microprofile) +- [Building Microservices with Eclipse MicroProfile](https://www.baeldung.com/eclipse-microprofile) diff --git a/ml/README.md b/ml/README.md index f4712a94da..1362f2840c 100644 --- a/ml/README.md +++ b/ml/README.md @@ -2,4 +2,4 @@ This is a soft introduction to ML using [deeplearning4j](https://deeplearning4j.org) library ### Relevant Articles: -- [Logistic Regression in Java](http://www.baeldung.com/) +- [Logistic Regression in Java](https://www.baeldung.com/) diff --git a/msf4j/README.md b/msf4j/README.md index 7c66b8dc5f..b7f2c5a546 100644 --- a/msf4j/README.md +++ b/msf4j/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Introduction to Java Microservices with MSF4J](http://www.baeldung.com/msf4j) +- [Introduction to Java Microservices with MSF4J](https://www.baeldung.com/msf4j) diff --git a/muleesb/README.md b/muleesb/README.md index 8da4e595e3..555a10b5cc 100644 --- a/muleesb/README.md +++ b/muleesb/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Getting Started With Mule ESB](http://www.baeldung.com/mule-esb) +- [Getting Started With Mule ESB](https://www.baeldung.com/mule-esb) diff --git a/mustache/README.md b/mustache/README.md index fa41eb4f4d..c36080b56f 100644 --- a/mustache/README.md +++ b/mustache/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Introduction to Mustache](http://www.baeldung.com/mustache) -- [Guide to Mustache with Spring Boot](http://www.baeldung.com/spring-boot-mustache) +- [Introduction to Mustache](https://www.baeldung.com/mustache) +- [Guide to Mustache with Spring Boot](https://www.baeldung.com/spring-boot-mustache) diff --git a/mybatis/README.md b/mybatis/README.md index 7c366aeab6..57687d3da1 100644 --- a/mybatis/README.md +++ b/mybatis/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Quick Guide to MyBatis](http://www.baeldung.com/mybatis) +- [Quick Guide to MyBatis](https://www.baeldung.com/mybatis) diff --git a/orika/README.md b/orika/README.md index 4ed033c170..0096793507 100644 --- a/orika/README.md +++ b/orika/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Mapping with Orika](http://www.baeldung.com/orika-mapping) +- [Mapping with Orika](https://www.baeldung.com/orika-mapping) diff --git a/osgi/readme.md b/osgi/readme.md index e380ae06c3..ee5d7d66c4 100644 --- a/osgi/readme.md +++ b/osgi/readme.md @@ -87,7 +87,7 @@ org.eclipse.osgi_3.12.1.v20170821-1548.jar = = NOT GOOD = = ## Relevant articles: - - [Introduction to OSGi](http://www.baeldung.com/osgi) + - [Introduction to OSGi](https://www.baeldung.com/osgi) diff --git a/pdf/README.md b/pdf/README.md index 5454d2b2de..8525dc4f69 100644 --- a/pdf/README.md +++ b/pdf/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [PDF Conversions in Java](http://www.baeldung.com/pdf-conversions-java) -- [Creating PDF Files in Java](http://www.baeldung.com/java-pdf-creation) +- [PDF Conversions in Java](https://www.baeldung.com/pdf-conversions-java) +- [Creating PDF Files in Java](https://www.baeldung.com/java-pdf-creation) diff --git a/performance-tests/README.md b/performance-tests/README.md index 0064157966..918c81bb69 100644 --- a/performance-tests/README.md +++ b/performance-tests/README.md @@ -1,10 +1,10 @@ ### Relevant Articles: -- [Performance of Java Mapping Frameworks](http://www.baeldung.com/java-performance-mapping-frameworks) +- [Performance of Java Mapping Frameworks](https://www.baeldung.com/java-performance-mapping-frameworks) ### Running To run the performance benchmarks: 1: `mvn clean install` -2: `java -jar target/benchmarks.jar` \ No newline at end of file +2: `java -jar target/benchmarks.jar` diff --git a/play-framework/README.md b/play-framework/README.md index 0fd13fba27..2309b67422 100644 --- a/play-framework/README.md +++ b/play-framework/README.md @@ -1,4 +1,4 @@ ###Relevant Articles: -- [REST API with Play Framework in Java](http://www.baeldung.com/rest-api-with-play) -- [Routing In Play Applications in Java](http://www.baeldung.com/routing-in-play) -- [Introduction To Play In Java](http://www.baeldung.com/java-intro-to-the-play-framework) +- [REST API with Play Framework in Java](https://www.baeldung.com/rest-api-with-play) +- [Routing In Play Applications in Java](https://www.baeldung.com/routing-in-play) +- [Introduction To Play In Java](https://www.baeldung.com/java-intro-to-the-play-framework) diff --git a/protobuffer/README.md b/protobuffer/README.md index 4dcdb3cf52..4302418a8b 100644 --- a/protobuffer/README.md +++ b/protobuffer/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [Introduction to Google Protocol Buffer](http://www.baeldung.com/google-protocol-buffer) +- [Introduction to Google Protocol Buffer](https://www.baeldung.com/google-protocol-buffer) diff --git a/rabbitmq/README.md b/rabbitmq/README.md index 11300b047f..01e51bd784 100644 --- a/rabbitmq/README.md +++ b/rabbitmq/README.md @@ -1,3 +1,3 @@ ### Relevant articles -- [Introduction to RabbitMQ](http://www.baeldung.com/rabbitmq) +- [Introduction to RabbitMQ](https://www.baeldung.com/rabbitmq) diff --git a/raml/README.MD b/raml/README.MD index 2a87b46021..fcf0b41a18 100644 --- a/raml/README.MD +++ b/raml/README.MD @@ -1,2 +1,2 @@ ###The Course -The "REST With Spring" Classes: http://bit.ly/restwithspring +The "REST With Spring" Classes: https://bit.ly/restwithspring diff --git a/ratpack/README.md b/ratpack/README.md index 78e2f8ccfc..706fd0c8c3 100644 --- a/ratpack/README.md +++ b/ratpack/README.md @@ -1,9 +1,9 @@ ### Relevant articles -- [Introduction to Ratpack](http://www.baeldung.com/ratpack) -- [Ratpack Google Guice Integration](http://www.baeldung.com/ratpack-google-guice) +- [Introduction to Ratpack](https://www.baeldung.com/ratpack) +- [Ratpack Google Guice Integration](https://www.baeldung.com/ratpack-google-guice) - [Ratpack Integration with Spring Boot](http://www.baeldung.com/ratpack-spring-boot) -- [Ratpack with Hystrix](http://www.baeldung.com/ratpack-hystrix) +- [Ratpack with Hystrix](https://www.baeldung.com/ratpack-hystrix) - [Ratpack HTTP Client](https://www.baeldung.com/ratpack-http-client) - [Ratpack with RxJava](https://www.baeldung.com/ratpack-rxjava) - [Ratpack with Groovy](https://www.baeldung.com/ratpack-groovy) diff --git a/reactor-core/README.md b/reactor-core/README.md index 5f9d2d1bc2..ba5b355d02 100644 --- a/reactor-core/README.md +++ b/reactor-core/README.md @@ -1,5 +1,5 @@ ### Relevant articles -- [Intro To Reactor Core](http://www.baeldung.com/reactor-core) -- [Combining Publishers in Project Reactor](http://www.baeldung.com/reactor-combine-streams) +- [Intro To Reactor Core](https://www.baeldung.com/reactor-core) +- [Combining Publishers in Project Reactor](https://www.baeldung.com/reactor-combine-streams) - [Programmatically Creating Sequences with Project Reactor](https://www.baeldung.com/flux-sequences-reactor) diff --git a/resteasy/README.md b/resteasy/README.md index 83051037d2..3f3c833256 100644 --- a/resteasy/README.md +++ b/resteasy/README.md @@ -4,6 +4,6 @@ ### Relevant Articles: -- [A Guide to RESTEasy](http://www.baeldung.com/resteasy-tutorial) -- [RESTEasy Client API](http://www.baeldung.com/resteasy-client-tutorial) -- [CORS in JAX-RS](http://www.baeldung.com/cors-in-jax-rs) +- [A Guide to RESTEasy](https://www.baeldung.com/resteasy-tutorial) +- [RESTEasy Client API](https://www.baeldung.com/resteasy-client-tutorial) +- [CORS in JAX-RS](https://www.baeldung.com/cors-in-jax-rs) diff --git a/rule-engines/README.md b/rule-engines/README.md index 6d3c0e93b4..37d419daf5 100644 --- a/rule-engines/README.md +++ b/rule-engines/README.md @@ -1,3 +1,3 @@ ## Relevant articles: -- [List of Rules Engines in Java](http://www.baeldung.com/java-rule-engines) +- [List of Rules Engines in Java](https://www.baeldung.com/java-rule-engines) diff --git a/rxjava-2/README.md b/rxjava-2/README.md index 4182f3fa00..43c1a9942b 100644 --- a/rxjava-2/README.md +++ b/rxjava-2/README.md @@ -1,9 +1,9 @@ ## Relevant articles: -- [RxJava and Error Handling](http://www.baeldung.com/rxjava-error-handling) -- [RxJava 2 – Flowable](http://www.baeldung.com/rxjava-2-flowable) -- [RxJava Maybe](http://www.baeldung.com/rxjava-maybe) -- [Introduction to RxRelay for RxJava](http://www.baeldung.com/rx-relay) +- [RxJava and Error Handling](https://www.baeldung.com/rxjava-error-handling) +- [RxJava 2 – Flowable](https://www.baeldung.com/rxjava-2-flowable) +- [RxJava Maybe](https://www.baeldung.com/rxjava-maybe) +- [Introduction to RxRelay for RxJava](https://www.baeldung.com/rx-relay) - [Combining RxJava Completables](https://www.baeldung.com/rxjava-completable) - [Converting Synchronous and Asynchronous APIs to Observables using RxJava2](https://www.baeldung.com/rxjava-apis-to-observables) - [RxJava Hooks](https://www.baeldung.com/rxjava-hooks) diff --git a/rxjava/README.md b/rxjava/README.md index f8a4ca1dbe..f9b7e2ba0d 100644 --- a/rxjava/README.md +++ b/rxjava/README.md @@ -1,15 +1,15 @@ ## Relevant articles: -- [Dealing with Backpressure with RxJava](http://www.baeldung.com/rxjava-backpressure) -- [How to Test RxJava?](http://www.baeldung.com/rxjava-testing) -- [Implementing Custom Operators in RxJava](http://www.baeldung.com/rxjava-custom-operators) -- [Introduction to RxJava](http://www.baeldung.com/rx-java) -- [Observable Utility Operators in RxJava](http://www.baeldung.com/rxjava-observable-operators) -- [Introduction to rxjava-jdbc](http://www.baeldung.com/rxjava-jdbc) -- [Schedulers in RxJava](http://www.baeldung.com/rxjava-schedulers) -- [Mathematical and Aggregate Operators in RxJava](http://www.baeldung.com/rxjava-math) -- [Combining Observables in RxJava](http://www.baeldung.com/rxjava-combine-observables) -- [RxJava StringObservable](http://www.baeldung.com/rxjava-string) -- [Filtering Observables in RxJava](http://www.baeldung.com/rxjava-filtering) -- [RxJava One Observable, Multiple Subscribers](http://www.baeldung.com/rxjava-multiple-subscribers-observable) +- [Dealing with Backpressure with RxJava](https://www.baeldung.com/rxjava-backpressure) +- [How to Test RxJava?](https://www.baeldung.com/rxjava-testing) +- [Implementing Custom Operators in RxJava](https://www.baeldung.com/rxjava-custom-operators) +- [Introduction to RxJava](https://www.baeldung.com/rx-java) +- [Observable Utility Operators in RxJava](https://www.baeldung.com/rxjava-observable-operators) +- [Introduction to rxjava-jdbc](https://www.baeldung.com/rxjava-jdbc) +- [Schedulers in RxJava](https://www.baeldung.com/rxjava-schedulers) +- [Mathematical and Aggregate Operators in RxJava](https://www.baeldung.com/rxjava-math) +- [Combining Observables in RxJava](https://www.baeldung.com/rxjava-combine-observables) +- [RxJava StringObservable](https://www.baeldung.com/rxjava-string) +- [Filtering Observables in RxJava](https://www.baeldung.com/rxjava-filtering) +- [RxJava One Observable, Multiple Subscribers](https://www.baeldung.com/rxjava-multiple-subscribers-observable) - [Difference Between Flatmap and Switchmap in RxJava](https://www.baeldung.com/rxjava-flatmap-switchmap) diff --git a/saas/README.md b/saas/README.md index f537c7ff95..4effb2afa9 100644 --- a/saas/README.md +++ b/saas/README.md @@ -4,4 +4,4 @@ This module contains articles about software as a service (SAAS) ## Relevant articles: -- [JIRA REST API Integration](http://www.baeldung.com/jira-rest-api) +- [JIRA REST API Integration](https://www.baeldung.com/jira-rest-api) diff --git a/spark-java/README.md b/spark-java/README.md index 3f16b29b9f..b3ef62e631 100644 --- a/spark-java/README.md +++ b/spark-java/README.md @@ -3,4 +3,4 @@ This module contains articles about Spark ### Relevant Articles -- [Building an API With the Spark Java Framework](http://www.baeldung.com/spark-framework-rest-api) +- [Building an API With the Spark Java Framework](https://www.baeldung.com/spark-framework-rest-api) diff --git a/spring-4/README.md b/spring-4/README.md index 5bc38d4a9d..d44eed915e 100644 --- a/spring-4/README.md +++ b/spring-4/README.md @@ -3,6 +3,6 @@ This module contains articles about Spring 4 ### Relevant Articles: -- [A Guide to Flips for Spring](http://www.baeldung.com/flips-spring) +- [A Guide to Flips for Spring](https://www.baeldung.com/flips-spring) - [Configuring a Hikari Connection Pool with Spring Boot](https://www.baeldung.com/spring-boot-hikari) -- [Spring JSON-P with Jackson](http://www.baeldung.com/spring-jackson-jsonp) +- [Spring JSON-P with Jackson](https://www.baeldung.com/spring-jackson-jsonp) diff --git a/spring-5-data-reactive/README.md b/spring-5-data-reactive/README.md index 982704e11c..683b493317 100644 --- a/spring-5-data-reactive/README.md +++ b/spring-5-data-reactive/README.md @@ -6,7 +6,7 @@ This module contains articles about reactive Spring 5 Data The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles -- [Reactive Flow with MongoDB, Kotlin, and Spring WebFlux](http://www.baeldung.com/kotlin-mongodb-spring-webflux) -- [Spring Data Reactive Repositories with MongoDB](http://www.baeldung.com/spring-data-mongodb-reactive) +- [Reactive Flow with MongoDB, Kotlin, and Spring WebFlux](https://www.baeldung.com/kotlin-mongodb-spring-webflux) +- [Spring Data Reactive Repositories with MongoDB](https://www.baeldung.com/spring-data-mongodb-reactive) - [Spring Data MongoDB Tailable Cursors](https://www.baeldung.com/spring-data-mongodb-tailable-cursors) - [A Quick Look at R2DBC with Spring Data](https://www.baeldung.com/spring-data-r2dbc) diff --git a/spring-5-mvc/README.md b/spring-5-mvc/README.md index d3216187f9..e98012c047 100644 --- a/spring-5-mvc/README.md +++ b/spring-5-mvc/README.md @@ -3,6 +3,6 @@ This module contains articles about Spring 5 model-view-controller (MVC) pattern ### Relevant Articles: -- [Spring Boot and Kotlin](http://www.baeldung.com/spring-boot-kotlin) +- [Spring Boot and Kotlin](https://www.baeldung.com/spring-boot-kotlin) - [Spring MVC Streaming and SSE Request Processing](https://www.baeldung.com/spring-mvc-sse-streams) - [Interface Driven Controllers in Spring](https://www.baeldung.com/spring-interface-driven-controllers) diff --git a/spring-5-reactive-security/README.md b/spring-5-reactive-security/README.md index ebb107645b..4ea6fb644f 100644 --- a/spring-5-reactive-security/README.md +++ b/spring-5-reactive-security/README.md @@ -7,7 +7,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles -- [Spring Boot Actuator](http://www.baeldung.com/spring-boot-actuators) -- [Spring Security 5 for Reactive Applications](http://www.baeldung.com/spring-security-5-reactive) -- [Guide to Spring 5 WebFlux](http://www.baeldung.com/spring-webflux) +- [Spring Boot Actuator](https://www.baeldung.com/spring-boot-actuators) +- [Spring Security 5 for Reactive Applications](https://www.baeldung.com/spring-security-5-reactive) +- [Guide to Spring 5 WebFlux](https://www.baeldung.com/spring-webflux) - [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web) diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 89ff4fea9f..2bef8ee6d4 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -7,14 +7,14 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles -- [Introduction to the Functional Web Framework in Spring 5](http://www.baeldung.com/spring-5-functional-web) -- [Spring 5 WebClient](http://www.baeldung.com/spring-5-webclient) -- [Exploring the Spring 5 WebFlux URL Matching](http://www.baeldung.com/spring-5-mvc-url-matching) -- [Reactive WebSockets with Spring 5](http://www.baeldung.com/spring-5-reactive-websockets) -- [Spring Webflux Filters](http://www.baeldung.com/spring-webflux-filters) -- [How to Set a Header on a Response with Spring 5](http://www.baeldung.com/spring-response-header) -- [Spring Webflux and CORS](http://www.baeldung.com/spring-webflux-cors) -- [Handling Errors in Spring WebFlux](http://www.baeldung.com/spring-webflux-errors) +- [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web) +- [Spring 5 WebClient](https://www.baeldung.com/spring-5-webclient) +- [Exploring the Spring 5 WebFlux URL Matching](https://www.baeldung.com/spring-5-mvc-url-matching) +- [Reactive WebSockets with Spring 5](https://www.baeldung.com/spring-5-reactive-websockets) +- [Spring Webflux Filters](httpss://www.baeldung.com/spring-webflux-filters) +- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) +- [Spring Webflux and CORS](https://www.baeldung.com/spring-webflux-cors) +- [Handling Errors in Spring WebFlux](https://www.baeldung.com/spring-webflux-errors) - [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) - [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation) @@ -22,4 +22,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Testing Reactive Streams Using StepVerifier and TestPublisher](https://www.baeldung.com/reactive-streams-step-verifier-test-publisher) - [Debugging Reactive Streams in Spring 5](https://www.baeldung.com/spring-debugging-reactive-streams) - [Static Content in Spring WebFlux](https://www.baeldung.com/spring-webflux-static-content) -- More articles: [[next -->]](/spring-5-reactive-2) \ No newline at end of file +- More articles: [[next -->]](/spring-5-reactive-2) diff --git a/spring-5-security-oauth/README.md b/spring-5-security-oauth/README.md index 4e080fc517..43cab33598 100644 --- a/spring-5-security-oauth/README.md +++ b/spring-5-security-oauth/README.md @@ -4,6 +4,6 @@ This module contains articles about Spring 5 OAuth Security ## Relevant articles: -- [Spring Security 5 – OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login) +- [Spring Security 5 – OAuth2 Login](https://www.baeldung.com/spring-security-5-oauth2-login) - [Extracting Principal and Authorities using Spring Security OAuth](https://www.baeldung.com/spring-security-oauth-principal-authorities-extractor) - [Customizing Authorization and Token Requests with Spring Security 5.1 Client](https://www.baeldung.com/spring-security-custom-oauth-requests) diff --git a/spring-5-security/README.md b/spring-5-security/README.md index 23b46f4dc9..4cace0db8d 100644 --- a/spring-5-security/README.md +++ b/spring-5-security/README.md @@ -4,8 +4,8 @@ This module contains articles about Spring Security 5 ## Relevant articles: -- [Extra Login Fields with Spring Security](http://www.baeldung.com/spring-security-extra-login-fields) -- [A Custom Spring SecurityConfigurer](http://www.baeldung.com/spring-security-custom-configurer) -- [New Password Storage In Spring Security 5](http://www.baeldung.com/spring-security-5-password-storage) +- [Extra Login Fields with Spring Security](https://www.baeldung.com/spring-security-extra-login-fields) +- [A Custom Spring SecurityConfigurer](https://www.baeldung.com/spring-security-custom-configurer) +- [New Password Storage In Spring Security 5](https://www.baeldung.com/spring-security-5-password-storage) - [Default Password Encoder in Spring Security 5](https://www.baeldung.com/spring-security-5-default-password-encoder) diff --git a/spring-5/README.md b/spring-5/README.md index 7f4c643b7a..7588d23304 100644 --- a/spring-5/README.md +++ b/spring-5/README.md @@ -7,12 +7,12 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles -- [Concurrent Test Execution in Spring 5](http://www.baeldung.com/spring-5-concurrent-tests) -- [Spring 5 Functional Bean Registration](http://www.baeldung.com/spring-5-functional-beans) -- [The SpringJUnitConfig and SpringJUnitWebConfig Annotations in Spring 5](http://www.baeldung.com/spring-5-junit-config) -- [Spring 5 Testing with @EnabledIf Annotation](http://www.baeldung.com/spring-5-enabledIf) -- [Introduction to Spring REST Docs](http://www.baeldung.com/spring-rest-docs) -- [Spring ResponseStatusException](http://www.baeldung.com/spring-response-status-exception) -- [Spring Assert Statements](http://www.baeldung.com/spring-assert) +- [Concurrent Test Execution in Spring 5](https://www.baeldung.com/spring-5-concurrent-tests) +- [Spring 5 Functional Bean Registration](https://www.baeldung.com/spring-5-functional-beans) +- [The SpringJUnitConfig and SpringJUnitWebConfig Annotations in Spring 5](https://www.baeldung.com/spring-5-junit-config) +- [Spring 5 Testing with @EnabledIf Annotation](https://www.baeldung.com/spring-5-enabledIf) +- [Introduction to Spring REST Docs](https://www.baeldung.com/spring-rest-docs) +- [Spring ResponseStatusException](https://www.baeldung.com/spring-response-status-exception) +- [Spring Assert Statements](https://www.baeldung.com/spring-assert) - [Configuring a Hikari Connection Pool with Spring Boot](https://www.baeldung.com/spring-boot-hikari) diff --git a/spring-activiti/README.md b/spring-activiti/README.md index 75f3ea51e5..f4e788492b 100644 --- a/spring-activiti/README.md +++ b/spring-activiti/README.md @@ -4,7 +4,7 @@ This module contains articles about Spring with Activiti ### Relevant articles -- [A Guide to Activiti with Java](http://www.baeldung.com/java-activiti) -- [Introduction to Activiti with Spring](http://www.baeldung.com/spring-activiti) -- [Activiti with Spring Security](http://www.baeldung.com/activiti-spring-security) -- [ProcessEngine Configuration in Activiti](http://www.baeldung.com/activiti-process-engine) +- [A Guide to Activiti with Java](https://www.baeldung.com/java-activiti) +- [Introduction to Activiti with Spring](https://www.baeldung.com/spring-activiti) +- [Activiti with Spring Security](https://www.baeldung.com/activiti-spring-security) +- [ProcessEngine Configuration in Activiti](https://www.baeldung.com/activiti-process-engine) diff --git a/spring-akka/README.md b/spring-akka/README.md index 035551d459..c7db5d5c01 100644 --- a/spring-akka/README.md +++ b/spring-akka/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with Akka ### Relevant Articles: -- [Introduction to Spring with Akka](http://www.baeldung.com/akka-with-spring) +- [Introduction to Spring with Akka](https://www.baeldung.com/akka-with-spring) diff --git a/spring-all/README.md b/spring-all/README.md index 8a4e8fa18f..1d6cb0bfad 100644 --- a/spring-all/README.md +++ b/spring-all/README.md @@ -8,26 +8,26 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant articles: -- [Guide to Spring @Autowired](http://www.baeldung.com/spring-autowire) -- [Spring Profiles](http://www.baeldung.com/spring-profiles) -- [A Spring Custom Annotation for a Better DAO](http://www.baeldung.com/spring-annotation-bean-pre-processor) -- [What’s New in Spring 4.3?](http://www.baeldung.com/whats-new-in-spring-4-3) -- [Running Setup Data on Startup in Spring](http://www.baeldung.com/running-setup-logic-on-startup-in-spring) -- [Quick Guide to Spring Controllers](http://www.baeldung.com/spring-controllers) -- [Quick Guide to Spring Bean Scopes](http://www.baeldung.com/spring-bean-scopes) -- [Introduction To Ehcache](http://www.baeldung.com/ehcache) -- [A Guide to the Spring Task Scheduler](http://www.baeldung.com/spring-task-scheduler) -- [Guide to Spring Retry](http://www.baeldung.com/spring-retry) -- [Custom Scope in Spring](http://www.baeldung.com/spring-custom-scope) -- [A CLI with Spring Shell](http://www.baeldung.com/spring-shell-cli) -- [JasperReports with Spring](http://www.baeldung.com/spring-jasper) -- [Model, ModelMap, and ModelView in Spring MVC](http://www.baeldung.com/spring-mvc-model-model-map-model-view) -- [A Guide To Caching in Spring](http://www.baeldung.com/spring-cache-tutorial) -- [How To Do @Async in Spring](http://www.baeldung.com/spring-async) -- [@Order in Spring](http://www.baeldung.com/spring-order) -- [Spring Web Contexts](http://www.baeldung.com/spring-web-contexts) -- [Spring Cache – Creating a Custom KeyGenerator](http://www.baeldung.com/spring-cache-custom-keygenerator) -- [Spring @Primary Annotation](http://www.baeldung.com/spring-primary) +- [Guide to Spring @Autowired](https://www.baeldung.com/spring-autowire) +- [Spring Profiles](https://www.baeldung.com/spring-profiles) +- [A Spring Custom Annotation for a Better DAO](https://www.baeldung.com/spring-annotation-bean-pre-processor) +- [What’s New in Spring 4.3?](https://www.baeldung.com/whats-new-in-spring-4-3) +- [Running Setup Data on Startup in Spring](https://www.baeldung.com/running-setup-logic-on-startup-in-spring) +- [Quick Guide to Spring Controllers](https://www.baeldung.com/spring-controllers) +- [Quick Guide to Spring Bean Scopes](https://www.baeldung.com/spring-bean-scopes) +- [Introduction To Ehcache](https://www.baeldung.com/ehcache) +- [A Guide to the Spring Task Scheduler](https://www.baeldung.com/spring-task-scheduler) +- [Guide to Spring Retry](https://www.baeldung.com/spring-retry) +- [Custom Scope in Spring](https://www.baeldung.com/spring-custom-scope) +- [A CLI with Spring Shell](https://www.baeldung.com/spring-shell-cli) +- [JasperReports with Spring](https://www.baeldung.com/spring-jasper) +- [Model, ModelMap, and ModelView in Spring MVC](https://www.baeldung.com/spring-mvc-model-model-map-model-view) +- [A Guide To Caching in Spring](https://www.baeldung.com/spring-cache-tutorial) +- [How To Do @Async in Spring](https://www.baeldung.com/spring-async) +- [@Order in Spring](https://www.baeldung.com/spring-order) +- [Spring Web Contexts](https://www.baeldung.com/spring-web-contexts) +- [Spring Cache – Creating a Custom KeyGenerator](https://www.baeldung.com/spring-cache-custom-keygenerator) +- [Spring @Primary Annotation](https://www.baeldung.com/spring-primary) - [Spring Events](https://www.baeldung.com/spring-events) - [Spring Null-Safety Annotations](https://www.baeldung.com/spring-null-safety-annotations) - [Using @Autowired in Abstract Classes](https://www.baeldung.com/spring-autowired-abstract-class) diff --git a/spring-aop/README.md b/spring-aop/README.md index 915299a073..061e736d31 100644 --- a/spring-aop/README.md +++ b/spring-aop/README.md @@ -4,7 +4,7 @@ This module contains articles about Spring aspect oriented programming (AOP) ### Relevant articles -- [Implementing a Custom Spring AOP Annotation](http://www.baeldung.com/spring-aop-annotation) -- [Intro to AspectJ](http://www.baeldung.com/aspectj) -- [Spring Performance Logging](http://www.baeldung.com/spring-performance-logging) -- [Introduction to Spring AOP](http://www.baeldung.com/spring-aop) +- [Implementing a Custom Spring AOP Annotation](https://www.baeldung.com/spring-aop-annotation) +- [Intro to AspectJ](https://www.baeldung.com/aspectj) +- [Spring Performance Logging](https://www.baeldung.com/spring-performance-logging) +- [Introduction to Spring AOP](https://www.baeldung.com/spring-aop) diff --git a/spring-batch/README.md b/spring-batch/README.md index c100835948..95abbaf931 100644 --- a/spring-batch/README.md +++ b/spring-batch/README.md @@ -3,7 +3,7 @@ This module contains articles about Spring Batch ### Relevant Articles: -- [Introduction to Spring Batch](http://www.baeldung.com/introduction-to-spring-batch) -- [Spring Batch using Partitioner](http://www.baeldung.com/spring-batch-partitioner) -- [Spring Batch – Tasklets vs Chunks](http://www.baeldung.com/spring-batch-tasklet-chunk) -- [How to Trigger and Stop a Scheduled Spring Batch Job](http://www.baeldung.com/spring-batch-start-stop-job) +- [Introduction to Spring Batch](https://www.baeldung.com/introduction-to-spring-batch) +- [Spring Batch using Partitioner](https://www.baeldung.com/spring-batch-partitioner) +- [Spring Batch – Tasklets vs Chunks](https://www.baeldung.com/spring-batch-tasklet-chunk) +- [How to Trigger and Stop a Scheduled Spring Batch Job](https://www.baeldung.com/spring-batch-start-stop-job) diff --git a/spring-bom/README.md b/spring-bom/README.md index 60e7d75340..0866582fb2 100644 --- a/spring-bom/README.md +++ b/spring-bom/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with Maven BOM (Bill Of Materials) ### Relevant Articles: -- [Spring with Maven BOM](http://www.baeldung.com/spring-maven-bom) +- [Spring with Maven BOM](https://www.baeldung.com/spring-maven-bom) diff --git a/spring-boot-admin/README.md b/spring-boot-admin/README.md index 61010819fd..ac4d781d0e 100644 --- a/spring-boot-admin/README.md +++ b/spring-boot-admin/README.md @@ -23,4 +23,4 @@ and the mail configuration from application.properties ### Relevant Articles: -- [A Guide to Spring Boot Admin](http://www.baeldung.com/spring-boot-admin) +- [A Guide to Spring Boot Admin](https://www.baeldung.com/spring-boot-admin) diff --git a/spring-boot-autoconfiguration/README.md b/spring-boot-autoconfiguration/README.md index 920c378139..67311eed50 100644 --- a/spring-boot-autoconfiguration/README.md +++ b/spring-boot-autoconfiguration/README.md @@ -7,5 +7,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Create a Custom Auto-Configuration with Spring Boot](http://www.baeldung.com/spring-boot-custom-auto-configuration) +- [Create a Custom Auto-Configuration with Spring Boot](https://www.baeldung.com/spring-boot-custom-auto-configuration) - [Guide to ApplicationContextRunner in Spring Boot](https://www.baeldung.com/spring-boot-context-runner) diff --git a/spring-boot-bootstrap/README.md b/spring-boot-bootstrap/README.md index 6dd1582a20..5fb8fd4a84 100644 --- a/spring-boot-bootstrap/README.md +++ b/spring-boot-bootstrap/README.md @@ -3,8 +3,8 @@ This module contains articles about bootstrapping Spring Boot applications. ### Relevant Articles: -- [Spring Boot Tutorial – Bootstrap a Simple Application](http://www.baeldung.com/spring-boot-start) -- [Thin JARs with Spring Boot](http://www.baeldung.com/spring-boot-thin-jar) +- [Spring Boot Tutorial – Bootstrap a Simple Application](https://www.baeldung.com/spring-boot-start) +- [Thin JARs with Spring Boot](https://www.baeldung.com/spring-boot-thin-jar) - [Deploying a Spring Boot Application to Cloud Foundry](https://www.baeldung.com/spring-boot-app-deploy-to-cloud-foundry) - [Deploy a Spring Boot Application to Google App Engine](https://www.baeldung.com/spring-boot-google-app-engine) - [Deploy a Spring Boot Application to OpenShift](https://www.baeldung.com/spring-boot-deploy-openshift) diff --git a/spring-boot-camel/README.md b/spring-boot-camel/README.md index 194b7ea9c7..f9594a95a6 100644 --- a/spring-boot-camel/README.md +++ b/spring-boot-camel/README.md @@ -24,4 +24,4 @@ or return code of 201 and the response: `{"id": 10,"name": "Hello, World"}` - if ## Relevant articles: -- [Apache Camel with Spring Boot](http://www.baeldung.com/apache-camel-spring-boot) +- [Apache Camel with Spring Boot](https://www.baeldung.com/apache-camel-spring-boot) diff --git a/spring-boot-cli/README.md b/spring-boot-cli/README.md index 8c8a0c99c1..79e259c855 100644 --- a/spring-boot-cli/README.md +++ b/spring-boot-cli/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring Boot CLI ### Relevant Articles: -- [Introduction to Spring Boot CLI](http://www.baeldung.com/spring-boot-cli) +- [Introduction to Spring Boot CLI](https://www.baeldung.com/spring-boot-cli) diff --git a/spring-boot-client/README.MD b/spring-boot-client/README.MD index c8b9e1cd6e..b5a4c78446 100644 --- a/spring-boot-client/README.MD +++ b/spring-boot-client/README.MD @@ -7,5 +7,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Quick Guide to @RestClientTest in Spring Boot](http://www.baeldung.com/restclienttest-in-spring-boot) -- [A Java Client for a WebSockets API](http://www.baeldung.com/websockets-api-java-spring-client) \ No newline at end of file +- [Quick Guide to @RestClientTest in Spring Boot](https://www.baeldung.com/restclienttest-in-spring-boot) +- [A Java Client for a WebSockets API](https://www.baeldung.com/websockets-api-java-spring-client) diff --git a/spring-boot-ctx-fluent/README.md b/spring-boot-ctx-fluent/README.md index 646ad0f7d1..2d7ba7f2c0 100644 --- a/spring-boot-ctx-fluent/README.md +++ b/spring-boot-ctx-fluent/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring Boot Fluent Builder ### Relevant Articles: -- [Context Hierarchy with the Spring Boot Fluent Builder API](http://www.baeldung.com/spring-boot-context-hierarchy) +- [Context Hierarchy with the Spring Boot Fluent Builder API](https://www.baeldung.com/spring-boot-context-hierarchy) diff --git a/spring-boot-custom-starter/README.md b/spring-boot-custom-starter/README.md index 9a62884ecb..c22aab7a2b 100644 --- a/spring-boot-custom-starter/README.md +++ b/spring-boot-custom-starter/README.md @@ -3,7 +3,7 @@ This module contains articles about writing Spring Boot [starters](https://www.baeldung.com/spring-boot-starters). ### Relevant Articles: -- [Creating a Custom Starter with Spring Boot](http://www.baeldung.com/spring-boot-custom-starter) +- [Creating a Custom Starter with Spring Boot](https://www.baeldung.com/spring-boot-custom-starter) - **greeter-library**: The sample library that we're creating the starter for. @@ -13,4 +13,4 @@ This module contains articles about writing Spring Boot [starters](https://www.b - **greeter-spring-boot-sample-app**: The sample project that uses the custom starter. -- [Multi-Module Project With Spring Boot](http://www.baeldung.com/spring-boot-multiple-modules) +- [Multi-Module Project With Spring Boot](https://www.baeldung.com/spring-boot-multiple-modules) diff --git a/spring-boot-flowable/README.md b/spring-boot-flowable/README.md index 884ddb7ec6..1a8fb28a5e 100644 --- a/spring-boot-flowable/README.md +++ b/spring-boot-flowable/README.md @@ -4,4 +4,4 @@ This module contains articles about Flowable in Boot applications ### Relevant articles -- [Introduction to Flowable](http://www.baeldung.com/flowable) +- [Introduction to Flowable](https://www.baeldung.com/flowable) diff --git a/spring-boot-gradle/README.md b/spring-boot-gradle/README.md index 3a64cca553..859c5d8199 100644 --- a/spring-boot-gradle/README.md +++ b/spring-boot-gradle/README.md @@ -4,5 +4,5 @@ This module contains articles about Gradle in Spring Boot projects. ### Relevant Articles: -- [Spring Boot: Configuring a Main Class](http://www.baeldung.com/spring-boot-main-class) -- [Thin JARs with Spring Boot](http://www.baeldung.com/spring-boot-thin-jar) +- [Spring Boot: Configuring a Main Class](https://www.baeldung.com/spring-boot-main-class) +- [Thin JARs with Spring Boot](https://www.baeldung.com/spring-boot-thin-jar) diff --git a/spring-boot-jasypt/README.md b/spring-boot-jasypt/README.md index a07ca19790..c76339119a 100644 --- a/spring-boot-jasypt/README.md +++ b/spring-boot-jasypt/README.md @@ -4,4 +4,4 @@ This module contains articles about Jasypt in Spring Boot projects. ### Relevant Articles: -- [Spring Boot Configuration with Jasypt](http://www.baeldung.com/spring-boot-jasypt) +- [Spring Boot Configuration with Jasypt](https://www.baeldung.com/spring-boot-jasypt) diff --git a/spring-boot-keycloak/README.md b/spring-boot-keycloak/README.md index 15f0f1459c..2dfe3fc331 100644 --- a/spring-boot-keycloak/README.md +++ b/spring-boot-keycloak/README.md @@ -3,4 +3,4 @@ This module contains articles about Keycloak in Spring Boot projects. ## Relevant articles: -- [A Quick Guide to Using Keycloak with Spring Boot](http://www.baeldung.com/spring-boot-keycloak) +- [A Quick Guide to Using Keycloak with Spring Boot](https://www.baeldung.com/spring-boot-keycloak) diff --git a/spring-boot-kotlin/README.md b/spring-boot-kotlin/README.md index 73c312040d..d393805ed1 100644 --- a/spring-boot-kotlin/README.md +++ b/spring-boot-kotlin/README.md @@ -3,4 +3,4 @@ This module contains articles about Kotlin in Spring Boot projects. ### Relevant Articles: -- [Non-blocking Spring Boot with Kotlin Coroutines](http://www.baeldung.com/non-blocking-spring-boot-with-kotlin-coroutines) +- [Non-blocking Spring Boot with Kotlin Coroutines](https://www.baeldung.com/non-blocking-spring-boot-with-kotlin-coroutines) diff --git a/spring-boot-logging-log4j2/README.md b/spring-boot-logging-log4j2/README.md index 2d72ab6f97..76029caef8 100644 --- a/spring-boot-logging-log4j2/README.md +++ b/spring-boot-logging-log4j2/README.md @@ -3,6 +3,6 @@ This module contains articles about logging in Spring Boot projects with Log4j 2. ### Relevant Articles: -- [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging) +- [Logging in Spring Boot](https://www.baeldung.com/spring-boot-logging) - [Logging to Graylog with Spring Boot](https://www.baeldung.com/graylog-with-spring-boot) diff --git a/spring-boot-mvc/README.md b/spring-boot-mvc/README.md index 444d91b0e7..a83ea3ee25 100644 --- a/spring-boot-mvc/README.md +++ b/spring-boot-mvc/README.md @@ -4,18 +4,18 @@ This module contains articles about Spring Web MVC in Spring Boot projects. ### Relevant Articles: -- [Guide to the Favicon in Spring Boot](http://www.baeldung.com/spring-boot-favicon) +- [Guide to the Favicon in Spring Boot](https://www.baeldung.com/spring-boot-favicon) - [Custom Validation MessageSource in Spring Boot](https://www.baeldung.com/spring-custom-validation-message-source) -- [Spring Boot Annotations](http://www.baeldung.com/spring-boot-annotations) -- [Spring Scheduling Annotations](http://www.baeldung.com/spring-scheduling-annotations) -- [Spring Web Annotations](http://www.baeldung.com/spring-mvc-annotations) -- [Spring Core Annotations](http://www.baeldung.com/spring-core-annotations) -- [Display RSS Feed with Spring MVC](http://www.baeldung.com/spring-mvc-rss-feed) +- [Spring Boot Annotations](https://www.baeldung.com/spring-boot-annotations) +- [Spring Scheduling Annotations](https://www.baeldung.com/spring-scheduling-annotations) +- [Spring Web Annotations](https://www.baeldung.com/spring-mvc-annotations) +- [Spring Core Annotations](https://www.baeldung.com/spring-core-annotations) +- [Display RSS Feed with Spring MVC](https://www.baeldung.com/spring-mvc-rss-feed) - [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao) - [Cache Eviction in Spring Boot](https://www.baeldung.com/spring-boot-evict-cache) -- [Setting Up Swagger 2 with a Spring REST API](http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) +- [Setting Up Swagger 2 with a Spring REST API](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) - [Conditionally Enable Scheduled Jobs in Spring](https://www.baeldung.com/spring-scheduled-enabled-conditionally) - [Accessing Spring MVC Model Objects in JavaScript](https://www.baeldung.com/spring-mvc-model-objects-js) -- [Using Spring ResponseEntity to Manipulate the HTTP Response](http://www.baeldung.com/spring-response-entity) -- [Spring Bean Annotations](http://www.baeldung.com/spring-bean-annotations) +- [Using Spring ResponseEntity to Manipulate the HTTP Response](https://www.baeldung.com/spring-response-entity) +- [Spring Bean Annotations](https://www.baeldung.com/spring-bean-annotations) - More articles: [[next -->]](/spring-boot-mvc-2) diff --git a/spring-boot-ops/README.md b/spring-boot-ops/README.md index 71b00b63b0..2720bc5ae2 100644 --- a/spring-boot-ops/README.md +++ b/spring-boot-ops/README.md @@ -3,16 +3,16 @@ This module contains articles about Spring Boot Operations ### Relevant Articles: - - [Deploy a Spring Boot WAR into a Tomcat Server](http://www.baeldung.com/spring-boot-war-tomcat-deploy) - - [Spring Boot Dependency Management with a Custom Parent](http://www.baeldung.com/spring-boot-dependency-management-custom-parent) - - [A Custom Data Binder in Spring MVC](http://www.baeldung.com/spring-mvc-custom-data-binder) - - [Create a Fat Jar App with Spring Boot](http://www.baeldung.com/deployable-fat-jar-spring-boot) - - [Introduction to WebJars](http://www.baeldung.com/maven-webjars) - - [Intro to Spring Boot Starters](http://www.baeldung.com/spring-boot-starters) - - [A Quick Guide to Maven Wrapper](http://www.baeldung.com/maven-wrapper) - - [Shutdown a Spring Boot Application](http://www.baeldung.com/spring-boot-shutdown) - - [Spring Boot Console Application](http://www.baeldung.com/spring-boot-console-app) - - [Comparing Embedded Servlet Containers in Spring Boot](http://www.baeldung.com/spring-boot-servlet-containers) + - [Deploy a Spring Boot WAR into a Tomcat Server](https://www.baeldung.com/spring-boot-war-tomcat-deploy) + - [Spring Boot Dependency Management with a Custom Parent](https://www.baeldung.com/spring-boot-dependency-management-custom-parent) + - [A Custom Data Binder in Spring MVC](https://www.baeldung.com/spring-mvc-custom-data-binder) + - [Create a Fat Jar App with Spring Boot](https://www.baeldung.com/deployable-fat-jar-spring-boot) + - [Introduction to WebJars](https://www.baeldung.com/maven-webjars) + - [Intro to Spring Boot Starters](https://www.baeldung.com/spring-boot-starters) + - [A Quick Guide to Maven Wrapper](https://www.baeldung.com/maven-wrapper) + - [Shutdown a Spring Boot Application](https://www.baeldung.com/spring-boot-shutdown) + - [Spring Boot Console Application](https://www.baeldung.com/spring-boot-console-app) + - [Comparing Embedded Servlet Containers in Spring Boot](https://www.baeldung.com/spring-boot-servlet-containers) - [Programmatically Restarting a Spring Boot Application](https://www.baeldung.com/java-restart-spring-boot-app) - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) diff --git a/spring-boot-properties/README.md b/spring-boot-properties/README.md index 9aea5b4871..48ff79537c 100644 --- a/spring-boot-properties/README.md +++ b/spring-boot-properties/README.md @@ -1,10 +1,10 @@ ### Relevant Articles: - [Reloading Properties Files in Spring](https://www.baeldung.com/spring-reloading-properties) -- [Guide to @ConfigurationProperties in Spring Boot](http://www.baeldung.com/configuration-properties-in-spring-boot) +- [Guide to @ConfigurationProperties in Spring Boot](https://www.baeldung.com/configuration-properties-in-spring-boot) - [Load Spring Boot Properties From a JSON File](https://www.baeldung.com/spring-boot-json-properties) - [Guide to @EnableConfigurationProperties](https://www.baeldung.com/spring-enable-config-properties) -- [Properties with Spring and Spring Boot](http://www.baeldung.com/properties-with-spring) - checkout the `com.baeldung.properties` package for all scenarios of properties injection and usage -- [A Quick Guide to Spring @Value](http://www.baeldung.com/spring-value-annotation) -- [Spring YAML Configuration](http://www.baeldung.com/spring-yaml) -- [Using Spring @Value with Defaults](http://www.baeldung.com/spring-value-defaults) -- [How to Inject a Property Value Into a Class Not Managed by Spring?](http://www.baeldung.com/inject-properties-value-non-spring-class) +- [Properties with Spring and Spring Boot](https://www.baeldung.com/properties-with-spring) - checkout the `com.baeldung.properties` package for all scenarios of properties injection and usage +- [A Quick Guide to Spring @Value](https://www.baeldung.com/spring-value-annotation) +- [Spring YAML Configuration](https://www.baeldung.com/spring-yaml) +- [Using Spring @Value with Defaults](https://www.baeldung.com/spring-value-defaults) +- [How to Inject a Property Value Into a Class Not Managed by Spring?](https://www.baeldung.com/inject-properties-value-non-spring-class) diff --git a/spring-boot-property-exp/README.md b/spring-boot-property-exp/README.md index e880837dc0..23af5995e2 100644 --- a/spring-boot-property-exp/README.md +++ b/spring-boot-property-exp/README.md @@ -1,10 +1,10 @@ ## Spring Boot Property Expansion -This Module contains articles about Spring Boot Property Expansion +This module contains articles about Spring Boot Property Expansion ### Relevant Articles - - [Automatic Property Expansion with Spring Boot](http://www.baeldung.com/spring-boot-auto-property-expansion) + - [Automatic Property Expansion with Spring Boot](https://www.baeldung.com/spring-boot-auto-property-expansion) ## SubModules diff --git a/spring-boot-rest/README.md b/spring-boot-rest/README.md index b3365d932e..ffac9335fd 100644 --- a/spring-boot-rest/README.md +++ b/spring-boot-rest/README.md @@ -4,10 +4,10 @@ This module contains articles about Spring Boot RESTful APIs. ### Relevant Articles -- [HATEOAS for a Spring REST Service](http://www.baeldung.com/rest-api-discoverability-with-spring) -- [Versioning a REST API](http://www.baeldung.com/rest-versioning) -- [ETags for REST with Spring](http://www.baeldung.com/etags-for-rest-with-spring) -- [Testing REST with multiple MIME types](http://www.baeldung.com/testing-rest-api-with-multiple-media-types) +- [HATEOAS for a Spring REST Service](https://www.baeldung.com/rest-api-discoverability-with-spring) +- [Versioning a REST API](https://www.baeldung.com/rest-versioning) +- [ETags for REST with Spring](https://www.baeldung.com/etags-for-rest-with-spring) +- [Testing REST with multiple MIME types](https://www.baeldung.com/testing-rest-api-with-multiple-media-types) - [Testing Web APIs with Postman Collections](https://www.baeldung.com/postman-testing-collections) - [Spring Boot Consuming and Producing JSON](https://www.baeldung.com/spring-boot-json) @@ -16,14 +16,12 @@ This module contains articles about Spring Boot RESTful APIs. These articles are part of the Spring REST E-book: 1. [Bootstrap a Web Application with Spring 5](https://www.baeldung.com/bootstraping-a-web-application-with-spring-and-java-based-configuration) -2. [Build a REST API with Spring and Java Config](http://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration) -3. [Http Message Converters with the Spring Framework](http://www.baeldung.com/spring-httpmessageconverter-rest) +2. [Build a REST API with Spring and Java Config](https://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration) +3. [Http Message Converters with the Spring Framework](https://www.baeldung.com/spring-httpmessageconverter-rest) 4. [Spring’s RequestBody and ResponseBody Annotations](https://www.baeldung.com/spring-request-response-body) 5. [Entity To DTO Conversion for a Spring REST API](https://www.baeldung.com/entity-to-and-from-dto-for-a-java-spring-application) -6. [Error Handling for REST with Spring](http://www.baeldung.com/exception-handling-for-rest-with-spring) -7. [REST API Discoverability and HATEOAS](http://www.baeldung.com/restful-web-service-discoverability) -8. [An Intro to Spring HATEOAS](http://www.baeldung.com/spring-hateoas-tutorial) -9. [REST Pagination in Spring](http://www.baeldung.com/rest-api-pagination-in-spring) -10. [Test a REST API with Java](http://www.baeldung.com/integration-testing-a-rest-api) - - +6. [Error Handling for REST with Spring](https://www.baeldung.com/exception-handling-for-rest-with-spring) +7. [REST API Discoverability and HATEOAS](https://www.baeldung.com/restful-web-service-discoverability) +8. [An Intro to Spring HATEOAS](https://www.baeldung.com/spring-hateoas-tutorial) +9. [REST Pagination in Spring](https://www.baeldung.com/rest-api-pagination-in-spring) +10. [Test a REST API with Java](https://www.baeldung.com/integration-testing-a-rest-api) diff --git a/spring-boot-security/README.md b/spring-boot-security/README.md index be40010091..be4690f321 100644 --- a/spring-boot-security/README.md +++ b/spring-boot-security/README.md @@ -4,7 +4,7 @@ This module contains articles about Spring Boot Security ### Relevant Articles: -- [Spring Boot Security Auto-Configuration](http://www.baeldung.com/spring-boot-security-autoconfiguration) +- [Spring Boot Security Auto-Configuration](https://www.baeldung.com/spring-boot-security-autoconfiguration) - [Spring Security for Spring Boot Integration Tests](https://www.baeldung.com/spring-security-integration-tests) - [Introduction to Spring Security Taglibs](https://www.baeldung.com/spring-security-taglibs) @@ -17,5 +17,3 @@ This module contains articles about Spring Boot Security ### CURL commands - curl -X POST -u baeldung-admin:baeldung -d grant_type=client_credentials -d username=baeldung-admin -d password=baeldung http://localhost:8080/oauth/token - - diff --git a/spring-boot-vue/README.md b/spring-boot-vue/README.md index 5de138826c..de473c0d36 100644 --- a/spring-boot-vue/README.md +++ b/spring-boot-vue/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring Boot with Vue.js ### Relevant Articles: -- [Vue.js Frontend with a Spring Boot Backend](http://www.baeldung.com/spring-boot-vue-js) +- [Vue.js Frontend with a Spring Boot Backend](https://www.baeldung.com/spring-boot-vue-js) diff --git a/spring-boot/README.MD b/spring-boot/README.MD index 522a1f7120..2423d6d331 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -7,30 +7,30 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [A Guide to Spring in Eclipse STS](http://www.baeldung.com/eclipse-sts-spring) -- [The @ServletComponentScan Annotation in Spring Boot](http://www.baeldung.com/spring-servletcomponentscan) -- [How to Register a Servlet in Java](http://www.baeldung.com/register-servlet) -- [Guide to Spring WebUtils and ServletRequestUtils](http://www.baeldung.com/spring-webutils-servletrequestutils) -- [Using Custom Banners in Spring Boot](http://www.baeldung.com/spring-boot-custom-banners) -- [Guide to Internationalization in Spring Boot](http://www.baeldung.com/spring-boot-internationalization) -- [Create a Custom FailureAnalyzer with Spring Boot](http://www.baeldung.com/spring-boot-failure-analyzer) -- [Dynamic DTO Validation Config Retrieved from the Database](http://www.baeldung.com/spring-dynamic-dto-validation) -- [Custom Information in Spring Boot Info Endpoint](http://www.baeldung.com/spring-boot-info-actuator-custom) -- [Using @JsonComponent in Spring Boot](http://www.baeldung.com/spring-boot-jsoncomponent) -- [Testing in Spring Boot](http://www.baeldung.com/spring-boot-testing) -- [How to Get All Spring-Managed Beans?](http://www.baeldung.com/spring-show-all-beans) -- [Spring Boot and Togglz Aspect](http://www.baeldung.com/spring-togglz) -- [Getting Started with GraphQL and Spring Boot](http://www.baeldung.com/spring-graphql) -- [Guide to Spring Type Conversions](http://www.baeldung.com/spring-type-conversions) -- [An Introduction to Kong](http://www.baeldung.com/kong) -- [Spring Boot: Customize Whitelabel Error Page](http://www.baeldung.com/spring-boot-custom-error-page) -- [Spring Boot: Configuring a Main Class](http://www.baeldung.com/spring-boot-main-class) -- [A Quick Intro to the SpringBootServletInitializer](http://www.baeldung.com/spring-boot-servlet-initializer) -- [How to Define a Spring Boot Filter?](http://www.baeldung.com/spring-boot-add-filter) -- [Spring Boot Exit Codes](http://www.baeldung.com/spring-boot-exit-codes) -- [Guide to the Favicon in Spring Boot](http://www.baeldung.com/spring-boot-favicon) -- [Spring Shutdown Callbacks](http://www.baeldung.com/spring-shutdown-callbacks) -- [Container Configuration in Spring Boot 2](http://www.baeldung.com/embeddedservletcontainercustomizer-configurableembeddedservletcontainer-spring-boot) +- [A Guide to Spring in Eclipse STS](https://www.baeldung.com/eclipse-sts-spring) +- [The @ServletComponentScan Annotation in Spring Boot](https://www.baeldung.com/spring-servletcomponentscan) +- [How to Register a Servlet in Java](https://www.baeldung.com/register-servlet) +- [Guide to Spring WebUtils and ServletRequestUtils](https://www.baeldung.com/spring-webutils-servletrequestutils) +- [Using Custom Banners in Spring Boot](https://www.baeldung.com/spring-boot-custom-banners) +- [Guide to Internationalization in Spring Boot](https://www.baeldung.com/spring-boot-internationalization) +- [Create a Custom FailureAnalyzer with Spring Boot](https://www.baeldung.com/spring-boot-failure-analyzer) +- [Dynamic DTO Validation Config Retrieved from the Database](https://www.baeldung.com/spring-dynamic-dto-validation) +- [Custom Information in Spring Boot Info Endpoint](https://www.baeldung.com/spring-boot-info-actuator-custom) +- [Using @JsonComponent in Spring Boot](https://www.baeldung.com/spring-boot-jsoncomponent) +- [Testing in Spring Boot](https://www.baeldung.com/spring-boot-testing) +- [How to Get All Spring-Managed Beans?](https://www.baeldung.com/spring-show-all-beans) +- [Spring Boot and Togglz Aspect](https://www.baeldung.com/spring-togglz) +- [Getting Started with GraphQL and Spring Boot](https://www.baeldung.com/spring-graphql) +- [Guide to Spring Type Conversions](https://www.baeldung.com/spring-type-conversions) +- [An Introduction to Kong](https://www.baeldung.com/kong) +- [Spring Boot: Customize Whitelabel Error Page](https://www.baeldung.com/spring-boot-custom-error-page) +- [Spring Boot: Configuring a Main Class](https://www.baeldung.com/spring-boot-main-class) +- [A Quick Intro to the SpringBootServletInitializer](https://www.baeldung.com/spring-boot-servlet-initializer) +- [How to Define a Spring Boot Filter?](https://www.baeldung.com/spring-boot-add-filter) +- [Spring Boot Exit Codes](https://www.baeldung.com/spring-boot-exit-codes) +- [Guide to the Favicon in Spring Boot](https://www.baeldung.com/spring-boot-favicon) +- [Spring Shutdown Callbacks](https://www.baeldung.com/spring-shutdown-callbacks) +- [Container Configuration in Spring Boot 2](https://www.baeldung.com/embeddedservletcontainercustomizer-configurableembeddedservletcontainer-spring-boot) - [Introduction to Chaos Monkey](https://www.baeldung.com/spring-boot-chaos-monkey) - [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) - [Injecting Git Information Into Spring](https://www.baeldung.com/spring-git-information) diff --git a/spring-cloud-bus/README.md b/spring-cloud-bus/README.md index 9c33353a24..dbbb8d7156 100644 --- a/spring-cloud-bus/README.md +++ b/spring-cloud-bus/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring Cloud Bus ### Relevant articles -- [Spring Cloud Bus](http://www.baeldung.com/spring-cloud-bus) +- [Spring Cloud Bus](https://www.baeldung.com/spring-cloud-bus) diff --git a/spring-cloud-cli/README.md b/spring-cloud-cli/README.md index 99df3ddbad..46b47e0e08 100644 --- a/spring-cloud-cli/README.md +++ b/spring-cloud-cli/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring Cloud CLI ### Relevant Articles: -- [Introduction to Spring Cloud CLI](http://www.baeldung.com/spring-cloud-cli) +- [Introduction to Spring Cloud CLI](https://www.baeldung.com/spring-cloud-cli) diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 936c93b460..910d27583f 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -5,7 +5,7 @@ This module contains articles about core Spring functionality ## Relevant Articles: - [Understanding getBean() in Spring](https://www.baeldung.com/spring-getbean) -- [Exploring the Spring BeanFactory API](http://www.baeldung.com/spring-beanfactory) -- [How to use the Spring FactoryBean?](http://www.baeldung.com/spring-factorybean) -- [Spring – Injecting Collections](http://www.baeldung.com/spring-injecting-collections) +- [Exploring the Spring BeanFactory API](https://www.baeldung.com/spring-beanfactory) +- [How to use the Spring FactoryBean?](https://www.baeldung.com/spring-factorybean) +- [Spring – Injecting Collections](https://www.baeldung.com/spring-injecting-collections) - More articles: [[<-- prev]](/spring-core) diff --git a/spring-core/README.md b/spring-core/README.md index f90e84121d..6d274e89f0 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -3,13 +3,13 @@ This module contains articles about core Spring functionality ### Relevant Articles: -- [Wiring in Spring: @Autowired, @Resource and @Inject](http://www.baeldung.com/spring-annotations-resource-inject-autowire) -- [Constructor Injection in Spring with Lombok](http://www.baeldung.com/spring-injection-lombok) -- [Introduction to Spring’s StreamUtils](http://www.baeldung.com/spring-stream-utils) -- [XML-Based Injection in Spring](http://www.baeldung.com/spring-xml-injection) -- [A Quick Guide to the Spring @Lazy Annotation](http://www.baeldung.com/spring-lazy-annotation) -- [BeanNameAware and BeanFactoryAware Interfaces in Spring](http://www.baeldung.com/spring-bean-name-factory-aware) -- [Access a File from the Classpath in a Spring Application](http://www.baeldung.com/spring-classpath-file-access) +- [Wiring in Spring: @Autowired, @Resource and @Inject](https://www.baeldung.com/spring-annotations-resource-inject-autowire) +- [Constructor Injection in Spring with Lombok](httsp://www.baeldung.com/spring-injection-lombok) +- [Introduction to Spring’s StreamUtils](https://www.baeldung.com/spring-stream-utils) +- [XML-Based Injection in Spring](httsp://www.baeldung.com/spring-xml-injection) +- [A Quick Guide to the Spring @Lazy Annotation](https://www.baeldung.com/spring-lazy-annotation) +- [BeanNameAware and BeanFactoryAware Interfaces in Spring](https://www.baeldung.com/spring-bean-name-factory-aware) +- [Access a File from the Classpath in a Spring Application](https://www.baeldung.com/spring-classpath-file-access) - [Spring Application Context Events](https://www.baeldung.com/spring-context-events) - [What is a Spring Bean?](https://www.baeldung.com/spring-bean) - [Spring PostConstruct and PreDestroy Annotations](https://www.baeldung.com/spring-postconstruct-predestroy) diff --git a/spring-cucumber/README.md b/spring-cucumber/README.md index 0638ff777a..85bc1f65d5 100644 --- a/spring-cucumber/README.md +++ b/spring-cucumber/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring testing with Cucumber ### Relevant Articles: -- [Cucumber Spring Integration](http://www.baeldung.com/cucumber-spring-integration) +- [Cucumber Spring Integration](https://www.baeldung.com/cucumber-spring-integration) diff --git a/spring-data-rest-querydsl/README.md b/spring-data-rest-querydsl/README.md index be47d05f8d..05ae03ab87 100644 --- a/spring-data-rest-querydsl/README.md +++ b/spring-data-rest-querydsl/README.md @@ -3,4 +3,4 @@ This module contains articles about Querydsl with Spring Data REST ### Relevant Articles: -- [REST Query Language Over Multiple Tables with Querydsl Web Support](http://www.baeldung.com/rest-querydsl-multiple-tables) +- [REST Query Language Over Multiple Tables with Querydsl Web Support](https://www.baeldung.com/rest-querydsl-multiple-tables) diff --git a/spring-data-rest/README.md b/spring-data-rest/README.md index b12590e5e5..bae2fe8eaf 100644 --- a/spring-data-rest/README.md +++ b/spring-data-rest/README.md @@ -3,12 +3,12 @@ This module contains articles about Spring Data REST ### Relevant Articles: -- [Introduction to Spring Data REST](http://www.baeldung.com/spring-data-rest-intro) -- [Guide to Spring Data REST Validators](http://www.baeldung.com/spring-data-rest-validators) -- [Working with Relationships in Spring Data REST](http://www.baeldung.com/spring-data-rest-relationships) -- [AngularJS CRUD Application with Spring Data REST](http://www.baeldung.com/angularjs-crud-with-spring-data-rest) -- [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) -- [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) +- [Introduction to Spring Data REST](https://www.baeldung.com/spring-data-rest-intro) +- [Guide to Spring Data REST Validators](https://www.baeldung.com/spring-data-rest-validators) +- [Working with Relationships in Spring Data REST](https://www.baeldung.com/spring-data-rest-relationships) +- [AngularJS CRUD Application with Spring Data REST](https://www.baeldung.com/angularjs-crud-with-spring-data-rest) +- [Projections and Excerpts in Spring Data REST](https://www.baeldung.com/spring-data-rest-projections-excerpts) +- [Spring Data REST Events with @RepositoryEventHandler](https://www.baeldung.com/spring-data-rest-events) - [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) - [Spring Boot with SQLite](https://www.baeldung.com/spring-boot-sqlite) - [Spring Data Web Support](https://www.baeldung.com/spring-data-web-support) @@ -24,5 +24,3 @@ The application uses [Spring Boot](http://projects.spring.io/spring-boot/), so i # Viewing the running application To view the running application, visit [http://localhost:8080](http://localhost:8080) in your browser - - diff --git a/spring-di/README.md b/spring-di/README.md index 17f50ba410..7571b12916 100644 --- a/spring-di/README.md +++ b/spring-di/README.md @@ -5,11 +5,11 @@ This module contains articles about dependency injection with Spring ### Relevant Articles - [The Spring @Qualifier Annotation](https://www.baeldung.com/spring-qualifier-annotation) -- [Constructor Dependency Injection in Spring](http://www.baeldung.com/constructor-injection-in-spring) +- [Constructor Dependency Injection in Spring](https://www.baeldung.com/constructor-injection-in-spring) - [Spring Autowiring of Generic Types](https://www.baeldung.com/spring-autowire-generics) - [Guice vs Spring – Dependency Injection](https://www.baeldung.com/guice-spring-dependency-injection) -- [Injecting Prototype Beans into a Singleton Instance in Spring](http://www.baeldung.com/spring-inject-prototype-bean-into-singleton) -- [@Lookup Annotation in Spring](http://www.baeldung.com/spring-lookup) -- [Controlling Bean Creation Order with @DependsOn Annotation](http://www.baeldung.com/spring-depends-on) +- [Injecting Prototype Beans into a Singleton Instance in Spring](https://www.baeldung.com/spring-inject-prototype-bean-into-singleton) +- [@Lookup Annotation in Spring](https://www.baeldung.com/spring-lookup) +- [Controlling Bean Creation Order with @DependsOn Annotation](https://www.baeldung.com/spring-depends-on) - [Unsatisfied Dependency in Spring](https://www.baeldung.com/spring-unsatisfied-dependency) -- [Circular Dependencies in Spring](http://www.baeldung.com/circular-dependencies-in-spring) +- [Circular Dependencies in Spring](https://www.baeldung.com/circular-dependencies-in-spring) diff --git a/spring-dispatcher-servlet/README.md b/spring-dispatcher-servlet/README.md index 3954d4df5a..3027546152 100644 --- a/spring-dispatcher-servlet/README.md +++ b/spring-dispatcher-servlet/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring DispatcherServlet ## Relevant articles: -- [An Intro to the Spring DispatcherServlet](http://www.baeldung.com/spring-dispatcherservlet) +- [An Intro to the Spring DispatcherServlet](https://www.baeldung.com/spring-dispatcherservlet) diff --git a/spring-drools/README.md b/spring-drools/README.md index 3685a399bc..08ab4de465 100644 --- a/spring-drools/README.md +++ b/spring-drools/README.md @@ -4,4 +4,4 @@ This modules contains articles about Spring with Drools ## Relevant articles: -- [Drools Spring Integration](http://www.baeldung.com/drools-spring-integration) +- [Drools Spring Integration](https://www.baeldung.com/drools-spring-integration) diff --git a/spring-ejb/README.md b/spring-ejb/README.md index f475aafc7f..6c63c2709f 100644 --- a/spring-ejb/README.md +++ b/spring-ejb/README.md @@ -4,10 +4,10 @@ This module contains articles about Spring with EJB ### Relevant Articles -- [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro) -- [Java EE Session Beans](http://www.baeldung.com/ejb-session-beans) -- [Introduction to EJB JNDI Lookup on WildFly Application Server](http://www.baeldung.com/wildfly-ejb-jndi) -- [A Guide to Message Driven Beans in EJB](http://www.baeldung.com/ejb-message-driven-beans) -- [Integration Guide for Spring and EJB](http://www.baeldung.com/spring-ejb) -- [Singleton Session Bean in Java EE](http://www.baeldung.com/java-ee-singleton-session-bean) +- [Guide to EJB Set-up](https://www.baeldung.com/ejb-intro) +- [Java EE Session Beans](https://www.baeldung.com/ejb-session-beans) +- [Introduction to EJB JNDI Lookup on WildFly Application Server](httpss://www.baeldung.com/wildfly-ejb-jndi) +- [A Guide to Message Driven Beans in EJB](https://www.baeldung.com/ejb-message-driven-beans) +- [Integration Guide for Spring and EJB](https://www.baeldung.com/spring-ejb) +- [Singleton Session Bean in Java EE](https://www.baeldung.com/java-ee-singleton-session-bean) diff --git a/spring-exceptions/README.md b/spring-exceptions/README.md index 026e8485c8..f8c7553f05 100644 --- a/spring-exceptions/README.md +++ b/spring-exceptions/README.md @@ -3,9 +3,9 @@ This module contains articles about Spring `Exception`s ### Relevant articles: -- [Spring BeanCreationException](http://www.baeldung.com/spring-beancreationexception) -- [Spring DataIntegrityViolationException](http://www.baeldung.com/spring-dataIntegrityviolationexception) -- [Spring BeanDefinitionStoreException](http://www.baeldung.com/spring-beandefinitionstoreexception) -- [Spring NoSuchBeanDefinitionException](http://www.baeldung.com/spring-nosuchbeandefinitionexception) -- [Guide to Spring NonTransientDataAccessException](http://www.baeldung.com/nontransientdataaccessexception) -- [Hibernate Mapping Exception – Unknown Entity](http://www.baeldung.com/hibernate-mappingexception-unknown-entity) +- [Spring BeanCreationException](https://www.baeldung.com/spring-beancreationexception) +- [Spring DataIntegrityViolationException](https://www.baeldung.com/spring-dataIntegrityviolationexception) +- [Spring BeanDefinitionStoreException](https://www.baeldung.com/spring-beandefinitionstoreexception) +- [Spring NoSuchBeanDefinitionException](https://www.baeldung.com/spring-nosuchbeandefinitionexception) +- [Guide to Spring NonTransientDataAccessException](https://www.baeldung.com/nontransientdataaccessexception) +- [Hibernate Mapping Exception – Unknown Entity](https://www.baeldung.com/hibernate-mappingexception-unknown-entity) diff --git a/spring-freemarker/README.md b/spring-freemarker/README.md index ce8fb78f4d..410781f2ca 100644 --- a/spring-freemarker/README.md +++ b/spring-freemarker/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with FreeMarker ### Relevant Articles: -- [Introduction to Using FreeMarker in Spring MVC](http://www.baeldung.com/freemarker-in-spring-mvc-tutorial) +- [Introduction to Using FreeMarker in Spring MVC](https://www.baeldung.com/freemarker-in-spring-mvc-tutorial) diff --git a/spring-integration/README.md b/spring-integration/README.md index f2fbfe48b5..2e719a8674 100644 --- a/spring-integration/README.md +++ b/spring-integration/README.md @@ -3,8 +3,8 @@ This module contains articles about Spring Integration ### Relevant Articles: -- [Introduction to Spring Integration](http://www.baeldung.com/spring-integration) -- [Security In Spring Integration](http://www.baeldung.com/spring-integration-security) +- [Introduction to Spring Integration](https://www.baeldung.com/spring-integration) +- [Security In Spring Integration](https://www.baeldung.com/spring-integration-security) - [Spring Integration Java DSL](https://www.baeldung.com/spring-integration-java-dsl) - [Using Subflows in Spring Integration](https://www.baeldung.com/spring-integration-subflows) diff --git a/spring-jenkins-pipeline/README.md b/spring-jenkins-pipeline/README.md index 0086ae256d..9182823f52 100644 --- a/spring-jenkins-pipeline/README.md +++ b/spring-jenkins-pipeline/README.md @@ -4,7 +4,7 @@ This module contains articles about Spring with Jenkins ### Relevant articles -- [Intro to Jenkins 2 and the Power of Pipelines](http://www.baeldung.com/jenkins-pipelines) +- [Intro to Jenkins 2 and the Power of Pipelines](https://www.baeldung.com/jenkins-pipelines) ## Basic CRUD API with Spring Boot @@ -27,5 +27,3 @@ $ mvn spring-boot:run -Dserver.port=8989 Now with default configurations it will be available at: [http://localhost:8080](http://localhost:8080) Enjoy it :) - - diff --git a/spring-jersey/README.md b/spring-jersey/README.md index 6adc5f1375..3c6b0577c0 100644 --- a/spring-jersey/README.md +++ b/spring-jersey/README.md @@ -3,6 +3,6 @@ This module contains articles about Spring with Jersey ## REST API with Jersey & Spring Example Project -- [REST API with Jersey and Spring](http://www.baeldung.com/jersey-rest-api-with-spring) -- [JAX-RS Client with Jersey](http://www.baeldung.com/jersey-jax-rs-client) +- [REST API with Jersey and Spring](https://www.baeldung.com/jersey-rest-api-with-spring) +- [JAX-RS Client with Jersey](https://www.baeldung.com/jersey-jax-rs-client) - [Reactive JAX-RS Client API](https://www.baeldung.com/jax-rs-reactive-client) diff --git a/spring-jinq/README.md b/spring-jinq/README.md index b2fea32123..e049dc2ba8 100644 --- a/spring-jinq/README.md +++ b/spring-jinq/README.md @@ -4,5 +4,5 @@ This module contains articles about Spring with Jinq ## Relevant articles: -- [Introduction to Jinq with Spring](http://www.baeldung.com/spring-jinq) +- [Introduction to Jinq with Spring](https://www.baeldung.com/spring-jinq) diff --git a/spring-jms/README.md b/spring-jms/README.md index ef768d086f..fdeb64953a 100644 --- a/spring-jms/README.md +++ b/spring-jms/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with JMS ### Relevant Articles: -- [Getting Started with Spring JMS](http://www.baeldung.com/spring-jms) +- [Getting Started with Spring JMS](https://www.baeldung.com/spring-jms) diff --git a/spring-jooq/README.md b/spring-jooq/README.md index 36397fa7ed..515ab8be3c 100644 --- a/spring-jooq/README.md +++ b/spring-jooq/README.md @@ -3,8 +3,8 @@ This module contains articles about Spring with jOOQ ### Relevant Articles: -- [Spring Boot Support for jOOQ](http://www.baeldung.com/spring-boot-support-for-jooq) -- [Introduction to jOOQ with Spring](http://www.baeldung.com/jooq-with-spring) +- [Spring Boot Support for jOOQ](https://www.baeldung.com/spring-boot-support-for-jooq) +- [Introduction to jOOQ with Spring](https://www.baeldung.com/jooq-with-spring) In order to fix the error "Plugin execution not covered by lifecycle configuration: org.jooq:jooq-codegen-maven:3.7.3:generate (execution: default, phase: generate-sources)", right-click on the error message and choose "Mark goal generated as ignore in pom.xml". Until version 1.4.x, the maven-plugin-plugin was covered by the default lifecycle mapping that ships with m2e. diff --git a/spring-kafka/README.md b/spring-kafka/README.md index c04dda0a2f..f2fecde894 100644 --- a/spring-kafka/README.md +++ b/spring-kafka/README.md @@ -4,7 +4,7 @@ This module contains articles about Spring with Kafka ### Relevant articles -- [Intro to Apache Kafka with Spring](http://www.baeldung.com/spring-kafka) +- [Intro to Apache Kafka with Spring](https://www.baeldung.com/spring-kafka) ### Intro diff --git a/spring-katharsis/README.md b/spring-katharsis/README.md index c9391f7e22..d7454e6841 100644 --- a/spring-katharsis/README.md +++ b/spring-katharsis/README.md @@ -4,10 +4,8 @@ This module contains articles about Spring with Katharsis ### Relevant Articles: -- [JSON API in a Spring Application](http://www.baeldung.com/json-api-java-spring-web-app) +- [JSON API in a Spring Application](https://www.baeldung.com/json-api-java-spring-web-app) ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring - - diff --git a/spring-ldap/README.md b/spring-ldap/README.md index 3f592ab365..4872f897e1 100644 --- a/spring-ldap/README.md +++ b/spring-ldap/README.md @@ -4,5 +4,5 @@ This module contains articles about Spring LDAP ### Relevant articles -- [Spring LDAP Overview](http://www.baeldung.com/spring-ldap) -- [Guide to Spring Data LDAP](http://www.baeldung.com/spring-data-ldap) +- [Spring LDAP Overview](https://www.baeldung.com/spring-ldap) +- [Guide to Spring Data LDAP](https://www.baeldung.com/spring-data-ldap) diff --git a/spring-mobile/README.md b/spring-mobile/README.md index d4473c8c54..badd79d162 100644 --- a/spring-mobile/README.md +++ b/spring-mobile/README.md @@ -4,5 +4,5 @@ This module contains articles about Spring Mobile ## Relevant articles: -- [A Guide to Spring Mobile](http://www.baeldung.com/spring-mobile) +- [A Guide to Spring Mobile](https://www.baeldung.com/spring-mobile) diff --git a/spring-mockito/README.md b/spring-mockito/README.md index 7d7945a2fe..0ad8e05ce3 100644 --- a/spring-mockito/README.md +++ b/spring-mockito/README.md @@ -3,5 +3,5 @@ This module contains articles about Spring with Mockito ### Relevant Articles: -- [Injecting Mockito Mocks into Spring Beans](http://www.baeldung.com/injecting-mocks-in-spring) -- [Mockito ArgumentMatchers](http://www.baeldung.com/mockito-argument-matchers) +- [Injecting Mockito Mocks into Spring Beans](https://www.baeldung.com/injecting-mocks-in-spring) +- [Mockito ArgumentMatchers](https://www.baeldung.com/mockito-argument-matchers) diff --git a/spring-mvc-basics/README.md b/spring-mvc-basics/README.md index b257b3587b..a04c6e7ae7 100644 --- a/spring-mvc-basics/README.md +++ b/spring-mvc-basics/README.md @@ -7,12 +7,12 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: - [Spring MVC Tutorial](https://www.baeldung.com/spring-mvc-tutorial) -- [The Spring @Controller and @RestController Annotations](http://www.baeldung.com/spring-controller-vs-restcontroller) -- [A Guide to the ViewResolver in Spring MVC](http://www.baeldung.com/spring-mvc-view-resolver-tutorial) -- [Guide to Spring Handler Mappings](http://www.baeldung.com/spring-handler-mappings) -- [Spring MVC Content Negotiation](http://www.baeldung.com/spring-mvc-content-negotiation-json-xml) -- [Spring @RequestMapping New Shortcut Annotations](http://www.baeldung.com/spring-new-requestmapping-shortcuts) -- [Spring MVC Custom Validation](http://www.baeldung.com/spring-mvc-custom-validator) -- [Using Spring @ResponseStatus to Set HTTP Status Code](http://www.baeldung.com/spring-response-status) -- [Spring MVC and the @ModelAttribute Annotation](http://www.baeldung.com/spring-mvc-and-the-modelattribute-annotation) -- [The HttpMediaTypeNotAcceptableException in Spring MVC](http://www.baeldung.com/spring-httpmediatypenotacceptable) \ No newline at end of file +- [The Spring @Controller and @RestController Annotations](https://www.baeldung.com/spring-controller-vs-restcontroller) +- [A Guide to the ViewResolver in Spring MVC](https://www.baeldung.com/spring-mvc-view-resolver-tutorial) +- [Guide to Spring Handler Mappings](https://www.baeldung.com/spring-handler-mappings) +- [Spring MVC Content Negotiation](https://www.baeldung.com/spring-mvc-content-negotiation-json-xml) +- [Spring @RequestMapping New Shortcut Annotations](https://www.baeldung.com/spring-new-requestmapping-shortcuts) +- [Spring MVC Custom Validation](https://www.baeldung.com/spring-mvc-custom-validator) +- [Using Spring @ResponseStatus to Set HTTP Status Code](https://www.baeldung.com/spring-response-status) +- [Spring MVC and the @ModelAttribute Annotation](https://www.baeldung.com/spring-mvc-and-the-modelattribute-annotation) +- [The HttpMediaTypeNotAcceptableException in Spring MVC](https://www.baeldung.com/spring-httpmediatypenotacceptable) diff --git a/spring-mvc-forms-jsp/README.md b/spring-mvc-forms-jsp/README.md index 941191858d..2c077f5171 100644 --- a/spring-mvc-forms-jsp/README.md +++ b/spring-mvc-forms-jsp/README.md @@ -3,7 +3,7 @@ This module contains articles about Spring MVC Forms using JSP ### Relevant Articles -- [MaxUploadSizeExceededException in Spring](http://www.baeldung.com/spring-maxuploadsizeexceeded) -- [Getting Started with Forms in Spring MVC](http://www.baeldung.com/spring-mvc-form-tutorial) -- [Form Validation with AngularJS and Spring MVC](http://www.baeldung.com/validation-angularjs-spring-mvc) -- [A Guide to the JSTL Library](http://www.baeldung.com/jstl) +- [MaxUploadSizeExceededException in Spring](https://www.baeldung.com/spring-maxuploadsizeexceeded) +- [Getting Started with Forms in Spring MVC](https://www.baeldung.com/spring-mvc-form-tutorial) +- [Form Validation with AngularJS and Spring MVC](https://www.baeldung.com/validation-angularjs-spring-mvc) +- [A Guide to the JSTL Library](https://www.baeldung.com/jstl) diff --git a/spring-mvc-forms-thymeleaf/README.md b/spring-mvc-forms-thymeleaf/README.md index 7e011bdc60..57fa32901c 100644 --- a/spring-mvc-forms-thymeleaf/README.md +++ b/spring-mvc-forms-thymeleaf/README.md @@ -4,6 +4,6 @@ This module contains articles about Spring MVC Forms using Thymeleaf ### Relevant articles -- [Session Attributes in Spring MVC](http://www.baeldung.com/spring-mvc-session-attributes) -- [Binding a List in Thymeleaf](http://www.baeldung.com/thymeleaf-list) +- [Session Attributes in Spring MVC](https://www.baeldung.com/spring-mvc-session-attributes) +- [Binding a List in Thymeleaf](https://www.baeldung.com/thymeleaf-list) diff --git a/spring-mvc-java/README.md b/spring-mvc-java/README.md index ed9ee20f66..7088162496 100644 --- a/spring-mvc-java/README.md +++ b/spring-mvc-java/README.md @@ -7,17 +7,17 @@ This module contains articles about Spring MVC with Java configuration The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Introduction to Pointcut Expressions in Spring](http://www.baeldung.com/spring-aop-pointcut-tutorial) -- [Introduction to Advice Types in Spring](http://www.baeldung.com/spring-aop-advice-tutorial) -- [Integration Testing in Spring](http://www.baeldung.com/integration-testing-in-spring) -- [A Quick Guide to Spring MVC Matrix Variables](http://www.baeldung.com/spring-mvc-matrix-variables) -- [Intro to WebSockets with Spring](http://www.baeldung.com/websockets-spring) -- [File Upload with Spring MVC](http://www.baeldung.com/spring-file-upload) -- [Introduction to HtmlUnit](http://www.baeldung.com/htmlunit) -- [Upload and Display Excel Files with Spring MVC](http://www.baeldung.com/spring-mvc-excel-files) -- [web.xml vs Initializer with Spring](http://www.baeldung.com/spring-xml-vs-java-config) -- [Spring MVC @PathVariable with a dot (.) gets truncated](http://www.baeldung.com/spring-mvc-pathvariable-dot) -- [A Quick Example of Spring Websockets’ @SendToUser Annotation](http://www.baeldung.com/spring-websockets-sendtouser) +- [Introduction to Pointcut Expressions in Spring](https://www.baeldung.com/spring-aop-pointcut-tutorial) +- [Introduction to Advice Types in Spring](https://www.baeldung.com/spring-aop-advice-tutorial) +- [Integration Testing in Spring](https://www.baeldung.com/integration-testing-in-spring) +- [A Quick Guide to Spring MVC Matrix Variables](https://www.baeldung.com/spring-mvc-matrix-variables) +- [Intro to WebSockets with Spring](https://www.baeldung.com/websockets-spring) +- [File Upload with Spring MVC](https://www.baeldung.com/spring-file-upload) +- [Introduction to HtmlUnit](https://www.baeldung.com/htmlunit) +- [Upload and Display Excel Files with Spring MVC](https://www.baeldung.com/spring-mvc-excel-files) +- [web.xml vs Initializer with Spring](https://www.baeldung.com/spring-xml-vs-java-config) +- [Spring MVC @PathVariable with a dot (.) gets truncated](https://www.baeldung.com/spring-mvc-pathvariable-dot) +- [A Quick Example of Spring Websockets’ @SendToUser Annotation](https://www.baeldung.com/spring-websockets-sendtouser) - [Working with Date Parameters in Spring](https://www.baeldung.com/spring-date-parameters) - [A Java Web Application Without a web.xml](https://www.baeldung.com/java-web-app-without-web-xml) - [The HttpMediaTypeNotAcceptableException in Spring MVC](https://www.baeldung.com/spring-httpmediatypenotacceptable) diff --git a/spring-mvc-kotlin/README.md b/spring-mvc-kotlin/README.md index bd0593731f..590c627cb6 100644 --- a/spring-mvc-kotlin/README.md +++ b/spring-mvc-kotlin/README.md @@ -3,7 +3,7 @@ This module contains articles about Spring MVC with Kotlin ### Relevant articles -- [Spring MVC Setup with Kotlin](http://www.baeldung.com/spring-mvc-kotlin) -- [Working with Kotlin and JPA](http://www.baeldung.com/kotlin-jpa) -- [Kotlin-allopen and Spring](http://www.baeldung.com/kotlin-allopen-spring) +- [Spring MVC Setup with Kotlin](https://www.baeldung.com/spring-mvc-kotlin) +- [Working with Kotlin and JPA](https://www.baeldung.com/kotlin-jpa) +- [Kotlin-allopen and Spring](https://www.baeldung.com/kotlin-allopen-spring) - [MockMvc Kotlin DSL](https://www.baeldung.com/mockmvc-kotlin-dsl) diff --git a/spring-mvc-simple/README.md b/spring-mvc-simple/README.md index e2068dcae0..ae03fedf3c 100644 --- a/spring-mvc-simple/README.md +++ b/spring-mvc-simple/README.md @@ -4,12 +4,12 @@ This module contains articles about Spring MVC ## Relevant articles: -- [HandlerAdapters in Spring MVC](http://www.baeldung.com/spring-mvc-handler-adapters) -- [Template Engines for Spring](http://www.baeldung.com/spring-template-engines) -- [Spring 5 and Servlet 4 – The PushBuilder](http://www.baeldung.com/spring-5-push) -- [Servlet Redirect vs Forward](http://www.baeldung.com/servlet-redirect-forward) -- [Apache Tiles Integration with Spring MVC](http://www.baeldung.com/spring-mvc-apache-tiles) -- [Guide to Spring Email](http://www.baeldung.com/spring-email) +- [HandlerAdapters in Spring MVC](https://www.baeldung.com/spring-mvc-handler-adapters) +- [Template Engines for Spring](https://www.baeldung.com/spring-template-engines) +- [Spring 5 and Servlet 4 – The PushBuilder](https://www.baeldung.com/spring-5-push) +- [Servlet Redirect vs Forward](https://www.baeldung.com/servlet-redirect-forward) +- [Apache Tiles Integration with Spring MVC](https://www.baeldung.com/spring-mvc-apache-tiles) +- [Guide to Spring Email](https://www.baeldung.com/spring-email) - [Request Method Not Supported (405) in Spring](https://www.baeldung.com/spring-request-method-not-supported-405) - [Spring @RequestParam Annotation](https://www.baeldung.com/spring-request-param) - More articles: [[more -->]](/spring-mvc-simple-2) \ No newline at end of file diff --git a/spring-mvc-velocity/README.md b/spring-mvc-velocity/README.md index fed4ce260e..99c4c032de 100644 --- a/spring-mvc-velocity/README.md +++ b/spring-mvc-velocity/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring MVC with Velocity ### Relevant Articles: -- [Quick Guide to Spring MVC with Velocity](http://www.baeldung.com/spring-mvc-with-velocity) +- [Quick Guide to Spring MVC with Velocity](https://www.baeldung.com/spring-mvc-with-velocity) diff --git a/spring-mvc-webflow/README.md b/spring-mvc-webflow/README.md index dff99ff490..f89b97963e 100644 --- a/spring-mvc-webflow/README.md +++ b/spring-mvc-webflow/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring MVC Web Flow ### Relevant Articles: -- [Guide to Spring Web Flow](http://www.baeldung.com/spring-web-flow) +- [Guide to Spring Web Flow](https://www.baeldung.com/spring-web-flow) diff --git a/spring-mvc-xml/README.md b/spring-mvc-xml/README.md index c08cfb1430..b6a34475ea 100644 --- a/spring-mvc-xml/README.md +++ b/spring-mvc-xml/README.md @@ -6,15 +6,14 @@ This module contains articles about Spring MVC with XML configuration The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Java Session Timeout](http://www.baeldung.com/servlet-session-timeout) -- [Returning Image/Media Data with Spring MVC](http://www.baeldung.com/spring-mvc-image-media-data) -- [Geolocation by IP in Java](http://www.baeldung.com/geolocation-by-ip-with-maxmind) -- [Guide to JavaServer Pages (JSP)](http://www.baeldung.com/jsp) -- [Exploring SpringMVC’s Form Tag Library](http://www.baeldung.com/spring-mvc-form-tags) -- [web.xml vs Initializer with Spring](http://www.baeldung.com/spring-xml-vs-java-config) +- [Java Session Timeout](https://www.baeldung.com/servlet-session-timeout) +- [Returning Image/Media Data with Spring MVC](https://www.baeldung.com/spring-mvc-image-media-data) +- [Geolocation by IP in Java](https://www.baeldung.com/geolocation-by-ip-with-maxmind) +- [Guide to JavaServer Pages (JSP)](https://www.baeldung.com/jsp) +- [Exploring SpringMVC’s Form Tag Library](https://www.baeldung.com/spring-mvc-form-tags) +- [web.xml vs Initializer with Spring](https://www.baeldung.com/spring-xml-vs-java-config) - [A Java Web Application Without a web.xml](https://www.baeldung.com/java-web-app-without-web-xml) - [Validating RequestParams and PathVariables in Spring](https://www.baeldung.com/spring-validate-requestparam-pathvariable) ## Spring MVC with XML Configuration Example Project - access a sample jsp page at: `http://localhost:8080/spring-mvc-xml/sample.html` - diff --git a/spring-protobuf/README.md b/spring-protobuf/README.md index d8737014a7..37f35808e1 100644 --- a/spring-protobuf/README.md +++ b/spring-protobuf/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with Protocol Buffers ### Relevant Articles: -- [Spring REST API with Protocol Buffers](http://www.baeldung.com/spring-rest-api-with-protocol-buffers) +- [Spring REST API with Protocol Buffers](https://www.baeldung.com/spring-rest-api-with-protocol-buffers) diff --git a/spring-quartz/README.md b/spring-quartz/README.md index 45e20f6076..d9257066d4 100644 --- a/spring-quartz/README.md +++ b/spring-quartz/README.md @@ -3,7 +3,7 @@ This module contains articles about Spring with Quartz ### Relevant Articles: -- [Scheduling in Spring with Quartz](http://www.baeldung.com/spring-quartz-schedule) +- [Scheduling in Spring with Quartz](https://www.baeldung.com/spring-quartz-schedule) ## #Scheduling in Spring with Quartz Example Project @@ -23,5 +23,3 @@ This is the first example where we configure a basic scheduler. - To configure scheduler using Quartz API: `using.spring.schedulerFactory=false` - - diff --git a/spring-reactive-kotlin/README.md b/spring-reactive-kotlin/README.md index 46f4b580fd..629f7e7f58 100644 --- a/spring-reactive-kotlin/README.md +++ b/spring-reactive-kotlin/README.md @@ -3,4 +3,4 @@ This module contains articles about reactive Kotlin ### Relevant Articles: -- [Spring Webflux with Kotlin](http://www.baeldung.com/spring-webflux-kotlin) +- [Spring Webflux with Kotlin](https://www.baeldung.com/spring-webflux-kotlin) diff --git a/spring-reactor/README.md b/spring-reactor/README.md index e7d7eb927d..b92478f6fb 100644 --- a/spring-reactor/README.md +++ b/spring-reactor/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring Reactor ## Relevant articles: -- [Introduction to Spring Reactor](http://www.baeldung.com/spring-reactor) +- [Introduction to Spring Reactor](https://www.baeldung.com/spring-reactor) diff --git a/spring-remoting/README.md b/spring-remoting/README.md index 247aa52db2..a98893ebcb 100644 --- a/spring-remoting/README.md +++ b/spring-remoting/README.md @@ -3,11 +3,11 @@ This module contains articles about Spring Remoting ### Relevant Articles -- [Intro to Spring Remoting with HTTP Invokers](http://www.baeldung.com/spring-remoting-http-invoker) -- [Spring Remoting with Hessian and Burlap](http://www.baeldung.com/spring-remoting-hessian-burlap) -- [Spring Remoting with AMQP](http://www.baeldung.com/spring-remoting-amqp) -- [Spring Remoting with JMS and ActiveMQ](http://www.baeldung.com/spring-remoting-jms) -- [Spring Remoting with RMI](http://www.baeldung.com/spring-remoting-rmi) +- [Intro to Spring Remoting with HTTP Invokers](https://www.baeldung.com/spring-remoting-http-invoker) +- [Spring Remoting with Hessian and Burlap](https://www.baeldung.com/spring-remoting-hessian-burlap) +- [Spring Remoting with AMQP](https://www.baeldung.com/spring-remoting-amqp) +- [Spring Remoting with JMS and ActiveMQ](https://www.baeldung.com/spring-remoting-jms) +- [Spring Remoting with RMI](https://www.baeldung.com/spring-remoting-rmi) ### Overview This Maven project contains the Java source code for various modules used in the Spring Remoting series of articles. diff --git a/spring-rest-angular/README.md b/spring-rest-angular/README.md index 5cd2570152..038160db9d 100644 --- a/spring-rest-angular/README.md +++ b/spring-rest-angular/README.md @@ -4,4 +4,4 @@ This module contains articles about REST APIs with Spring and Angular ### Relevant Articles: -- [Pagination with Spring REST and AngularJS table](http://www.baeldung.com/pagination-with-a-spring-rest-api-and-an-angularjs-table) +- [Pagination with Spring REST and AngularJS table](https://www.baeldung.com/pagination-with-a-spring-rest-api-and-an-angularjs-table) diff --git a/spring-rest-full/README.md b/spring-rest-full/README.md index a0e6e74179..a0ba8df27d 100644 --- a/spring-rest-full/README.md +++ b/spring-rest-full/README.md @@ -9,9 +9,9 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Integration Testing with the Maven Cargo plugin](http://www.baeldung.com/integration-testing-with-the-maven-cargo-plugin) -- [Project Configuration with Spring](http://www.baeldung.com/project-configuration-with-spring) -- [Metrics for your Spring REST API](http://www.baeldung.com/spring-rest-api-metrics) +- [Integration Testing with the Maven Cargo plugin](https://www.baeldung.com/integration-testing-with-the-maven-cargo-plugin) +- [Project Configuration with Spring](https://www.baeldung.com/project-configuration-with-spring) +- [Metrics for your Spring REST API](https://www.baeldung.com/spring-rest-api-metrics) - [Spring Security Expressions - hasRole Example](https://www.baeldung.com/spring-security-expressions-basic) diff --git a/spring-rest-hal-browser/README.md b/spring-rest-hal-browser/README.md index 027937f116..90337aad1a 100644 --- a/spring-rest-hal-browser/README.md +++ b/spring-rest-hal-browser/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring REST with the HAL browser ### Relevant Articles: -- [Spring REST and HAL Browser](http://www.baeldung.com/spring-rest-hal) +- [Spring REST and HAL Browser](https://www.baeldung.com/spring-rest-hal) diff --git a/spring-rest-query-language/README.md b/spring-rest-query-language/README.md index 383cecec36..4458fc93fb 100644 --- a/spring-rest-query-language/README.md +++ b/spring-rest-query-language/README.md @@ -10,12 +10,12 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [REST Query Language with Spring and JPA Criteria](http://www.baeldung.com/rest-search-language-spring-jpa-criteria) -- [REST Query Language with Spring Data JPA Specifications](http://www.baeldung.com/rest-api-search-language-spring-data-specifications) -- [REST Query Language with Spring Data JPA and QueryDSL](http://www.baeldung.com/rest-api-search-language-spring-data-querydsl) -- [REST Query Language – Advanced Search Operations](http://www.baeldung.com/rest-api-query-search-language-more-operations) -- [REST Query Language with RSQL](http://www.baeldung.com/rest-api-search-language-rsql-fiql) -- [REST Query Language – Implementing OR Operation](http://www.baeldung.com/rest-api-query-search-or-operation) +- [REST Query Language with Spring and JPA Criteria](https://www.baeldung.com/rest-search-language-spring-jpa-criteria) +- [REST Query Language with Spring Data JPA Specifications](https://www.baeldung.com/rest-api-search-language-spring-data-specifications) +- [REST Query Language with Spring Data JPA and QueryDSL](https://www.baeldung.com/rest-api-search-language-spring-data-querydsl) +- [REST Query Language – Advanced Search Operations](https://www.baeldung.com/rest-api-query-search-language-more-operations) +- [REST Query Language with RSQL](https://www.baeldung.com/rest-api-search-language-rsql-fiql) +- [REST Query Language – Implementing OR Operation](https://www.baeldung.com/rest-api-query-search-or-operation) ### Build the Project ``` diff --git a/spring-rest-shell/README.md b/spring-rest-shell/README.md index 0b126e6b1c..3c04bb457e 100644 --- a/spring-rest-shell/README.md +++ b/spring-rest-shell/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring REST Shell ### Relevant Articles -- [Introduction to Spring REST Shell](http://www.baeldung.com/spring-rest-shell) +- [Introduction to Spring REST Shell](https://www.baeldung.com/spring-rest-shell) diff --git a/spring-rest-simple/README.md b/spring-rest-simple/README.md index d60f57b227..1ad32bf120 100644 --- a/spring-rest-simple/README.md +++ b/spring-rest-simple/README.md @@ -4,9 +4,9 @@ This module contains articles about REST APIs in Spring ## Relevant articles: -- [Guide to UriComponentsBuilder in Spring](http://www.baeldung.com/spring-uricomponentsbuilder) -- [Returning Custom Status Codes from Spring Controllers](http://www.baeldung.com/spring-mvc-controller-custom-http-status-code) -- [Spring RequestMapping](http://www.baeldung.com/spring-requestmapping) -- [Spring and Apache FileUpload](http://www.baeldung.com/spring-apache-file-upload) -- [Test a REST API with curl](http://www.baeldung.com/curl-rest) +- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder) +- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code) +- [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping) +- [Spring and Apache FileUpload](https://www.baeldung.com/spring-apache-file-upload) +- [Test a REST API with curl](https://www.baeldung.com/curl-rest) - [CORS with Spring](https://www.baeldung.com/spring-cors) diff --git a/spring-rest/README.md b/spring-rest/README.md index 1d713c05c0..ac12066e8f 100644 --- a/spring-rest/README.md +++ b/spring-rest/README.md @@ -6,20 +6,20 @@ This module contains articles about REST APIs with Spring The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Spring @RequestMapping](http://www.baeldung.com/spring-requestmapping) -- [Returning Custom Status Codes from Spring Controllers](http://www.baeldung.com/spring-mvc-controller-custom-http-status-code) -- [Binary Data Formats in a Spring REST API](http://www.baeldung.com/spring-rest-api-with-binary-data-formats) -- [Guide to UriComponentsBuilder in Spring](http://www.baeldung.com/spring-uricomponentsbuilder) -- [Introduction to FindBugs](http://www.baeldung.com/intro-to-findbugs) -- [A Custom Media Type for a Spring REST API](http://www.baeldung.com/spring-rest-custom-media-type) -- [HTTP PUT vs HTTP PATCH in a REST API](http://www.baeldung.com/http-put-patch-difference-spring) -- [Spring – Log Incoming Requests](http://www.baeldung.com/spring-http-logging) -- [Introduction to CheckStyle](http://www.baeldung.com/checkstyle-java) -- [How to Change the Default Port in Spring Boot](http://www.baeldung.com/spring-boot-change-port) -- [Guide to DeferredResult in Spring](http://www.baeldung.com/spring-deferred-result) -- [Spring Custom Property Editor](http://www.baeldung.com/spring-mvc-custom-property-editor) -- [Using the Spring RestTemplate Interceptor](http://www.baeldung.com/spring-rest-template-interceptor) -- [Get and Post Lists of Objects with RestTemplate](http://www.baeldung.com/spring-rest-template-list) -- [How to Set a Header on a Response with Spring 5](http://www.baeldung.com/spring-response-header) -- [Uploading MultipartFile with Spring RestTemplate](http://www.baeldung.com/spring-rest-template-multipart-upload) -- [Download an Image or a File with Spring MVC](http://www.baeldung.com/spring-controller-return-image-file) +- [Spring @RequestMapping](https://www.baeldung.com/spring-requestmapping) +- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code) +- [Binary Data Formats in a Spring REST API](https://www.baeldung.com/spring-rest-api-with-binary-data-formats) +- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder) +- [Introduction to FindBugs](https://www.baeldung.com/intro-to-findbugs) +- [A Custom Media Type for a Spring REST API](https://www.baeldung.com/spring-rest-custom-media-type) +- [HTTP PUT vs HTTP PATCH in a REST API](https://www.baeldung.com/http-put-patch-difference-spring) +- [Spring – Log Incoming Requests](https://www.baeldung.com/spring-http-logging) +- [Introduction to CheckStyle](https://www.baeldung.com/checkstyle-java) +- [How to Change the Default Port in Spring Boot](https://www.baeldung.com/spring-boot-change-port) +- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result) +- [Spring Custom Property Editor](https://www.baeldung.com/spring-mvc-custom-property-editor) +- [Using the Spring RestTemplate Interceptor](https://www.baeldung.com/spring-rest-template-interceptor) +- [Get and Post Lists of Objects with RestTemplate](https://www.baeldung.com/spring-rest-template-list) +- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) +- [Uploading MultipartFile with Spring RestTemplate](https://www.baeldung.com/spring-rest-template-multipart-upload) +- [Download an Image or a File with Spring MVC](https://www.baeldung.com/spring-controller-return-image-file) diff --git a/spring-resttemplate/README.md b/spring-resttemplate/README.md index 9b75e1aa81..e98af0e787 100644 --- a/spring-resttemplate/README.md +++ b/spring-resttemplate/README.md @@ -6,10 +6,10 @@ This module contains articles about Spring RestTemplate The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [The Guide to RestTemplate](http://www.baeldung.com/rest-template) -- [Exploring the Spring Boot TestRestTemplate](http://www.baeldung.com/spring-boot-testresttemplate) -- [Spring RestTemplate Error Handling](http://www.baeldung.com/spring-rest-template-error-handling) -- [Configure a RestTemplate with RestTemplateBuilder](http://www.baeldung.com/spring-rest-template-builder) +- [The Guide to RestTemplate](https://www.baeldung.com/rest-template) +- [Exploring the Spring Boot TestRestTemplate](https://www.baeldung.com/spring-boot-testresttemplate) +- [Spring RestTemplate Error Handling](https://www.baeldung.com/spring-rest-template-error-handling) +- [Configure a RestTemplate with RestTemplateBuilder](https://www.baeldung.com/spring-rest-template-builder) - [Mocking a RestTemplate in Spring](https://www.baeldung.com/spring-mock-rest-template) - [RestTemplate Post Request with JSON](https://www.baeldung.com/spring-resttemplate-post-json) - [Download a Large File Through a Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-download-large-file) diff --git a/spring-roo/README.md b/spring-roo/README.md index 5a8ce6e30f..abbc4249d4 100644 --- a/spring-roo/README.md +++ b/spring-roo/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring Roo ### Relevant Articles: -[Quick Guide to Spring Roo](http://www.baeldung.com/spring-roo) +[Quick Guide to Spring Roo](https://www.baeldung.com/spring-roo) diff --git a/spring-security-acl/README.md b/spring-security-acl/README.md index 2f95793f8d..b2f42d5c29 100644 --- a/spring-security-acl/README.md +++ b/spring-security-acl/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring Security ACL ### Relevant Articles -- [Introduction to Spring Security ACL](http://www.baeldung.com/spring-security-acl) +- [Introduction to Spring Security ACL](https://www.baeldung.com/spring-security-acl) diff --git a/spring-security-cache-control/README.md b/spring-security-cache-control/README.md index fc5bdda1f6..1c7cbfd096 100644 --- a/spring-security-cache-control/README.md +++ b/spring-security-cache-control/README.md @@ -3,4 +3,4 @@ This module contains articles about cache control with Spring Security ### Relevant Articles: -- [Spring Security – Cache Control Headers](http://www.baeldung.com/spring-security-cache-control-headers) +- [Spring Security – Cache Control Headers](https://www.baeldung.com/spring-security-cache-control-headers) diff --git a/spring-security-core/README.md b/spring-security-core/README.md index 3dfcb276d7..3579e5e759 100644 --- a/spring-security-core/README.md +++ b/spring-security-core/README.md @@ -3,9 +3,9 @@ This module contains articles about core Spring Security ### Relevant Articles: -- [Spring Security – @PreFilter and @PostFilter](http://www.baeldung.com/spring-security-prefilter-postfilter) -- [Spring Boot Authentication Auditing Support](http://www.baeldung.com/spring-boot-authentication-audit) -- [Introduction to Spring Method Security](http://www.baeldung.com/spring-security-method-security) +- [Spring Security – @PreFilter and @PostFilter](https://www.baeldung.com/spring-security-prefilter-postfilter) +- [Spring Boot Authentication Auditing Support](https://www.baeldung.com/spring-boot-authentication-audit) +- [Introduction to Spring Method Security](https://www.baeldung.com/spring-security-method-security) - [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy) ### @PreFilter and @PostFilter annotations @@ -13,5 +13,3 @@ This module contains articles about core Spring Security #### Build the Project `mvn clean install` - - diff --git a/spring-security-mvc-boot/README.md b/spring-security-mvc-boot/README.md index 150ea3eee9..7dcfe4d70f 100644 --- a/spring-security-mvc-boot/README.md +++ b/spring-security-mvc-boot/README.md @@ -6,13 +6,13 @@ This module contains articles about Spring Security with Spring MVC in Boot appl The "REST With Spring" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [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) -- [Spring Security: Authentication with a Database-backed UserDetailsService](http://www.baeldung.com/spring-security-authentication-with-a-database) -- [Two Login Pages with Spring Security](http://www.baeldung.com/spring-security-two-login-pages) -- [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) -- [Granted Authority Versus Role in Spring Security](http://www.baeldung.com/spring-security-granted-authority-vs-role) +- [A Custom Security Expression with Spring Security](https://www.baeldung.com/spring-security-create-new-custom-security-expression) +- [Custom AccessDecisionVoters in Spring Security](https://www.baeldung.com/spring-security-custom-voter) +- [Spring Security: Authentication with a Database-backed UserDetailsService](https://www.baeldung.com/spring-security-authentication-with-a-database) +- [Two Login Pages with Spring Security](https://www.baeldung.com/spring-security-two-login-pages) +- [Multiple Entry Points in Spring Security](https://www.baeldung.com/spring-security-multiple-entry-points) +- [Multiple Authentication Providers in Spring Security](https://www.baeldung.com/spring-security-multiple-auth-providers) +- [Granted Authority Versus Role in Spring Security](https://www.baeldung.com/spring-security-granted-authority-vs-role) - [Spring Data with Spring Security](https://www.baeldung.com/spring-data-security) - [Spring Security – Whitelist IP Range](https://www.baeldung.com/spring-security-whitelist-ip-range) - [Find the Registered Spring Security Filters](https://www.baeldung.com/spring-security-registered-filters) diff --git a/spring-security-mvc-custom/README.md b/spring-security-mvc-custom/README.md index 84bdec3c10..1a131f4c23 100644 --- a/spring-security-mvc-custom/README.md +++ b/spring-security-mvc-custom/README.md @@ -6,13 +6,13 @@ This module contains articles about Spring Security with custom MVC applications The "REST With Spring" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Spring Security Remember Me](http://www.baeldung.com/spring-security-remember-me) -- [Redirect to different pages after Login with Spring Security](http://www.baeldung.com/spring_redirect_after_login) -- [Changing Spring Model Parameters with Handler Interceptor](http://www.baeldung.com/spring-model-parameters-with-handler-interceptor) -- [Introduction to Spring MVC HandlerInterceptor](http://www.baeldung.com/spring-mvc-handlerinterceptor) -- [Using a Custom Spring MVC’s Handler Interceptor to Manage Sessions](http://www.baeldung.com/spring-mvc-custom-handler-interceptor) -- [A Guide to CSRF Protection in Spring Security](http://www.baeldung.com/spring-security-csrf) -- [How to Manually Authenticate User with Spring Security](http://www.baeldung.com/manually-set-user-authentication-spring-security) +- [Spring Security Remember Me](https://www.baeldung.com/spring-security-remember-me) +- [Redirect to different pages after Login with Spring Security](https://www.baeldung.com/spring_redirect_after_login) +- [Changing Spring Model Parameters with Handler Interceptor](https://www.baeldung.com/spring-model-parameters-with-handler-interceptor) +- [Introduction to Spring MVC HandlerInterceptor](https://www.baeldung.com/spring-mvc-handlerinterceptor) +- [Using a Custom Spring MVC’s Handler Interceptor to Manage Sessions](https://www.baeldung.com/spring-mvc-custom-handler-interceptor) +- [A Guide to CSRF Protection in Spring Security](https://www.baeldung.com/spring-security-csrf) +- [How to Manually Authenticate User with Spring Security](https://www.baeldung.com/manually-set-user-authentication-spring-security) ### Build the Project ``` diff --git a/spring-security-mvc-digest-auth/README.md b/spring-security-mvc-digest-auth/README.md index da612e273b..0d36dbfd63 100644 --- a/spring-security-mvc-digest-auth/README.md +++ b/spring-security-mvc-digest-auth/README.md @@ -6,6 +6,6 @@ This module contains articles about digest authentication with Spring Security The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Article: -- [Spring Security Digest Authentication](http://www.baeldung.com/spring-security-digest-authentication) -- [RestTemplate with Digest Authentication](http://www.baeldung.com/resttemplate-digest-authentication) +- [Spring Security Digest Authentication](https://www.baeldung.com/spring-security-digest-authentication) +- [RestTemplate with Digest Authentication](https://www.baeldung.com/resttemplate-digest-authentication) diff --git a/spring-security-mvc-ldap/README.md b/spring-security-mvc-ldap/README.md index fe04cd23fa..3230c0398a 100644 --- a/spring-security-mvc-ldap/README.md +++ b/spring-security-mvc-ldap/README.md @@ -6,8 +6,8 @@ This module contains articles about Spring Security LDAP The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Article: -- [Spring Security – security none, filters none, access permitAll](http://www.baeldung.com/security-none-filters-none-access-permitAll) -- [Intro to Spring Security LDAP](http://www.baeldung.com/spring-security-ldap) +- [Spring Security – security none, filters none, access permitAll](https://www.baeldung.com/security-none-filters-none-access-permitAll) +- [Intro to Spring Security LDAP](https://www.baeldung.com/spring-security-ldap) ### Notes - the project uses Spring Boot - simply run 'SampleLDAPApplication.java' to start up Spring Boot with a Tomcat container and embedded LDAP server. diff --git a/spring-security-mvc-login/README.md b/spring-security-mvc-login/README.md index a20a04edec..5d92a8e1b4 100644 --- a/spring-security-mvc-login/README.md +++ b/spring-security-mvc-login/README.md @@ -6,13 +6,13 @@ This module contains articles about login mechanisms with Spring Security The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Spring Security Form Login](http://www.baeldung.com/spring-security-login) -- [Spring Security Logout](http://www.baeldung.com/spring-security-logout) -- [Spring Security Expressions – hasRole Example](http://www.baeldung.com/spring-security-expressions-basic) -- [Spring HTTP/HTTPS Channel Security](http://www.baeldung.com/spring-channel-security-https) -- [Spring Security – Customize the 403 Forbidden/Access Denied Page](http://www.baeldung.com/spring-security-custom-access-denied-page) -- [Spring Security – Redirect to the Previous URL After Login](http://www.baeldung.com/spring-security-redirect-login) -- [Spring Security Custom AuthenticationFailureHandler](http://www.baeldung.com/spring-security-custom-authentication-failure-handler) +- [Spring Security Form Login](https://www.baeldung.com/spring-security-login) +- [Spring Security Logout](https://www.baeldung.com/spring-security-logout) +- [Spring Security Expressions – hasRole Example](https://www.baeldung.com/spring-security-expressions-basic) +- [Spring HTTP/HTTPS Channel Security](https://www.baeldung.com/spring-channel-security-https) +- [Spring Security – Customize the 403 Forbidden/Access Denied Page](https://www.baeldung.com/spring-security-custom-access-denied-page) +- [Spring Security – Redirect to the Previous URL After Login](https://www.baeldung.com/spring-security-redirect-login) +- [Spring Security Custom AuthenticationFailureHandler](https://www.baeldung.com/spring-security-custom-authentication-failure-handler) ### Build the Project ``` diff --git a/spring-security-mvc-persisted-remember-me/README.md b/spring-security-mvc-persisted-remember-me/README.md index 260e55198a..e3003e89e2 100644 --- a/spring-security-mvc-persisted-remember-me/README.md +++ b/spring-security-mvc-persisted-remember-me/README.md @@ -6,7 +6,7 @@ This module contains articles about 'remember me' with Spring Security The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Spring Security – Persistent Remember Me](http://www.baeldung.com/spring-security-persistent-remember-me) +- [Spring Security – Persistent Remember Me](https://www.baeldung.com/spring-security-persistent-remember-me) ### Build the Project ``` diff --git a/spring-security-mvc-socket/README.md b/spring-security-mvc-socket/README.md index 187bbe82b0..d134d19c84 100644 --- a/spring-security-mvc-socket/README.md +++ b/spring-security-mvc-socket/README.md @@ -4,7 +4,7 @@ This module contains articles about WebSockets with Spring Security ### Relevant Articles: -- [Intro to Security and WebSockets](http://www.baeldung.com/spring-security-websockets) +- [Intro to Security and WebSockets](https://www.baeldung.com/spring-security-websockets) - [Spring WebSockets: Build an User Chat](https://www.baeldung.com/spring-websockets-send-message-to-user) - [REST vs WebSockets](https://www.baeldung.com/rest-vs-websockets) @@ -15,5 +15,3 @@ To build the project, run the command: mvn clean install. This will build a war Alternatively, run the project from an IDE. To login, use credentials from the data.sql file in src/main/resource, eg: user/password. - - diff --git a/spring-security-mvc/README.md b/spring-security-mvc/README.md index ad55e903c5..a458127c61 100644 --- a/spring-security-mvc/README.md +++ b/spring-security-mvc/README.md @@ -6,8 +6,8 @@ This module contains articles about Spring Security in MVC applications The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [HttpSessionListener Example – Monitoring](http://www.baeldung.com/httpsessionlistener_with_metrics) -- [Control the Session with Spring Security](http://www.baeldung.com/spring-security-session) +- [HttpSessionListener Example – Monitoring](https://www.baeldung.com/httpsessionlistener_with_metrics) +- [Control the Session with Spring Security](https://www.baeldung.com/spring-security-session) ### Build the Project diff --git a/spring-security-openid/README.md b/spring-security-openid/README.md index 1512ffbde5..1f856fe191 100644 --- a/spring-security-openid/README.md +++ b/spring-security-openid/README.md @@ -4,7 +4,7 @@ This module contains articles about OpenID with Spring Security ### Relevant articles -- [Spring Security and OpenID Connect](http://www.baeldung.com/spring-security-openid-connect) +- [Spring Security and OpenID Connect](https://www.baeldung.com/spring-security-openid-connect) ### OpenID Connect with Spring Security diff --git a/spring-security-react/README.md b/spring-security-react/README.md index 4eb402c699..6c9e1dad7a 100644 --- a/spring-security-react/README.md +++ b/spring-security-react/README.md @@ -8,7 +8,7 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -* [Spring Security Login Page with React](http://www.baeldung.com/spring-security-login-react) +* [Spring Security Login Page with React](https://www.baeldung.com/spring-security-login-react) ### Build the Project diff --git a/spring-security-rest-basic-auth/README.md b/spring-security-rest-basic-auth/README.md index 41d463f1e2..d12427a106 100644 --- a/spring-security-rest-basic-auth/README.md +++ b/spring-security-rest-basic-auth/README.md @@ -7,6 +7,6 @@ This module contains articles about basic authentication in RESTful APIs with Sp The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Basic Authentication with the RestTemplate](http://www.baeldung.com/how-to-use-resttemplate-with-basic-authentication-in-spring) -- [A Custom Filter in the Spring Security Filter Chain](http://www.baeldung.com/spring-security-custom-filter) -- [Spring Security Basic Authentication](http://www.baeldung.com/spring-security-basic-authentication) +- [Basic Authentication with the RestTemplate](https://www.baeldung.com/how-to-use-resttemplate-with-basic-authentication-in-spring) +- [A Custom Filter in the Spring Security Filter Chain](https://www.baeldung.com/spring-security-custom-filter) +- [Spring Security Basic Authentication](https://www.baeldung.com/spring-security-basic-authentication) diff --git a/spring-security-rest-custom/README.md b/spring-security-rest-custom/README.md index 846093b554..15cbc22b5f 100644 --- a/spring-security-rest-custom/README.md +++ b/spring-security-rest-custom/README.md @@ -6,6 +6,6 @@ This module contains articles about REST APIs with Spring Security The "REST With Spring" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Spring Security Authentication Provider](http://www.baeldung.com/spring-security-authentication-provider) -- [Retrieve User Information in Spring Security](http://www.baeldung.com/get-user-in-spring-security) +- [Spring Security Authentication Provider](https://www.baeldung.com/spring-security-authentication-provider) +- [Retrieve User Information in Spring Security](https://www.baeldung.com/get-user-in-spring-security) - [Spring Security – Run-As Authentication](https://www.baeldung.com/spring-security-run-as-auth) diff --git a/spring-security-rest/README.md b/spring-security-rest/README.md index c7ac45e38f..d61a52070c 100644 --- a/spring-security-rest/README.md +++ b/spring-security-rest/README.md @@ -8,10 +8,10 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Spring REST Service Security](http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/) -- [Setting Up Swagger 2 with a Spring REST API](http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) -- [Custom Error Message Handling for REST API](http://www.baeldung.com/global-error-handler-in-a-spring-rest-api) -- [Spring Security Context Propagation with @Async](http://www.baeldung.com/spring-security-async-principal-propagation) -- [Servlet 3 Async Support with Spring MVC and Spring Security](http://www.baeldung.com/spring-mvc-async-security) -- [Intro to Spring Security Expressions](http://www.baeldung.com/spring-security-expressions) -- [Spring Security for a REST API](http://www.baeldung.com/securing-a-restful-web-service-with-spring-security) +- [Spring REST Service Security](https://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/) +- [Setting Up Swagger 2 with a Spring REST API](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) +- [Custom Error Message Handling for REST API](https://www.baeldung.com/global-error-handler-in-a-spring-rest-api) +- [Spring Security Context Propagation with @Async](https://www.baeldung.com/spring-security-async-principal-propagation) +- [Servlet 3 Async Support with Spring MVC and Spring Security](https://www.baeldung.com/spring-mvc-async-security) +- [Intro to Spring Security Expressions](https://www.baeldung.com/spring-security-expressions) +- [Spring Security for a REST API](https://www.baeldung.com/securing-a-restful-web-service-with-spring-security) diff --git a/spring-security-sso/README.md b/spring-security-sso/README.md index 31694bee45..23b53521be 100644 --- a/spring-security-sso/README.md +++ b/spring-security-sso/README.md @@ -3,5 +3,5 @@ This module contains modules about single-sign-on with Spring Security ### Relevant Articles: -- [Simple Single Sign-On with Spring Security OAuth2](http://www.baeldung.com/sso-spring-security-oauth2) +- [Simple Single Sign-On with Spring Security OAuth2](https://www.baeldung.com/sso-spring-security-oauth2) - [Spring Security Kerberos Integration](https://www.baeldung.com/spring-security-kerberos-integration) diff --git a/spring-security-stormpath/README.md b/spring-security-stormpath/README.md index abd65294a3..971d4cc858 100644 --- a/spring-security-stormpath/README.md +++ b/spring-security-stormpath/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring Security with Stormpath ### Relevant articles -- [Spring Security with Stormpath](http://www.baeldung.com/spring-security-stormpath) +- [Spring Security with Stormpath](https://www.baeldung.com/spring-security-stormpath) diff --git a/spring-security-thymeleaf/README.MD b/spring-security-thymeleaf/README.MD index 67b811fac8..2ad7b9d2bd 100644 --- a/spring-security-thymeleaf/README.MD +++ b/spring-security-thymeleaf/README.MD @@ -4,4 +4,4 @@ This module contains articles about Spring Security with Thymeleaf ### Relevant Articles: -- [Spring Security with Thymeleaf](http://www.baeldung.com/spring-security-thymeleaf) +- [Spring Security with Thymeleaf](https://www.baeldung.com/spring-security-thymeleaf) diff --git a/spring-security-x509/README.md b/spring-security-x509/README.md index 2c0e25a229..b1eb0debf5 100644 --- a/spring-security-x509/README.md +++ b/spring-security-x509/README.md @@ -3,4 +3,4 @@ This module contains articles about X.509 authentication with Spring Security ### Relevant Articles: -- [X.509 Authentication in Spring Security](http://www.baeldung.com/x-509-authentication-in-spring-security) +- [X.509 Authentication in Spring Security](https://www.baeldung.com/x-509-authentication-in-spring-security) diff --git a/spring-sleuth/README.md b/spring-sleuth/README.md index 692fbaa8b7..ebaebde6c9 100644 --- a/spring-sleuth/README.md +++ b/spring-sleuth/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring Cloud Sleuth ### Relevant articles: -- [Spring Cloud Sleuth in a Monolith Application](http://www.baeldung.com/spring-cloud-sleuth-single-application) +- [Spring Cloud Sleuth in a Monolith Application](https://www.baeldung.com/spring-cloud-sleuth-single-application) diff --git a/spring-social-login/README.md b/spring-social-login/README.md index c3ca867a95..2d97584e62 100644 --- a/spring-social-login/README.md +++ b/spring-social-login/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring Social ### Relevant Articles: -- [A Secondary Facebook Login with Spring Social](http://www.baeldung.com/facebook-authentication-with-spring-security-and-social) +- [A Secondary Facebook Login with Spring Social](https://www.baeldung.com/facebook-authentication-with-spring-security-and-social) diff --git a/spring-spel/README.md b/spring-spel/README.md index f81d304e1a..2a1d900e38 100644 --- a/spring-spel/README.md +++ b/spring-spel/README.md @@ -3,4 +3,4 @@ This module contains articles about the Spring Expression Language (SpEL) ### Relevant Articles: -- [Spring Expression Language Guide](http://www.baeldung.com/spring-expression-language) +- [Spring Expression Language Guide](https://www.baeldung.com/spring-expression-language) diff --git a/spring-state-machine/README.md b/spring-state-machine/README.md index f80ef34ef8..dadb628572 100644 --- a/spring-state-machine/README.md +++ b/spring-state-machine/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring State Machine ### Relevant articles -- [A Guide to the Spring State Machine Project](http://www.baeldung.com/spring-state-machine) +- [A Guide to the Spring State Machine Project](https://www.baeldung.com/spring-state-machine) diff --git a/spring-static-resources/README.md b/spring-static-resources/README.md index 8d77e6fe94..206421ed0e 100644 --- a/spring-static-resources/README.md +++ b/spring-static-resources/README.md @@ -3,7 +3,7 @@ This module contains articles about static resources with Spring ### Relevant Articles: -- [Cachable Static Assets with Spring MVC](http://www.baeldung.com/cachable-static-assets-with-spring-mvc) -- [Minification of JS and CSS Assets with Maven](http://www.baeldung.com/maven-minification-of-js-and-css-assets) -- [Serve Static Resources with Spring](http://www.baeldung.com/spring-mvc-static-resources) +- [Cachable Static Assets with Spring MVC](https://www.baeldung.com/cachable-static-assets-with-spring-mvc) +- [Minification of JS and CSS Assets with Maven](https://www.baeldung.com/maven-minification-of-js-and-css-assets) +- [Serve Static Resources with Spring](https://www.baeldung.com/spring-mvc-static-resources) - [Load a Resource as a String in Spring](https://www.baeldung.com/spring-load-resource-as-string) diff --git a/spring-swagger-codegen/README.md b/spring-swagger-codegen/README.md index dbcf2b3e8d..e375ae7594 100644 --- a/spring-swagger-codegen/README.md +++ b/spring-swagger-codegen/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring with Swagger CodeGen ### Relevant articles -- [Generate Spring Boot REST Client with Swagger](http://www.baeldung.com/spring-boot-rest-client-swagger-codegen) +- [Generate Spring Boot REST Client with Swagger](https://www.baeldung.com/spring-boot-rest-client-swagger-codegen) diff --git a/spring-thymeleaf/README.md b/spring-thymeleaf/README.md index 88f3e35f8c..329ef8580c 100644 --- a/spring-thymeleaf/README.md +++ b/spring-thymeleaf/README.md @@ -3,20 +3,20 @@ This module contains articles about Spring with Thymeleaf ### Relevant Articles: -- [Introduction to Using Thymeleaf in Spring](http://www.baeldung.com/thymeleaf-in-spring-mvc) -- [CSRF Protection with Spring MVC and Thymeleaf](http://www.baeldung.com/csrf-thymeleaf-with-spring-security) -- [Thymeleaf: Custom Layout Dialect](http://www.baeldung.com/thymeleaf-spring-layouts) -- [Spring and Thymeleaf 3: Expressions](http://www.baeldung.com/spring-thymeleaf-3-expressions) -- [Spring MVC + Thymeleaf 3.0: New Features](http://www.baeldung.com/spring-thymeleaf-3) -- [How to Work with Dates in Thymeleaf](http://www.baeldung.com/dates-in-thymeleaf) -- [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) -- [Working with Boolean in Thymeleaf](http://www.baeldung.com/thymeleaf-boolean) -- [Working with Fragments in Thymeleaf](http://www.baeldung.com/spring-thymeleaf-fragments) -- [Conditionals in Thymeleaf](http://www.baeldung.com/spring-thymeleaf-conditionals) -- [Iteration in Thymeleaf](http://www.baeldung.com/thymeleaf-iteration) -- [Working With Arrays in Thymeleaf](http://www.baeldung.com/thymeleaf-arrays) -- [Spring with Thymeleaf Pagination for a List](http://www.baeldung.com/spring-thymeleaf-pagination) -- [Working with Select and Option in Thymeleaf](http://www.baeldung.com/thymeleaf-select-option) +- [Introduction to Using Thymeleaf in Spring](https://www.baeldung.com/thymeleaf-in-spring-mvc) +- [CSRF Protection with Spring MVC and Thymeleaf](https://www.baeldung.com/csrf-thymeleaf-with-spring-security) +- [Thymeleaf: Custom Layout Dialect](https://www.baeldung.com/thymeleaf-spring-layouts) +- [Spring and Thymeleaf 3: Expressions](https://www.baeldung.com/spring-thymeleaf-3-expressions) +- [Spring MVC + Thymeleaf 3.0: New Features](https://www.baeldung.com/spring-thymeleaf-3) +- [How to Work with Dates in Thymeleaf](https://www.baeldung.com/dates-in-thymeleaf) +- [How to Create an Executable JAR with Maven](https://www.baeldung.com/executable-jar-with-maven) +- [Working with Boolean in Thymeleaf](https://www.baeldung.com/thymeleaf-boolean) +- [Working with Fragments in Thymeleaf](https://www.baeldung.com/spring-thymeleaf-fragments) +- [Conditionals in Thymeleaf](https://www.baeldung.com/spring-thymeleaf-conditionals) +- [Iteration in Thymeleaf](https://www.baeldung.com/thymeleaf-iteration) +- [Working With Arrays in Thymeleaf](https://www.baeldung.com/thymeleaf-arrays) +- [Spring with Thymeleaf Pagination for a List](https://www.baeldung.com/spring-thymeleaf-pagination) +- [Working with Select and Option in Thymeleaf](https://www.baeldung.com/thymeleaf-select-option) - [Working With Custom HTML Attributes in Thymeleaf](https://www.baeldung.com/thymeleaf-custom-html-attributes) - [Spring Request Parameters with Thymeleaf](https://www.baeldung.com/spring-thymeleaf-request-parameters) - [[next -->]](/spring-thymeleaf-2) diff --git a/spring-vertx/README.md b/spring-vertx/README.md index e9557f330b..e310079ff4 100644 --- a/spring-vertx/README.md +++ b/spring-vertx/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with Vert.x ### Relevant Articles: -- [Vert.x Spring Integration](http://www.baeldung.com/spring-vertx) +- [Vert.x Spring Integration](https://www.baeldung.com/spring-vertx) diff --git a/spring-webflux-amqp/README.md b/spring-webflux-amqp/README.md index b7ac73b53d..20ddbe469a 100644 --- a/spring-webflux-amqp/README.md +++ b/spring-webflux-amqp/README.md @@ -4,4 +4,4 @@ This module contains articles about Spring WebFlux with AMQP ### Relevant Articles: -- [Spring AMQP in Reactive Applications](http://www.baeldung.com/spring-amqp-reactive) +- [Spring AMQP in Reactive Applications](https://www.baeldung.com/spring-amqp-reactive) diff --git a/spring-zuul/README.md b/spring-zuul/README.md index a2ea211195..e1067ebb9f 100644 --- a/spring-zuul/README.md +++ b/spring-zuul/README.md @@ -3,4 +3,4 @@ This module contains articles about Spring with Netflix Zuul ### Relevant Articles: -- [Spring REST with a Zuul Proxy](http://www.baeldung.com/spring-rest-with-zuul-proxy) +- [Spring REST with a Zuul Proxy](https://www.baeldung.com/spring-rest-with-zuul-proxy) diff --git a/static-analysis/README.md b/static-analysis/README.md index e3710831cf..235b79853b 100644 --- a/static-analysis/README.md +++ b/static-analysis/README.md @@ -4,5 +4,5 @@ This module contains articles about static program analysis ## Relevant articles: -- [Introduction to PMD](http://www.baeldung.com/pmd) -- [Java Static Analysis Tools in Eclipse and IntelliJ IDEA](http://www.baeldung.com/java-static-analysis-tools) +- [Introduction to PMD](https://www.baeldung.com/pmd) +- [Java Static Analysis Tools in Eclipse and IntelliJ IDEA](https://www.baeldung.com/java-static-analysis-tools) diff --git a/stripe/README.md b/stripe/README.md index a7134b9633..9e41dcf945 100644 --- a/stripe/README.md +++ b/stripe/README.md @@ -4,5 +4,5 @@ This module contains articles about Stripe ### Relevant articles -- [Introduction to the Stripe API for Java](http://www.baeldung.com/java-stripe-api) +- [Introduction to the Stripe API for Java](https://www.baeldung.com/java-stripe-api) diff --git a/structurizr/README.md b/structurizr/README.md index 90ce49b482..15331228bd 100644 --- a/structurizr/README.md +++ b/structurizr/README.md @@ -3,4 +3,4 @@ This module contains articles about Structurizr ### Relevant Articles: -- [Intro to Structurizr](http://www.baeldung.com/structurizr) +- [Intro to Structurizr](https://www.baeldung.com/structurizr) diff --git a/struts-2/README.md b/struts-2/README.md index 6121ab3166..d15b94f662 100644 --- a/struts-2/README.md +++ b/struts-2/README.md @@ -4,4 +4,4 @@ This module contains articles about Struts 2 ### Relevant articles -- [A Quick Struts 2 Intro](http://www.baeldung.com/struts-2-intro) +- [A Quick Struts 2 Intro](https://www.baeldung.com/struts-2-intro) diff --git a/twilio/README.md b/twilio/README.md index b098473fa9..f298a8b75d 100644 --- a/twilio/README.md +++ b/twilio/README.md @@ -4,4 +4,4 @@ This module contains articles about Twilio ### Relevant Articles: -- [Sending SMS in Java with Twilio](http://www.baeldung.com/java-sms-twilio) +- [Sending SMS in Java with Twilio](https://www.baeldung.com/java-sms-twilio) diff --git a/twitter4j/README.md b/twitter4j/README.md index 0f58240538..8c9ee92348 100644 --- a/twitter4j/README.md +++ b/twitter4j/README.md @@ -4,4 +4,4 @@ This module contains articles about Twitter4J ### Relevant articles -- [Introduction to Twitter4J](http://www.baeldung.com/twitter4j) +- [Introduction to Twitter4J](https://www.baeldung.com/twitter4j) diff --git a/undertow/README.md b/undertow/README.md index ceec806bd4..f08c6cdb4d 100644 --- a/undertow/README.md +++ b/undertow/README.md @@ -3,4 +3,4 @@ This module contains articles about JBoss Undertow ### Relevant Articles: -- [Introduction to JBoss Undertow](http://www.baeldung.com/jboss-undertow) +- [Introduction to JBoss Undertow](https://www.baeldung.com/jboss-undertow) diff --git a/vaadin/README.md b/vaadin/README.md index 43d2cc8961..1d570d1f58 100644 --- a/vaadin/README.md +++ b/vaadin/README.md @@ -1,4 +1,4 @@ ## Relevant articles: -- [Introduction to Vaadin](http://www.baeldung.com/vaadin) +- [Introduction to Vaadin](https://www.baeldung.com/vaadin) - [Sample Application with Spring Boot and Vaadin](https://www.baeldung.com/spring-boot-vaadin) diff --git a/vavr/README.md b/vavr/README.md index 266cae91bb..6832f78a62 100644 --- a/vavr/README.md +++ b/vavr/README.md @@ -1,13 +1,13 @@ ### Relevant Articles: -- [Introduction to Vavr](http://www.baeldung.com/vavr) -- [Guide to Try in Vavr](http://www.baeldung.com/vavr-try) -- [Guide to Pattern Matching in Vavr](http://www.baeldung.com/vavr-pattern-matching) -- [Property Testing Example With Vavr](http://www.baeldung.com/vavr-property-testing) -- [Exceptions in Lambda Expression Using Vavr](http://www.baeldung.com/exceptions-using-vavr) -- [Vavr Support in Spring Data](http://www.baeldung.com/spring-vavr) -- [Introduction to Vavr’s Validation API](http://www.baeldung.com/vavr-validation-api) -- [Guide to Collections API in Vavr](http://www.baeldung.com/vavr-collections) -- [Collection Factory Methods for Vavr](http://www.baeldung.com/vavr-collection-factory-methods) -- [Introduction to Future in Vavr](http://www.baeldung.com/vavr-future) -- [Introduction to Vavr’s Either](http://www.baeldung.com/vavr-either) -- [Interoperability Between Java and Vavr](http://www.baeldung.com/java-vavr) +- [Introduction to Vavr](https://www.baeldung.com/vavr) +- [Guide to Try in Vavr](https://www.baeldung.com/vavr-try) +- [Guide to Pattern Matching in Vavr](https://www.baeldung.com/vavr-pattern-matching) +- [Property Testing Example With Vavr](https://www.baeldung.com/vavr-property-testing) +- [Exceptions in Lambda Expression Using Vavr](https://www.baeldung.com/exceptions-using-vavr) +- [Vavr Support in Spring Data](https://www.baeldung.com/spring-vavr) +- [Introduction to Vavr’s Validation API](https://www.baeldung.com/vavr-validation-api) +- [Guide to Collections API in Vavr](https://www.baeldung.com/vavr-collections) +- [Collection Factory Methods for Vavr](https://www.baeldung.com/vavr-collection-factory-methods) +- [Introduction to Future in Vavr](https://www.baeldung.com/vavr-future) +- [Introduction to Vavr’s Either](https://www.baeldung.com/vavr-either) +- [Interoperability Between Java and Vavr](https://www.baeldung.com/java-vavr) diff --git a/vertx-and-rxjava/README.md b/vertx-and-rxjava/README.md index 6d217426e0..622b80feca 100644 --- a/vertx-and-rxjava/README.md +++ b/vertx-and-rxjava/README.md @@ -3,4 +3,4 @@ This module contains articles about RxJava with Vert.x ### Relevant articles -- [Example of Vertx and RxJava Integration](http://www.baeldung.com/vertx-rx-java) +- [Example of Vertx and RxJava Integration](https://www.baeldung.com/vertx-rx-java) diff --git a/vertx/README.md b/vertx/README.md index fffc0afd62..9a62c7b5dc 100644 --- a/vertx/README.md +++ b/vertx/README.md @@ -4,4 +4,4 @@ This module contains articles about Vert.x ### Relevant articles -- [Introduction to Vert.x](http://www.baeldung.com/vertx) +- [Introduction to Vert.x](https://www.baeldung.com/vertx) diff --git a/vraptor/README.md b/vraptor/README.md index c5a7128922..037865d934 100644 --- a/vraptor/README.md +++ b/vraptor/README.md @@ -4,7 +4,7 @@ This module contains articles about VRaptor ### Relevant Article: -- [Introduction to VRaptor in Java](http://www.baeldung.com/vraptor) +- [Introduction to VRaptor in Java](https://www.baeldung.com/vraptor) # VRaptor blank project @@ -27,6 +27,3 @@ Após criar seu projeto você pode rodá-lo com um tomcat7 ou +: `mvn tomcat7:run` Cuidado para *jamais* executar `mvn tomcat:run` pois ele usará um tomcat6 (incompatível). - - - diff --git a/wicket/README.md b/wicket/README.md index 91fab2a364..65f0db2661 100644 --- a/wicket/README.md +++ b/wicket/README.md @@ -4,10 +4,10 @@ This module contains articles about Wicket ### Relevant Articles -- [Introduction to the Wicket Framework](http://www.baeldung.com/intro-to-the-wicket-framework) +- [Introduction to the Wicket Framework](https://www.baeldung.com/intro-to-the-wicket-framework) ### Execution From the same directory where pom.xml is, execute the following command to run the project: -mvn jetty:run \ No newline at end of file +`mvn jetty:run` diff --git a/xml/README.md b/xml/README.md index 1872568574..d1aa3a798b 100644 --- a/xml/README.md +++ b/xml/README.md @@ -3,10 +3,10 @@ This module contains articles about eXtensible Markup Language (XML) ### Relevant Articles: -- [Intro to XPath with Java](http://www.baeldung.com/java-xpath) -- [Introduction to JiBX](http://www.baeldung.com/jibx) -- [XML Libraries Support in Java](http://www.baeldung.com/java-xml-libraries) -- [DOM parsing with Xerces](http://www.baeldung.com/java-xerces-dom-parsing) +- [Intro to XPath with Java](https://www.baeldung.com/java-xpath) +- [Introduction to JiBX](https://www.baeldung.com/jibx) +- [XML Libraries Support in Java](https://www.baeldung.com/java-xml-libraries) +- [DOM parsing with Xerces](https://www.baeldung.com/java-xerces-dom-parsing) - [Write an org.w3.dom.Document to a File](https://www.baeldung.com/java-write-xml-document-file) - [Modifying an XML Attribute in Java](https://www.baeldung.com/java-modify-xml-attribute) - [Convert XML to HTML in Java](https://www.baeldung.com/java-convert-xml-to-html) diff --git a/xstream/README.md b/xstream/README.md index 62996132c8..505ce1e2d9 100644 --- a/xstream/README.md +++ b/xstream/README.md @@ -4,7 +4,7 @@ This module contains articles about XStream ## Relevant Articles: -- [XStream User Guide: JSON](http://www.baeldung.com/xstream-json-processing) -- [XStream User Guide: Converting XML to Objects](http://www.baeldung.com/xstream-deserialize-xml-to-object) -- [XStream User Guide: Converting Objects to XML](http://www.baeldung.com/xstream-serialize-object-to-xml) +- [XStream User Guide: JSON](https://www.baeldung.com/xstream-json-processing) +- [XStream User Guide: Converting XML to Objects](https://www.baeldung.com/xstream-deserialize-xml-to-object) +- [XStream User Guide: Converting Objects to XML](https://www.baeldung.com/xstream-serialize-object-to-xml) - [Remote Code Execution with XStream](https://www.baeldung.com/java-xstream-remote-code-execution)