DATAJPA-1054 - Remove references to Assert single-arg methods.
Replace references to Assert single-arg methods with references to methods accepting the test object and message. Related ticket: SPR-15196.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011 the original author or authors.
|
||||
* Copyright 2011-2017 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.
|
||||
@@ -25,7 +25,7 @@ import javax.persistence.EntityManager;
|
||||
|
||||
import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryBean;
|
||||
import org.springframework.data.repository.config.CustomRepositoryImplementationDetector;
|
||||
import org.springframework.data.repository.config.CustomRepositoryImplementationDetector;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -47,14 +47,14 @@ class JpaRepositoryBean<T> extends CdiRepositoryBean<T> {
|
||||
* @param entityManagerBean must not be {@literal null}.
|
||||
* @param qualifiers must not be {@literal null}.
|
||||
* @param repositoryType must not be {@literal null}.
|
||||
* @param detector can be {@literal null}.
|
||||
* @param detector can be {@literal null}.
|
||||
*/
|
||||
JpaRepositoryBean(BeanManager beanManager, Bean<EntityManager> entityManagerBean, Set<Annotation> qualifiers,
|
||||
Class<T> repositoryType, CustomRepositoryImplementationDetector detector) {
|
||||
Class<T> repositoryType, CustomRepositoryImplementationDetector detector) {
|
||||
|
||||
super(qualifiers, repositoryType, beanManager, detector);
|
||||
super(qualifiers, repositoryType, beanManager, detector);
|
||||
|
||||
Assert.notNull(entityManagerBean);
|
||||
Assert.notNull(entityManagerBean, "EntityManager bean must not be null!");
|
||||
this.entityManagerBean = entityManagerBean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2016 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -48,6 +48,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public abstract class AbstractJpaQuery implements RepositoryQuery {
|
||||
|
||||
@@ -59,13 +60,12 @@ public abstract class AbstractJpaQuery implements RepositoryQuery {
|
||||
* Creates a new {@link AbstractJpaQuery} from the given {@link JpaQueryMethod}.
|
||||
*
|
||||
* @param method
|
||||
* @param resultFactory
|
||||
* @param em
|
||||
*/
|
||||
public AbstractJpaQuery(JpaQueryMethod method, EntityManager em) {
|
||||
|
||||
Assert.notNull(method);
|
||||
Assert.notNull(em);
|
||||
Assert.notNull(method, "JpaQueryMethod must not be null!");
|
||||
Assert.notNull(em, "EntityManager must not be null!");
|
||||
|
||||
this.method = method;
|
||||
this.em = em;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2013 the original author or authors.
|
||||
* Copyright 2011-2017 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.
|
||||
@@ -32,6 +32,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
class CriteriaQueryParameterBinder extends ParameterBinder {
|
||||
|
||||
@@ -41,14 +42,15 @@ class CriteriaQueryParameterBinder extends ParameterBinder {
|
||||
* Creates a new {@link CriteriaQueryParameterBinder} for the given {@link Parameters}, values and some
|
||||
* {@link javax.persistence.criteria.ParameterExpression}.
|
||||
*
|
||||
* @param parameters
|
||||
* @param values
|
||||
* @param expressions
|
||||
* @param parameters must not be {@literal null}.
|
||||
* @param values must not be {@literal null}.
|
||||
* @param expressions must not be {@literal null}.
|
||||
*/
|
||||
CriteriaQueryParameterBinder(JpaParameters parameters, Object[] values, Iterable<ParameterMetadata<?>> expressions) {
|
||||
|
||||
super(parameters, values);
|
||||
Assert.notNull(expressions);
|
||||
|
||||
Assert.notNull(expressions, "Iterable of ParameterMetadata must not be null!");
|
||||
this.expressions = expressions.iterator();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2015 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -202,8 +202,8 @@ public class JpaQueryCreator extends AbstractQueryCreator<CriteriaQuery<? extend
|
||||
*/
|
||||
public PredicateBuilder(Part part, Root<?> root) {
|
||||
|
||||
Assert.notNull(part);
|
||||
Assert.notNull(root);
|
||||
Assert.notNull(part, "Part must not be null!");
|
||||
Assert.notNull(root, "Root must not be null!");
|
||||
this.part = part;
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2015 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -68,13 +68,13 @@ public abstract class JpaQueryExecution {
|
||||
* Executes the given {@link AbstractStringBasedJpaQuery} with the given {@link ParameterBinder}.
|
||||
*
|
||||
* @param query must not be {@literal null}.
|
||||
* @param binder must not be {@literal null}.
|
||||
* @param values must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
public Object execute(AbstractJpaQuery query, Object[] values) {
|
||||
|
||||
Assert.notNull(query);
|
||||
Assert.notNull(values);
|
||||
Assert.notNull(query, "AbstractJpaQuery must not be null!");
|
||||
Assert.notNull(values, "Values must not be null!");
|
||||
|
||||
Object result;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2014 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -33,6 +33,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class ParameterBinder {
|
||||
|
||||
@@ -48,8 +49,8 @@ public class ParameterBinder {
|
||||
*/
|
||||
public ParameterBinder(JpaParameters parameters, Object[] values) {
|
||||
|
||||
Assert.notNull(parameters);
|
||||
Assert.notNull(values);
|
||||
Assert.notNull(parameters, "JpaParameters must not be null!");
|
||||
Assert.notNull(values, "Values must not be null!");
|
||||
|
||||
Assert.isTrue(parameters.getNumberOfParameters() == values.length, "Invalid number of parameters given!");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 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.
|
||||
@@ -41,6 +41,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
class ParameterMetadataProvider {
|
||||
|
||||
@@ -144,12 +145,12 @@ class ParameterMetadataProvider {
|
||||
* @param <T>
|
||||
* @param part must not be {@literal null}.
|
||||
* @param type must not be {@literal null}.
|
||||
* @param name
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
private <T> ParameterMetadata<T> next(Part part, Class<T> type, Parameter parameter) {
|
||||
|
||||
Assert.notNull(type);
|
||||
Assert.notNull(type, "Type must not be null!");
|
||||
|
||||
/*
|
||||
* We treat Expression types as Object vales since the real value to be bound as a parameter is determined at query time.
|
||||
@@ -221,7 +222,7 @@ class ParameterMetadataProvider {
|
||||
*/
|
||||
public Object prepare(Object value) {
|
||||
|
||||
Assert.notNull(value);
|
||||
Assert.notNull(value, "Value must not be null!");
|
||||
|
||||
Class<? extends T> expressionType = expression.getJavaType();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2016 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -69,6 +69,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Thomas Darimont
|
||||
* @author Komi Innocent
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public abstract class QueryUtils {
|
||||
|
||||
@@ -221,14 +222,14 @@ public abstract class QueryUtils {
|
||||
/**
|
||||
* Adds {@literal order by} clause to the JPQL query.
|
||||
*
|
||||
* @param query
|
||||
* @param query must not be {@literal null} or empty.
|
||||
* @param sort
|
||||
* @param alias
|
||||
* @return
|
||||
*/
|
||||
public static String applySorting(String query, Sort sort, String alias) {
|
||||
|
||||
Assert.hasText(query);
|
||||
Assert.hasText(query, "Query must not be null or empty!");
|
||||
|
||||
if (null == sort || !sort.iterator().hasNext()) {
|
||||
return query;
|
||||
@@ -356,16 +357,16 @@ public abstract class QueryUtils {
|
||||
* entities to the query.
|
||||
*
|
||||
* @param <T>
|
||||
* @param queryString
|
||||
* @param entities
|
||||
* @param entityManager
|
||||
* @param queryString must not be {@literal null}.
|
||||
* @param entities must not be {@literal null}.
|
||||
* @param entityManager must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
public static <T> Query applyAndBind(String queryString, Iterable<T> entities, EntityManager entityManager) {
|
||||
|
||||
Assert.notNull(queryString);
|
||||
Assert.notNull(entities);
|
||||
Assert.notNull(entityManager);
|
||||
Assert.notNull(queryString, "Querystring must not be null!");
|
||||
Assert.notNull(entities, "Iterable of entities must not be null!");
|
||||
Assert.notNull(entityManager, "EntityManager must not be null!");
|
||||
|
||||
Iterator<T> iterator = entities.iterator();
|
||||
|
||||
@@ -489,8 +490,8 @@ public abstract class QueryUtils {
|
||||
return orders;
|
||||
}
|
||||
|
||||
Assert.notNull(root);
|
||||
Assert.notNull(cb);
|
||||
Assert.notNull(root, "Root must not be null!");
|
||||
Assert.notNull(cb, "CriteriaBuilder must not be null!");
|
||||
|
||||
for (org.springframework.data.domain.Sort.Order order : sort) {
|
||||
orders.add(toJpaOrder(order, root, cb));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 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.
|
||||
@@ -37,6 +37,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Oliver Wehrens
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
class StringQuery {
|
||||
|
||||
@@ -729,7 +730,7 @@ class StringQuery {
|
||||
*/
|
||||
private static Type getLikeTypeFrom(String expression) {
|
||||
|
||||
Assert.hasText(expression);
|
||||
Assert.hasText(expression, "Expression must not be null or empty!");
|
||||
|
||||
if (expression.matches("%.*%")) {
|
||||
return Type.CONTAINING;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011 the original author or authors.
|
||||
* Copyright 2011-2017 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.
|
||||
@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
|
||||
* Base class for {@link JpaEntityInformation} implementations to share common method implementations.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public abstract class JpaEntityInformationSupport<T, ID extends Serializable> extends AbstractEntityInformation<T, ID>
|
||||
implements JpaEntityInformation<T, ID> {
|
||||
@@ -56,8 +57,8 @@ public abstract class JpaEntityInformationSupport<T, ID extends Serializable> ex
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public static <T> JpaEntityInformation<T, ?> getEntityInformation(Class<T> domainClass, EntityManager em) {
|
||||
|
||||
Assert.notNull(domainClass);
|
||||
Assert.notNull(em);
|
||||
Assert.notNull(domainClass, "Domain class must not be null!");
|
||||
Assert.notNull(em, "EntityManager must not be null!");
|
||||
|
||||
Metamodel metamodel = em.getMetamodel();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 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.
|
||||
@@ -64,7 +64,7 @@ public class JpaMetamodelEntityInformation<T, ID extends Serializable> extends J
|
||||
|
||||
super(domainClass);
|
||||
|
||||
Assert.notNull(metamodel);
|
||||
Assert.notNull(metamodel, "Metamodel must not be null!");
|
||||
this.metamodel = metamodel;
|
||||
|
||||
ManagedType<T> type = metamodel.managedType(domainClass);
|
||||
@@ -210,7 +210,9 @@ public class JpaMetamodelEntityInformation<T, ID extends Serializable> extends J
|
||||
* @see org.springframework.data.jpa.repository.support.JpaEntityInformation#getCompositeIdAttributeValue(java.io.Serializable, java.lang.String)
|
||||
*/
|
||||
public Object getCompositeIdAttributeValue(Serializable id, String idAttribute) {
|
||||
Assert.isTrue(hasCompositeId());
|
||||
|
||||
Assert.isTrue(hasCompositeId(), "Model must have a composite Id!");
|
||||
|
||||
return new DirectFieldAccessFallbackBeanWrapper(id).getPropertyValue(idAttribute);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2015 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -38,6 +38,7 @@ import org.springframework.util.Assert;
|
||||
* JPA specific generic repository factory.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class JpaRepositoryFactory extends RepositoryFactorySupport {
|
||||
|
||||
@@ -52,7 +53,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
|
||||
*/
|
||||
public JpaRepositoryFactory(EntityManager entityManager) {
|
||||
|
||||
Assert.notNull(entityManager);
|
||||
Assert.notNull(entityManager, "EntityManager must not be null!");
|
||||
|
||||
this.entityManager = entityManager;
|
||||
this.extractor = PersistenceProvider.fromEntityManager(entityManager);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011 the original author or authors.
|
||||
* Copyright 2011-2017 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.
|
||||
@@ -35,6 +35,7 @@ import com.querydsl.jpa.impl.JPAUpdateClause;
|
||||
* Base class for implementing repositories using QueryDsl library.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Repository
|
||||
public abstract class QueryDslRepositorySupport {
|
||||
@@ -50,7 +51,8 @@ public abstract class QueryDslRepositorySupport {
|
||||
* @param domainClass must not be {@literal null}.
|
||||
*/
|
||||
public QueryDslRepositorySupport(Class<?> domainClass) {
|
||||
Assert.notNull(domainClass);
|
||||
|
||||
Assert.notNull(domainClass, "Domain class must not be null!");
|
||||
this.builder = new PathBuilderFactory().create(domainClass);
|
||||
}
|
||||
|
||||
@@ -62,7 +64,7 @@ public abstract class QueryDslRepositorySupport {
|
||||
@PersistenceContext
|
||||
public void setEntityManager(EntityManager entityManager) {
|
||||
|
||||
Assert.notNull(entityManager);
|
||||
Assert.notNull(entityManager, "EntityManager must not be null!");
|
||||
this.querydsl = new Querydsl(entityManager, builder);
|
||||
this.entityManager = entityManager;
|
||||
}
|
||||
@@ -88,7 +90,7 @@ public abstract class QueryDslRepositorySupport {
|
||||
/**
|
||||
* Returns a fresh {@link JPQLQuery}.
|
||||
*
|
||||
* @param path must not be {@literal null}.
|
||||
* @param paths must not be {@literal null}.
|
||||
* @return the Querydsl {@link JPQLQuery}.
|
||||
*/
|
||||
protected JPQLQuery<Object> from(EntityPath<?>... paths) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
@@ -46,6 +46,7 @@ import com.querydsl.jpa.impl.JPAQuery;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class Querydsl {
|
||||
|
||||
@@ -61,8 +62,8 @@ public class Querydsl {
|
||||
*/
|
||||
public Querydsl(EntityManager em, PathBuilder<?> builder) {
|
||||
|
||||
Assert.notNull(em);
|
||||
Assert.notNull(builder);
|
||||
Assert.notNull(em, "EntityManager must not be null!");
|
||||
Assert.notNull(builder, "PathBuilder must not be null!");
|
||||
|
||||
this.em = em;
|
||||
this.provider = PersistenceProvider.fromEntityManager(em);
|
||||
|
||||
@@ -90,8 +90,8 @@ public class SimpleJpaRepository<T, ID extends Serializable>
|
||||
*/
|
||||
public SimpleJpaRepository(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
|
||||
|
||||
Assert.notNull(entityInformation);
|
||||
Assert.notNull(entityManager);
|
||||
Assert.notNull(entityInformation, "JpaEntityInformation must not be null!");
|
||||
Assert.notNull(entityManager, "EntityManager must not be null!");
|
||||
|
||||
this.entityInformation = entityInformation;
|
||||
this.em = entityManager;
|
||||
@@ -696,8 +696,9 @@ public class SimpleJpaRepository<T, ID extends Serializable>
|
||||
private <S, U extends T> Root<U> applySpecificationToCriteria(Specification<U> spec, Class<U> domainClass,
|
||||
CriteriaQuery<S> query) {
|
||||
|
||||
Assert.notNull(query);
|
||||
Assert.notNull(domainClass);
|
||||
Assert.notNull(domainClass, "Domain class must not be null!");
|
||||
Assert.notNull(query, "CriteriaQuery must not be null!");
|
||||
|
||||
Root<U> root = query.from(domainClass);
|
||||
|
||||
if (spec == null) {
|
||||
@@ -743,7 +744,7 @@ public class SimpleJpaRepository<T, ID extends Serializable>
|
||||
*/
|
||||
private static Long executeCountQuery(TypedQuery<Long> query) {
|
||||
|
||||
Assert.notNull(query);
|
||||
Assert.notNull(query, "TypedQuery must not be null!");
|
||||
|
||||
List<Long> totals = query.getResultList();
|
||||
Long total = 0L;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2011 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -23,6 +23,7 @@ import org.springframework.util.Assert;
|
||||
* Stub implementation for {@link AuditorAware}. Returns {@literal null} for the current auditor.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class AuditorAwareStub implements AuditorAware<AuditableUser> {
|
||||
|
||||
@@ -32,7 +33,7 @@ public class AuditorAwareStub implements AuditorAware<AuditableUser> {
|
||||
|
||||
public AuditorAwareStub(AuditableUserRepository repository) {
|
||||
|
||||
Assert.notNull(repository);
|
||||
Assert.notNull(repository, "AuditableUserRepository must not be null!");
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2011 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -40,8 +40,8 @@ public class SampleEntityPK implements Serializable {
|
||||
|
||||
public SampleEntityPK(String first, String second) {
|
||||
|
||||
Assert.notNull(first);
|
||||
Assert.notNull(second);
|
||||
Assert.notNull(first, "First must not be null!");
|
||||
Assert.notNull(second, "Second must not be null!");
|
||||
this.first = first;
|
||||
this.second = second;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2011 the original author or authors.
|
||||
* Copyright 2008-2017 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.
|
||||
@@ -38,6 +38,7 @@ import org.springframework.util.Assert;
|
||||
* intermediate interface.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = "classpath:config/namespace-customfactory-context.xml")
|
||||
@@ -57,8 +58,6 @@ public class CustomRepositoryFactoryConfigTests {
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public void testCustomFactoryUsed() {
|
||||
|
||||
Assert.notNull(userRepository);
|
||||
userRepository.customMethod(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user