-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for Secured ResourceInfo objects.
Signed-off-by: Erik Merkle <emerkle@boundlessgeo.com>
- Loading branch information
Erik Merkle
committed
Mar 7, 2018
1 parent
0c186b3
commit f2c45ff
Showing
7 changed files
with
407 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/src/test/java/org/geoserver/security/decorators/SecuredCoverageInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* (c) 2018 Open Source Geospatial Foundation - all rights reserved | ||
* This code is licensed under the GPL 2.0 license, available at the root | ||
* application directory. | ||
*/ | ||
package org.geoserver.security.decorators; | ||
|
||
|
||
import org.geoserver.catalog.CoverageInfo; | ||
import org.geoserver.catalog.CoverageStoreInfo; | ||
import org.geoserver.catalog.impl.CoverageInfoImpl; | ||
import org.geoserver.catalog.impl.CoverageStoreInfoImpl; | ||
|
||
public class SecuredCoverageInfoTest extends SecuredResourceInfoTest<CoverageInfo, SecuredCoverageInfo> { | ||
|
||
@Override | ||
CoverageInfo createDelegate() { | ||
final CoverageInfo info = new CoverageInfoImpl(getCatalog()); | ||
final CoverageStoreInfo storeInfo = new CoverageStoreInfoImpl(getCatalog()); | ||
info.setStore(storeInfo); | ||
return info; | ||
} | ||
|
||
@Override | ||
SecuredCoverageInfo createSecuredDecorator(CoverageInfo delegate) { | ||
return new SecuredCoverageInfo(delegate, policy); | ||
} | ||
|
||
@Override | ||
Class getDelegateClass() { | ||
return CoverageInfo.class; | ||
} | ||
|
||
@Override | ||
Class getSecuredDecoratorClass() { | ||
return SecuredCoverageInfo.class; | ||
} | ||
|
||
@Override | ||
Class getSecuredStoreInfoClass() { | ||
return SecuredCoverageStoreInfo.class; | ||
} | ||
|
||
@Override | ||
int getStackOverflowCount() { | ||
return 500; | ||
} | ||
|
||
|
||
} |
45 changes: 45 additions & 0 deletions
45
src/main/src/test/java/org/geoserver/security/decorators/SecuredFeatureTypeInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* (c) 2018 Open Source Geospatial Foundation - all rights reserved | ||
* This code is licensed under the GPL 2.0 license, available at the root | ||
* application directory. | ||
*/ | ||
package org.geoserver.security.decorators; | ||
|
||
import org.geoserver.catalog.FeatureTypeInfo; | ||
import org.geoserver.catalog.impl.DataStoreInfoImpl; | ||
import org.geoserver.catalog.impl.FeatureTypeInfoImpl; | ||
|
||
public class SecuredFeatureTypeInfoTest extends SecuredResourceInfoTest<FeatureTypeInfo, SecuredFeatureTypeInfo> { | ||
|
||
@Override | ||
FeatureTypeInfo createDelegate() { | ||
FeatureTypeInfo info = new FeatureTypeInfoImpl(getCatalog()); | ||
info.setStore(new DataStoreInfoImpl(getCatalog())); | ||
return info; | ||
} | ||
|
||
@Override | ||
SecuredFeatureTypeInfo createSecuredDecorator(FeatureTypeInfo delegate) { | ||
return new SecuredFeatureTypeInfo(delegate, policy); | ||
} | ||
|
||
@Override | ||
Class getDelegateClass() { | ||
return FeatureTypeInfo.class; | ||
} | ||
|
||
@Override | ||
Class getSecuredDecoratorClass() { | ||
return SecuredFeatureTypeInfo.class; | ||
} | ||
|
||
@Override | ||
Class getSecuredStoreInfoClass() { | ||
return SecuredDataStoreInfo.class; | ||
} | ||
|
||
@Override | ||
int getStackOverflowCount() { | ||
return 500; | ||
} | ||
|
||
} |
Oops, something went wrong.