diff --git a/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java b/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java index e5f7695f2..f4079977f 100644 --- a/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java +++ b/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java @@ -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 extends CdiRepositoryBean { * @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 entityManagerBean, Set qualifiers, - Class repositoryType, CustomRepositoryImplementationDetector detector) { + Class 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; } diff --git a/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java b/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java index 954e9fa53..2006f12d0 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java @@ -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; diff --git a/src/main/java/org/springframework/data/jpa/repository/query/CriteriaQueryParameterBinder.java b/src/main/java/org/springframework/data/jpa/repository/query/CriteriaQueryParameterBinder.java index 3955ab605..9b192e718 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/CriteriaQueryParameterBinder.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/CriteriaQueryParameterBinder.java @@ -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> expressions) { super(parameters, values); - Assert.notNull(expressions); + + Assert.notNull(expressions, "Iterable of ParameterMetadata must not be null!"); this.expressions = expressions.iterator(); } diff --git a/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java b/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java index 6b64b85d8..81fb0d0ab 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java @@ -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 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; } diff --git a/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java b/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java index 0fd17468f..f198e94fc 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java @@ -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; diff --git a/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java b/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java index f78ff8847..73dee3da8 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java @@ -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!"); diff --git a/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java b/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java index 9d101d26a..781db7462 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java @@ -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 * @param part must not be {@literal null}. * @param type must not be {@literal null}. - * @param name + * @param parameter * @return */ private ParameterMetadata next(Part part, Class 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 expressionType = expression.getJavaType(); diff --git a/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java b/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java index 060f85cae..6ae1452d0 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java @@ -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 - * @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 Query applyAndBind(String queryString, Iterable 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 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)); diff --git a/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java b/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java index bc713ae95..1f612e45a 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java @@ -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; diff --git a/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java b/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java index 92d325f1f..959128a16 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java @@ -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 extends AbstractEntityInformation implements JpaEntityInformation { @@ -56,8 +57,8 @@ public abstract class JpaEntityInformationSupport ex @SuppressWarnings({ "rawtypes", "unchecked" }) public static JpaEntityInformation getEntityInformation(Class 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(); diff --git a/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java b/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java index c92c61d48..22b693c96 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java @@ -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 extends J super(domainClass); - Assert.notNull(metamodel); + Assert.notNull(metamodel, "Metamodel must not be null!"); this.metamodel = metamodel; ManagedType type = metamodel.managedType(domainClass); @@ -210,7 +210,9 @@ public class JpaMetamodelEntityInformation 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); } diff --git a/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java b/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java index 01eb14543..a4a2bfa84 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java @@ -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); diff --git a/src/main/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupport.java b/src/main/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupport.java index 22a4fef89..294a117ad 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupport.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupport.java @@ -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 from(EntityPath... paths) { diff --git a/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java b/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java index 5e33031ed..9ad51732b 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java @@ -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); diff --git a/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java b/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java index a64d34243..104f919d3 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java @@ -90,8 +90,8 @@ public class SimpleJpaRepository */ public SimpleJpaRepository(JpaEntityInformation 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 private Root applySpecificationToCriteria(Specification spec, Class domainClass, CriteriaQuery 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 root = query.from(domainClass); if (spec == null) { @@ -743,7 +744,7 @@ public class SimpleJpaRepository */ private static Long executeCountQuery(TypedQuery query) { - Assert.notNull(query); + Assert.notNull(query, "TypedQuery must not be null!"); List totals = query.getResultList(); Long total = 0L; diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java b/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java index 34c39eabe..bbfc3314a 100644 --- a/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java @@ -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 { @@ -32,7 +33,7 @@ public class AuditorAwareStub implements AuditorAware { public AuditorAwareStub(AuditableUserRepository repository) { - Assert.notNull(repository); + Assert.notNull(repository, "AuditableUserRepository must not be null!"); this.repository = repository; } diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java b/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java index 85c69a443..37769621c 100644 --- a/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java @@ -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; } diff --git a/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java index 876b8bfe6..953cb7ff8 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java @@ -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); }