From: Olivier Lamy Date: Fri, 9 Sep 2011 08:34:17 +0000 (+0000) Subject: [MRM-1512] api to configure RepositoryScanningConfiguration : more test auditlistener... X-Git-Tag: archiva-1.4-M1~343 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8566f7a26cf1bd8421e06eca1a29ebc14877868e;p=archiva.git [MRM-1512] api to configure RepositoryScanningConfiguration : more test auditlistener call for consumers modification git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1167037 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java index 92eb20533..85e381d17 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java @@ -124,6 +124,18 @@ public class ArchivaAdministrationTest assertEquals( initialSize + 1, archivaAdministration.getRepositoryScanning().getKnownContentConsumers().size() ); assertTrue( archivaAdministration.getRepositoryScanning().getKnownContentConsumers().contains( "foo" ) ); + + archivaAdministration.removeKnownContentConsumer( "foo", getFakeAuditInformation() ); + + + assertEquals( initialSize , + archivaAdministration.getRepositoryScanning().getKnownContentConsumers().size() ); + assertFalse( archivaAdministration.getRepositoryScanning().getKnownContentConsumers().contains( "foo" ) ); + + assertEquals( 2, mockAuditListener.getAuditEvents().size() ); + assertEquals( AuditEvent.ENABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 0 ).getAction() ); + assertEquals( AuditEvent.DISABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 1 ).getAction() ); + mockAuditListener.clearEvents(); } @@ -147,8 +159,14 @@ public class ArchivaAdministrationTest archivaAdministration.getRepositoryScanning().getInvalidContentConsumers().size() ); assertTrue( archivaAdministration.getRepositoryScanning().getInvalidContentConsumers().contains( "foo" ) ); - assertEquals( 1, mockAuditListener.getAuditEvents().size() ); + archivaAdministration.removeInvalidContentConsumer( "foo", getFakeAuditInformation() ); + + assertEquals( initialSize, archivaAdministration.getRepositoryScanning().getInvalidContentConsumers().size() ); + assertFalse( archivaAdministration.getRepositoryScanning().getInvalidContentConsumers().contains( "foo" ) ); + + assertEquals( 2, mockAuditListener.getAuditEvents().size() ); assertEquals( AuditEvent.ENABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 0 ).getAction() ); + assertEquals( AuditEvent.DISABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 1 ).getAction() ); mockAuditListener.clearEvents();