Class AbstractTestRest
- java.lang.Object
-
- org.projectnessie.jaxrs.AbstractRest
-
- org.projectnessie.jaxrs.AbstractRestAssign
-
public abstract class AbstractTestRest extends AbstractRestNamespace
Base test class for Nessie REST APIs.Base class organization
(See below for reasons)This abstract test class represents the base test class for Jersey based tests and tests in Quarkus.
Every base class must extend each other, as a rule of thumb, maintain alphabetical order.
Another rule of thumb: when a class reaches ~ 500 LoC, split it, when it makes sense.
Reasons for the "chain of base classes"
Tests have been moved to base classes so that this class is not a "monster of couple thousand lines of code".
Splitting
AbstractTestRestinto separate classes and including those via@Nestedwith plain JUnit 5 works fine. But it does not work as a@QuarkusTestfor several reasons.Using
@Nestedtest classes like this does not work, because Quarkus considers the non-static inner classes as a separate test classes and fails horribly, mostly complaining that the inner test class is not in one of the expected class folders.Even worse is that the whole Quarkus machinery is started for each nested test class and not just for the actual test class.
As an alternative it felt doable to refactor the former inner classes to interfaces (so test methods become default methods), but that does not work as well due to an NPE, when
QuarkusSecurityTestExtension.beforeEachtries to find the@TestSecurityannotation - it just asserts whether the currentClassis!= Object.class, butClass.getSuperclass()returnsnullfor interfaces - hence the NPE there.The "solution" here is to keep the separate classes but let each extend another - so different groups of tests are kept in a single class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.projectnessie.jaxrs.AbstractRestContents
AbstractRestContents.ContentAndOperationType
-
-
Field Summary
-
Fields inherited from class org.projectnessie.jaxrs.AbstractRestInvalidWithHttp
COMMA_VALID_HASH_1, COMMA_VALID_HASH_2, COMMA_VALID_HASH_3
-
-
Constructor Summary
Constructors Constructor Description AbstractTestRest()
-
Method Summary
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestNamespace
testEmptyNamespace, testNamespaceConflictWithOtherContent, testNamespaceDeletion, testNamespaceMerge, testNamespaceMergeWithConflict, testNamespaces, testNamespacesRetrieval, testNamespacesWithAndWithoutZeroBytes, testNamespaceWithProperties
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestRefLog
testReflog
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestReferences
createRecreateDefaultBranch, createReferences, filterReferences, forbiddenReferenceNames, getAllReferences, getUnknownReference, referenceNames, testReferencesHaveMetadataProperties, testSingleReferenceHasMetadataProperties
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestMisc
checkCelScriptFailureReporting, checkServerErrorPropagation, checkSpecialCharacterRoundTrip, testSupportedApiVersions
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestMergeTransplant
merge, mergeWithNamespaces, transplant
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestInvalidWithHttp
invalidBranchNames, invalidHashes, invalidTags
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestInvalidRefs
testInvalidNamedRefs, testUnknownHashesOnValidNamedRefs, testValidHashesOnValidNamedRefs
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestEntries
filterEntriesByNamespace, filterEntriesByNamespaceAndPrefixDepth, filterEntriesByType
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestDiff
diffRefModes, testDiff
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestContents
contentAndOperationTypes, multiget, verifyAllContentAndOperationTypes, verifyContentAndOperationTypesIndividually
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestCommitLog
commitLogExtended, commitLogExtendedForUnchangedOperation, commitLogPaging, commitLogPagingAndFilteringByAuthor, filterCommitLogByAuthor, filterCommitLogByCommitRange, filterCommitLogByProperties, filterCommitLogByTimeRange, filterCommitLogOperations
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRestAssign
testAssignRefToFreshMain
-
Methods inherited from class org.projectnessie.jaxrs.AbstractRest
createBranch, createBranch, createCommits, deleteBranch, getApi, getHttpClient, getOrCreateEmptyBranch, getUri, init, init, maybeAsDetachedName, setUp, tearDown
-
-