NugetPackageControllerTest improvements
@@ -34,7 +34,6 @@ public class NugetPackageControllerTest extends RestAssuredBaseTest
private static final String REPOSITORY_RELEASES_1 = "nuget-releases-1";
-
@BeforeClass
public static void cleanUp()
throws Exception
@@ -111,7 +110,8 @@ public class NugetPackageControllerTest extends RestAssuredBaseTest
given().header("User-Agent", "NuGet/*")
.header("X-NuGet-ApiKey",
"eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTdHJvbmdib3giLCJqdGkiOiJ0SExSbWU4eFJOSnJjNXVXdTVkZDhRIiwic3V" +
- "iIjoiYWRtaW4iLCJzZWN1cml0eS10b2tlbi1rZXkiOiJhZG1pbi1zZWNyZXQifQ.xRWxXt5yob5qcHjsvV1YsyfY3C-X" +
+ "iIjoiYWRtaW4iLCJzZWN1cml0eS10b2tlbi1rZXkiOiJhZG1pbi1zZWNyZXQifQ.xRWxXt5yob5qcHjsvV1YsyfY3C-X"
+ +
"Ft9oKPABY0tYx88")
.header("Content-Type", "multipart/form-data; boundary=---------------------------123qwe")
.body(contentStream.toByteArray())
@@ -170,6 +170,18 @@ public class NugetPackageControllerTest extends RestAssuredBaseTest
.then()
.statusCode(HttpStatus.CREATED.value());
+ // Count
+ given().header("User-Agent", "NuGet/*")
+ .when()
+ .get(getContextBaseUrl() + "/storages/" + STORAGE_ID + "/" + REPOSITORY_RELEASES_1
+ + String.format("/Search()/$count?$filter=%s&searchTerm=%s&targetFramework=",
+ "IsLatestVersion", "Test"))
+ .then()
+ .statusCode(HttpStatus.OK.value())
+ .and()
+ .assertThat()
+ .body(equalTo("1"));
+
// Search
given().header("User-Agent", "NuGet/*")
.when()
@@ -180,7 +192,10 @@ public class NugetPackageControllerTest extends RestAssuredBaseTest
.statusCode(HttpStatus.OK.value())
.and()
.assertThat()
- .body("feed.title", equalTo("Packages"));
+ .body("feed.title", equalTo("Packages"))
+ .and()
+ .assertThat()
+ .body("feed.entry[0].title", equalTo("Org.Carlspring.Strongbox.Nuget.Test.Search"));
}
}
