From ba1c2854a0d44df1cc45084b25b4630ce9641d63 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 24 Mar 2014 01:35:54 +0000 Subject: use an utility methods to prevent npe when column values does not exist for a row git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580688 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/metadata/repository/AbstractMetadataRepositoryTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'archiva-modules/metadata/metadata-repository-api/src') 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 3f10e0624..e11911671 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 @@ -424,14 +424,16 @@ public abstract class AbstractMetadataRepositoryTest repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - assertEquals( Collections.emptyList(), new ArrayList( metadata.getFacetIds() ) ); + + Assertions.assertThat( metadata.getFacetIds() ).isNotNull().isEmpty(); metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - assertEquals( Collections.emptyList(), new ArrayList( metadata.getFacetIds() ) ); + Assertions.assertThat( metadata.getFacetIds() ).isNotNull().isEmpty(); + } @Test -- cgit v1.2.3