Update NugetFilterODataParserTest.java
[skip ci]
@@ -45,9 +45,13 @@ public class NugetFilterODataParserTest
{
private static final String REPOSITORY_RELEASES_1 = "nfodpt-releases-1";
+
private static final String REPOSITORY_RELEASES_2 = "nfodpt-releases-2";
+
private static final String REPOSITORY_RELEASES_3 = "nfodpt-releases-3";
+
private static final String REPOSITORY_RELEASES_4 = "nfodpt-releases-4";
+
@PersistenceContext
private EntityManager entityManager;
@@ -87,9 +91,11 @@ public class NugetFilterODataParserTest
selector.select("COUNT(*)");
QueryTemplate<Long, ArtifactEntry> queryTemplate = new OQueryTemplate<>(entityManager);
+
assertThat(((OQueryTemplate<Long, ArtifactEntry>) queryTemplate).calculateQueryString(selector)).isEqualTo("SELECT COUNT(*) FROM ArtifactEntry WHERE " +
- "artifactCoordinates.coordinates.id.toLowerCase() = :id_0 AND tagSet CONTAINS (name = :name_1) AND "
- + "artifactCoordinates.coordinates.version = :version_1 AND storageId = :storageId_1 AND repositoryId = :repositoryId_2 LIMIT 1000");
+ "artifactCoordinates.coordinates.id.toLowerCase() = :id_0 AND tagSet CONTAINS (name = :name_1) AND " +
+ "artifactCoordinates.coordinates.version = :version_1 AND storageId = :storageId_1 AND repositoryId = :repositoryId_2 LIMIT 1000");
+
Map<String, Object> parameterMap = ((OQueryTemplate<Long, ArtifactEntry>) queryTemplate).exposeParameterMap(selector.getPredicate());
assertThat(parameterMap.get("id_0")).isEqualTo("org.carlspring.strongbox.nuget.test.nfpt");
@@ -115,7 +121,6 @@ public class NugetFilterODataParserTest
"1.0.2"})
Path artifactPath)
{
-
Selector<ArtifactEntry> selector = new Selector<>(ArtifactEntry.class);
NugetODataFilterQueryParser t = new NugetODataFilterQueryParser(
@@ -148,13 +153,12 @@ public class NugetFilterODataParserTest
"1.0.2"})
Path artifactPath)
{
-
Selector<ArtifactEntry> selector = new Selector<>(ArtifactEntry.class);
NugetODataFilterQueryParser t = new NugetODataFilterQueryParser(
"tolower(Id) eq '-org.carlspring.strongbox.nuget.test.nfpt'");
- assertThrows(QueryParserException.class,() -> {Predicate predicate = t.parseQuery().getPredicate();});
+ assertThrows(QueryParserException.class,() -> {Predicate predicate = t.parseQuery().getPredicate();});
}
/*
@@ -173,13 +177,12 @@ public class NugetFilterODataParserTest
"1.0.2"})
Path artifactPath)
{
-
Selector<ArtifactEntry> selector = new Selector<>(ArtifactEntry.class);
NugetODataFilterQueryParser t = new NugetODataFilterQueryParser(
"tolower(Id) eq 'org.carlspring.strongbox.nuget.test.nfpt-'");
- assertThrows(QueryParserException.class,() -> {Predicate predicate = t.parseQuery().getPredicate();});
+ assertThrows(QueryParserException.class,() -> {Predicate predicate = t.parseQuery().getPredicate();});
}
}
