diff --git a/pom.xml b/pom.xml index c644be0ef..8403439e1 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,6 @@ 3.0.0-SNAPSHOT 3.0.0-SNAPSHOT 4.0.0-SNAPSHOT - 3.0.0-SNAPSHOT 3.0.0-SNAPSHOT 5.0.0 diff --git a/spring-data-rest-tests/pom.xml b/spring-data-rest-tests/pom.xml index 6eb773d6d..b198cd4c5 100644 --- a/spring-data-rest-tests/pom.xml +++ b/spring-data-rest-tests/pom.xml @@ -15,10 +15,6 @@ spring-data-rest-tests-core - - spring-data-rest-tests-jpa spring-data-rest-tests-mongodb spring-data-rest-tests-security diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/pom.xml b/spring-data-rest-tests/spring-data-rest-tests-geode/pom.xml deleted file mode 100644 index e8d9ef8b0..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - 4.0.0 - - - org.springframework.data - spring-data-rest-tests - 4.0.0-SNAPSHOT - ../pom.xml - - - Spring Data REST Tests - Geode - spring-data-rest-tests-geode - - - spring.data.rest.tests.geode - - - - - - org.springframework.data - spring-data-rest-tests-core - 4.0.0-SNAPSHOT - test-jar - - - - - - org.springframework.data - spring-data-geode - ${springdata.geode} - - - - - diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/AbstractPersistentEntity.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/AbstractPersistentEntity.java deleted file mode 100644 index 864402024..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/AbstractPersistentEntity.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import org.springframework.data.annotation.Id; - -/** - * Base class for persistent classes. - * - * @author Oliver Gierke - * @author David Turanski - */ -public class AbstractPersistentEntity { - - @Id private final Long id; - - /** - * Returns the identifier of the entity. - * - * @return the id - */ - public Long getId() { - return id; - } - - protected AbstractPersistentEntity(Long id) { - this.id = id; - } - - protected AbstractPersistentEntity() { - this.id = null; - } - - @Override - public boolean equals(Object obj) { - - if (this == obj) { - return true; - } - - if (this.id == null || obj == null || !(this.getClass().equals(obj.getClass()))) { - return false; - } - - AbstractPersistentEntity that = (AbstractPersistentEntity) obj; - - return this.id.equals(that.getId()); - } - - @Override - public int hashCode() { - return id == null ? 0 : id.hashCode(); - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java deleted file mode 100644 index 24b3b811b..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Address.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import org.springframework.util.Assert; - -/** - * An address. - * - * @author Oliver Gierke - */ -public class Address { - - private final String street, city, country; - - /** - * Creates a new {@link Address} from the given street, city and country. - * - * @param street must not be {@literal null} or empty. - * @param city must not be {@literal null} or empty. - * @param country must not be {@literal null} or empty. - */ - public Address(String street, String city, String country) { - - Assert.hasText(street, "Street must not be null or empty"); - Assert.hasText(city, "City must not be null or empty"); - Assert.hasText(country, "Country must not be null or empty"); - - this.street = street; - this.city = city; - this.country = country; - } - - /** - * Returns a copy of the current {@link Address} instance which is a new entity in terms of persistence. - * - * @return - */ - public Address getCopy() { - return new Address(this.street, this.city, this.country); - } - - /** - * Returns the street. - * - * @return - */ - public String getStreet() { - return street; - } - - /** - * Returns the city. - * - * @return - */ - public String getCity() { - return city; - } - - /** - * Returns the country. - * - * @return - */ - public String getCountry() { - return country; - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java deleted file mode 100644 index dd7949b05..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Customer.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.springframework.data.gemfire.mapping.annotation.Region; -import org.springframework.util.Assert; - -/** - * A customer. - * - * @author Oliver Gierke - * @author David Turanski - * @author Mark Paluch - */ -@Region -public class Customer extends AbstractPersistentEntity { - private EmailAddress emailAddress; - private String firstname, lastname; - private Set
addresses = new HashSet
(); - - /** - * Creates a new {@link Customer} from the given parameters. - * - * @param id the unique id; - * @param emailAddress must not be {@literal null} or empty. - * @param firstname must not be {@literal null} or empty. - * @param lastname must not be {@literal null} or empty. - */ - public Customer(Long id, EmailAddress emailAddress, String firstname, String lastname) { - super(id); - Assert.hasText(firstname, "Firstname must not be null or empty"); - Assert.hasText(lastname, "Lastname must not be null or empty"); - Assert.notNull(emailAddress, "EmailAddress must not be null"); - - this.firstname = firstname; - this.lastname = lastname; - this.emailAddress = emailAddress; - } - - protected Customer() {} - - /** - * Adds the given {@link Address} to the {@link Customer}. - * - * @param address must not be {@literal null}. - */ - public void add(Address address) { - - Assert.notNull(address, "Address must not be null"); - this.addresses.add(address); - } - - /** - * Returns the firstname of the {@link Customer}. - * - * @return - */ - public String getFirstname() { - return firstname; - } - - /** - * Sets the firstname of the {@link Customer}. - * - * @param firstname - */ - public void setFirstname(String firstname) { - this.firstname = firstname; - } - - /** - * Returns the lastname of the {@link Customer}. - * - * @return - */ - public String getLastname() { - return lastname; - } - - /** - * Sets the lastname of the {@link Customer}. - * - * @param lastname - */ - public void setLastname(String lastname) { - this.lastname = lastname; - } - - /** - * Returns the {@link EmailAddress} of the {@link Customer}. - * - * @return - */ - public EmailAddress getEmailAddress() { - return emailAddress; - } - - /** - * Sets the emailAddress of the {@link Customer}. - * - * @param emailAddress - */ - public void setEmailAddress(EmailAddress emailAddress) { - this.emailAddress = emailAddress; - } - - /** - * Return the {@link Customer}'s addresses. - * - * @return - */ - public Set
getAddresses() { - return Collections.unmodifiableSet(addresses); - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/CustomerRepository.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/CustomerRepository.java deleted file mode 100644 index be15fd870..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/CustomerRepository.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.util.List; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; - -/** - * Repository interface to access {@link Customer}s. - * - * @author Oliver Gierke - * @author David Turanski - */ -public interface CustomerRepository extends CrudRepository { - - /** - * Finds all {@link Customer}s with the given lastname. - * - * @param lastname - * @return - */ - List findByLastname(@Param("lastname") String lastname); - - /** - * Finds the Customer with the given {@link EmailAddress}. - * - * @param emailAddress - * @return - */ - Customer findByEmailAddress(@Param("email") EmailAddress emailAddress); -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java deleted file mode 100644 index ce41b19dd..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/EmailAddress.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.util.regex.Pattern; - -import org.springframework.core.convert.converter.Converter; -import org.springframework.stereotype.Component; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; - -/** - * Value object to represent email addresses. - * - * @author Oliver Gierke - */ -@JsonSerialize(using = ToStringSerializer.class) -public final class EmailAddress { - - private static final String EMAIL_REGEX = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; - private static final Pattern PATTERN = Pattern.compile(EMAIL_REGEX); - private final String value; - - /** - * Creates a new {@link EmailAddress} from the given {@link String} representation. - * - * @param emailAddress must not be {@literal null} or empty. - */ - @JsonCreator - public EmailAddress(String emailAddress) { - Assert.isTrue(isValid(emailAddress), "Invalid email address"); - this.value = emailAddress; - } - - /** - * Returns whether the given {@link String} is a valid {@link EmailAddress} which means you can safely instantiate the - * class. - * - * @param candidate - * @return - */ - public static boolean isValid(String candidate) { - return candidate == null ? false : PATTERN.matcher(candidate).matches(); - } - - @Override - public String toString() { - return value; - } - - @Override - public boolean equals(Object obj) { - - if (this == obj) { - return true; - } - - if (!(obj instanceof EmailAddress)) { - return false; - } - - EmailAddress that = (EmailAddress) obj; - return this.value.equals(that.value); - } - - @Override - public int hashCode() { - return value.hashCode(); - } - - @Component - static class EmailAddressToStringConverter implements Converter { - - @Override - public String convert(EmailAddress source) { - return source == null ? null : source.value; - } - } - - @Component - static class StringToEmailAddressConverter implements Converter { - - public EmailAddress convert(String source) { - return StringUtils.hasText(source) ? new EmailAddress(source) : null; - } - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java deleted file mode 100644 index 39c90da26..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/LineItem.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.math.BigDecimal; - -import org.springframework.util.Assert; - -/** - * @author Oliver Gierke - */ -public class LineItem { - - private BigDecimal price; - private int amount; - private Long productId; - - /** - * Creates a new {@link LineItem} for the given {@link Product}. - * - * @param product must not be {@literal null}. - */ - public LineItem(Product product) { - this(product, 1); - } - - /** - * Creates a new {@link LineItem} for the given {@link Product} and amount. - * - * @param product must not be {@literal null}. - * @param amount - */ - public LineItem(Product product, int amount) { - Assert.notNull(product, "The given Product must not be null"); - Assert.isTrue(amount > 0, "The amount of Products to be bought must be greater than 0"); - - this.productId = product.getId(); - this.amount = amount; - this.price = product.getPrice(); - } - - protected LineItem() {} - - /** - * Returns the id of the {@link Product} the {@link LineItem} refers to. - * - * @return - */ - public Long getProductId() { - return productId; - } - - /** - * Returns the amount of {@link Product}s to be ordered. - * - * @return - */ - public int getAmount() { - return amount; - } - - /** - * Returns the price a single unit of the {@link LineItem}'s product. - * - * @return the price - */ - public BigDecimal getUnitPrice() { - return price; - } - - /** - * Returns the total for the {@link LineItem}. - * - * @return - */ - public BigDecimal getTotal() { - return price.multiply(BigDecimal.valueOf(amount)); - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java deleted file mode 100644 index cf9dee1fc..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Order.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.math.BigDecimal; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.springframework.data.gemfire.mapping.annotation.Region; -import org.springframework.util.Assert; - -/** - * @author Oliver Gierke - * @author David Turanski - * @author Mark Paluch - */ -@Region -public class Order extends AbstractPersistentEntity { - - private Long customerId; - private Address billingAddress; - private Address shippingAddress; - private Set lineItems = new HashSet(); - - /** - * Creates a new {@link Order} for the given {@link org.springframework.data.rest.tests.geode.Customer}. - * - * @param id order ID - * @param customerId must not be {@literal null}. - * @param shippingAddress must not be {@literal null}. - */ - public Order(Long id, Long customerId, Address shippingAddress) { - super(id); - Assert.notNull(customerId, "CustomerId must not be null"); - Assert.notNull(shippingAddress, "ShippingAddress must not be null"); - - this.customerId = customerId; - this.shippingAddress = shippingAddress; - } - - protected Order() {} - - /** - * Adds the given {@link LineItem} to the {@link Order}. - * - * @param lineItem - */ - public void add(LineItem lineItem) { - this.lineItems.add(lineItem); - } - - /** - * Returns the id of the {@link org.springframework.data.rest.tests.geode.Customer} who placed the - * {@link Order}. - * - * @return - */ - public Long getCustomerId() { - return customerId; - } - - /** - * Returns the billing {@link Address} for this order. - * - * @return - */ - public Address getBillingAddress() { - return billingAddress != null ? billingAddress : shippingAddress; - } - - /** - * Returns the shipping {@link Address} for this order; - * - * @return - */ - public Address getShippingAddress() { - return shippingAddress; - } - - /** - * Returns all {@link LineItem}s currently belonging to the {@link Order}. - * - * @return - */ - public Set getLineItems() { - return Collections.unmodifiableSet(lineItems); - } - - /** - * Returns the total of the {@link Order}. - * - * @return - */ - public BigDecimal getTotal() { - - BigDecimal total = BigDecimal.ZERO; - - for (LineItem item : lineItems) { - total = total.add(item.getTotal()); - } - - return total; - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/OrderRepository.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/OrderRepository.java deleted file mode 100644 index c5b2535cf..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/OrderRepository.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.util.List; - -import org.springframework.data.repository.CrudRepository; - -/** - * @author Oliver Gierke - * @author David Turanski - */ -public interface OrderRepository extends CrudRepository { - - List findByCustomerId(Long customerId); -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java deleted file mode 100644 index fd9750f89..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/Product.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.math.BigDecimal; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.springframework.data.annotation.PersistenceConstructor; -import org.springframework.data.gemfire.mapping.annotation.Region; -import org.springframework.util.Assert; - -/** - * A product. - * - * @author Oliver Gierke - * @author David Turanski - * @author Mark Paluch - */ -@Region -public class Product extends AbstractPersistentEntity { - - private String name, description; - private BigDecimal price; - private Map attributes = new HashMap(); - - /** - * Creates a new {@link Product} with the given name. - * - * @param id a unique Id - * @param name must not be {@literal null} or empty. - * @param price must not be {@literal null} or less than or equal to zero. - */ - public Product(Long id, String name, BigDecimal price) { - this(id, name, price, null); - } - - /** - * Creates a new {@link Product} from the given name and description. - * - * @param id a unique Id - * @param name must not be {@literal null} or empty. - * @param price must not be {@literal null} or less than or equal to zero. - * @param description - */ - @PersistenceConstructor - public Product(Long id, String name, BigDecimal price, String description) { - super(id); - Assert.hasText(name, "Name must not be null or empty"); - Assert.isTrue(BigDecimal.ZERO.compareTo(price) < 0, "Price must be greater than zero"); - - this.name = name; - this.price = price; - this.description = description; - } - - protected Product() {} - - /** - * Sets the attribute with the given name to the given value. - * - * @param name must not be {@literal null} or empty. - * @param value - */ - public void setAttribute(String name, String value) { - - Assert.hasText(name, "Name must not be null or empty"); - - if (value == null) { - this.attributes.remove(value); - } else { - this.attributes.put(name, value); - } - } - - /** - * Returns the {@link Product}'s name. - * - * @return - */ - public String getName() { - return name; - } - - /** - * Returns the {@link Product}'s description. - * - * @return - */ - public String getDescription() { - return description; - } - - /** - * Returns all the custom attributes of the {@link Product}. - * - * @return - */ - public Map getAttributes() { - return Collections.unmodifiableMap(attributes); - } - - /** - * Returns the price of the {@link Product}. - * - * @return - */ - public BigDecimal getPrice() { - return price; - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/ProductRepository.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/ProductRepository.java deleted file mode 100644 index 23f592a43..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/main/java/org/springframework/data/rest/tests/geode/ProductRepository.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import java.util.List; - -import org.springframework.data.gemfire.repository.Query; -import org.springframework.data.repository.CrudRepository; - -/** - * Repository interface to access {@link Product}s. - * - * @author Oliver Gierke - * @author David Turanski - */ -public interface ProductRepository extends CrudRepository { - - /** - * Returns a list of {@link Product}s having a description which contains the given snippet. - * - * @param the search string - * @return - */ - List findByDescriptionContaining(String description); - - /** - * Returns all {@link Product}s having the given attribute value. - * - * @param attribute - * @param value - * @return - */ - @Query("SELECT * FROM /Product where attributes[$1] = $2") - List findByAttributes(String key, String value); - - List findByName(String name); -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/java/org/springframework/data/rest/tests/geode/GeodeRepositoryConfig.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/java/org/springframework/data/rest/tests/geode/GeodeRepositoryConfig.java deleted file mode 100644 index 55dbbaff5..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/java/org/springframework/data/rest/tests/geode/GeodeRepositoryConfig.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.ImportResource; -import org.springframework.data.gemfire.mapping.GemfireMappingContext; -import org.springframework.data.gemfire.mapping.annotation.Region; -import org.springframework.data.gemfire.repository.config.EnableGemfireRepositories; -import org.springframework.data.util.AnnotatedTypeScanner; - -/** - * Spring JavaConfig configuration class to setup a Spring container and infrastructure components. - * - * @author Oliver Gierke - * @author David Turanski - */ -@Configuration -@ImportResource("classpath:META-INF/spring/cache-config.xml") -@EnableGemfireRepositories -class GeodeRepositoryConfig { - - /** - * TODO: Remove, once Spring Data Gemfire exposes a mapping context. - */ - @Bean - public GemfireMappingContext gemfireMappingContext() { - - AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Region.class); - - GemfireMappingContext context = new GemfireMappingContext(); - context.setInitialEntitySet(scanner.findTypes(GeodeRepositoryConfig.class.getPackage().getName())); - context.initialize(); - - return context; - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/java/org/springframework/data/rest/tests/geode/GeodeWebTests.java b/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/java/org/springframework/data/rest/tests/geode/GeodeWebTests.java deleted file mode 100755 index 220916017..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/java/org/springframework/data/rest/tests/geode/GeodeWebTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2013-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.rest.tests.geode; - -import org.springframework.data.rest.tests.CommonWebTests; -import org.springframework.hateoas.LinkRelation; -import org.springframework.test.context.ContextConfiguration; - -/** - * @author Oliver Gierke - */ -@ContextConfiguration(classes = GeodeRepositoryConfig.class) -class GeodeWebTests extends CommonWebTests { - - @Override - protected Iterable expectedRootLinkRels() { - return LinkRelation.manyOf("products"); - } -} diff --git a/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/resources/META-INF/spring/cache-config.xml b/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/resources/META-INF/spring/cache-config.xml deleted file mode 100644 index 5124f7039..000000000 --- a/spring-data-rest-tests/spring-data-rest-tests-geode/src/test/resources/META-INF/spring/cache-config.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - -