From: Olivier Lamy Date: Wed, 29 May 2013 13:17:49 +0000 (+0000) Subject: prevent NPE with testing first X-Git-Tag: archiva-2.0.0-RC1~346 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ecbb16c6e28358024e46ec830552f796b034633a;p=archiva.git prevent NPE with testing first git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1487473 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java index 2cd0fcf13..28b9b458f 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java @@ -53,8 +53,8 @@ import java.util.List; import java.util.Map; import java.util.TimeZone; -@RunWith(ArchivaSpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" }) +@RunWith( ArchivaSpringJUnit4ClassRunner.class ) +@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } ) public abstract class AbstractMetadataRepositoryTest extends TestCase { @@ -188,6 +188,7 @@ public abstract class AbstractMetadataRepositoryTest // test that namespace and project is also constructed assertEquals( Collections.singletonList( TEST_NAMESPACE ), repository.getRootNamespaces( TEST_REPO_ID ) ); ProjectMetadata projectMetadata = repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + assertNotNull( projectMetadata ); assertEquals( TEST_PROJECT, projectMetadata.getId() ); assertEquals( TEST_NAMESPACE, projectMetadata.getNamespace() ); }