File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
api/src/main/java/com/jfrog/bintray/client/api/handle
main/java/com/jfrog/bintray/client/impl/handle
test/groovy/com/jfrog/bintray/client/test/spec Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public interface RepositoryHandle extends Handle<Repository> {
2626
2727 AttributesSearchQuery searchForPackage ();
2828
29+ RepositoryHandle delete () throws BintrayCallException ;
30+
2931 boolean exists () throws BintrayCallException ;
3032
3133 String getRepositoryUri ();
Original file line number Diff line number Diff line change @@ -95,6 +95,12 @@ public AttributesSearchQuery searchForPackage() {
9595 return new AttributesSearchQueryImpl (this );
9696 }
9797
98+ @ Override
99+ public RepositoryHandle delete () throws BintrayCallException {
100+ bintrayHandle .delete (getRepositoryUri (), null );
101+ return this ;
102+ }
103+
98104 @ Override
99105 public String name () {
100106 return name ;
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ class RepoSpec extends Specification {
4848 ' rpm' | _
4949 ' deb' | _
5050 ' generic' | _
51+ ' boxes' | _
52+ ' registry' | _
53+ ' nuget' | _
54+ ' opkg' | _
5155 }
5256
5357 def ' search by attributes' () {
@@ -153,6 +157,20 @@ class RepoSpec extends Specification {
153157 updateDetails. getLabels(). sort(). equals(directJson. labels. sort())
154158 }
155159
160+ def ' Delete repository' (){
161+ setup :
162+ ObjectMapper mapper = new ObjectMapper ()
163+ RepositoryDetails repositoryDetails = mapper. readValue(repoJson, RepositoryDetails . class)
164+ RepositoryHandle repoHandle = bintray. subject(connectionProperties. username). createRepo(repositoryDetails)
165+
166+ when :
167+ bintray. subject(connectionProperties. username). repository(repositoryDetails. name). delete()
168+
169+
170+ then :
171+ ! bintray. subject(connectionProperties. username). repository(repositoryDetails. name). exists()
172+ }
173+
156174 def cleanup () {
157175 try {
158176 String repo = " /" + API_REPOS + connectionProperties. username + " /" + REPO_CREATE_NAME
You can’t perform that action at this time.
0 commit comments