@@ -986,15 +986,50 @@ public void testDeleteArtifactsInGroup() throws Exception {
986
986
.statusCode (204 );
987
987
988
988
// Verify that all 3 artifacts were deleted
989
- TestUtils .retry (() -> {
990
- given ()
991
- .when ()
992
- .queryParam ("group" , group )
993
- .get ("/registry/v3/search/artifacts" )
994
- .then ()
995
- .statusCode (200 )
996
- .body ("count" , equalTo (0 ));
997
- });
989
+ given ()
990
+ .when ()
991
+ .queryParam ("group" , group )
992
+ .get ("/registry/v3/search/artifacts" )
993
+ .then ()
994
+ .statusCode (200 )
995
+ .body ("count" , equalTo (0 ));
996
+ }
997
+
998
+ @ Test
999
+ public void testDeleteGroupWithArtifacts () throws Exception {
1000
+ String group = "testDeleteGroupWithArtifacts" ;
1001
+ String artifactContent = resourceToString ("openapi-empty.json" );
1002
+
1003
+ // Create several artifacts in the group.
1004
+ createArtifact (group , "EmptyAPI-1" , ArtifactType .OPENAPI , artifactContent );
1005
+ createArtifact (group , "EmptyAPI-2" , ArtifactType .OPENAPI , artifactContent );
1006
+ createArtifact (group , "EmptyAPI-3" , ArtifactType .OPENAPI , artifactContent );
1007
+
1008
+ // Make sure we can search for all three artifacts in the group.
1009
+ given ()
1010
+ .when ()
1011
+ .queryParam ("group" , group )
1012
+ .get ("/registry/v3/search/artifacts" )
1013
+ .then ()
1014
+ .statusCode (200 )
1015
+ .body ("count" , equalTo (3 ));
1016
+
1017
+ // Delete the *group* (should delete all artifacts)
1018
+ given ()
1019
+ .when ()
1020
+ .pathParam ("groupId" , group )
1021
+ .delete ("/registry/v3/groups/{groupId}" )
1022
+ .then ()
1023
+ .statusCode (204 );
1024
+
1025
+ // Verify that all 3 artifacts were deleted
1026
+ given ()
1027
+ .when ()
1028
+ .queryParam ("group" , group )
1029
+ .get ("/registry/v3/search/artifacts" )
1030
+ .then ()
1031
+ .statusCode (200 )
1032
+ .body ("count" , equalTo (0 ));
998
1033
}
999
1034
1000
1035
@ Test
0 commit comments