Commit 6ee06ea0 authored by ethiraj krishnamanaidu's avatar ethiraj krishnamanaidu
Browse files

Merge branch 'sync' into 'master'

Sync up with latest osdu delfi code base

See merge request !2
parents 3f90d1b4 876fc3d4
Pipeline #7816 failed with stages
in 8 minutes and 11 seconds
......@@ -31,43 +31,18 @@ mvn clean install
```
## Running Azure Catalog Service locally
### Configure Maven Settings
To obtain maven dependencies from the **Azure DevOps Artifacts** we need to configure the value for variable ${VSTS_FEED_TOKEN} described in `maven\settings.xml`:
- **Get token:**
We can use personal token generated in VSTS on [Personal Access Tokens](https://dev.azure.com/slb-swt/_usersSettings/tokens) > New token > Organization: slb-des-ext-collaboration > Create
- **Set token in your local home folder:**
Open or create `USER_HOME_FOLDER\.m2\settings.xml` and paste your personal token in `<password></password>`section.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>os-core</id>
<username>slb-des-ext-collaboration</username>
<password></password>
</server>
</servers>
</settings>
```
#### Build and run Catalog Service locally using bash
- Set the required environments described in [Release/deployment](##Release/deployment) section
- Navigate to the Catalog Service's root folder ```os-crs-catalog-service```
- Navigate to the Catalog Service's root folder ```crs-catalog-service```
- Build core and run unit tests in command line:
```bash
mvn clean install -P crs-catalog-core
mvn clean install
# To run without tests add -Dmaven.test.skip=true
```
- Navigate to the Catalog Service's Azure
- Build services in command line:
```bash
mvn clean package -P crs-catalog-aks,crs-catalog-core
```
- Navigate to the Catalog Service's root folder ```os-crs-catalog-service```
- Navigate to the Catalog Service's root folder ```crs-catalog-service```
- Run application with command
```bash
java -jar provider/crs-catalog-azure/crs-catalog-aks/target/crs-catalog-aks-1.0.0.jar
java -Dclient-id=${aad_client_id} -jar provider/crs-catalog-azure/crs-catalog-aks/target/crs-catalog-aks-1.0.0.jar
```
#### Running Azure Catalog Service using IntelliJ IDEA
......@@ -75,8 +50,8 @@ Navigate to the **Create Run/Debug Configuration** tool
Select **'Add New Configuration'** and select **Application**
Type the next commands into the suggested fields:
- Working directory: ```{path_to_the_catalog}/os-crs-catalog-service```
- Main class: ```org.opengroup.osdu.crs.CRSAKSApplication```
- Working directory: ```{path_to_the_catalog}/crs-catalog-service```
- Main class: ```org.opengroup.osdu.crs.CrsAksApplication```
- Use classpath of module: ```crs-catalog-aks```
***Note: If you don't see "crs-catalog-aks" in the dropdown menu - find appropriate pom.xml and click "Add as a Maven project"***
- Environment variables: Set the required environments described in [Release/deployment](##Release/deployment) section
......@@ -129,4 +104,5 @@ requires the following environment variables:
| Variable | Contents |
|----------|----------|
| ENTITLEMENT_URL | Required |
| CRS_CATALOG_FILENAME | Required, e.g. `{path_to_the_catalog}/os-crs-catalog-service/data/crs_catalog_v2.json` |
| client-id | Required, Azure AAD client id |
| CRS_CATALOG_FILENAME | Required, e.g. `{path_to_the_catalog}/crs-catalog-service/data/crs_catalog_v2.json` |
......@@ -30,7 +30,7 @@
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<springfox-swagger2.version>2.9.2</springfox-swagger2.version>
<springfox-swagger2.version>2.7.0</springfox-swagger2.version>
</properties>
<prerequisites>
......@@ -62,6 +62,11 @@
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>jwks-rsa</artifactId>
<version>0.11.0</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
......@@ -124,7 +129,6 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.0.13</version>
</dependency>
<dependency>
......
......@@ -51,13 +51,13 @@ import org.opengroup.osdu.crs.model.search.*;
@RestController
@RequestMapping(path= "/v2")
public class CRSApi {
public class CrsCatalogApi {
private Catalog catalog = null;
private static final Logger log = Logger.getLogger(CRSApi.class.getName());
private static final Logger log = Logger.getLogger(CrsCatalogApi.class.getName());
public CRSApi(Catalog catalog) {
public CrsCatalogApi(Catalog catalog) {
this.catalog = catalog;
}
......
package org.opengroup.osdu.crs.configuration;
import org.opengroup.osdu.crs.middleware.AuthenticationRequestFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.lang.Nullable;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.servlet.HandlerExceptionResolver;
import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS;
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
private static final String[] ALLOWED_URLS = {
"/",
"/v2/api-docs",
"/swagger-resources/**",
"/swagger-ui.html",
"/webjars/**",
"/_ah/**",
"/error",
"/favicon.ico",
"/csrf" // Required to prevent errors in logs while Swagger is trying to discover a valid csrf token. Should be deleted after the issue on the Swagger's side https://github.com/springfox/springfox/issues/2578 is resolved
};
private final HandlerExceptionResolver handlerExceptionResolver;
private final String entUrl;
public SecurityConfiguration(HandlerExceptionResolver handlerExceptionResolver,
@Value("${osdu.entitlement.url}") String entUrl) {
this.handlerExceptionResolver = handlerExceptionResolver;
this.entUrl = entUrl;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
AuthenticationRequestFilter authhenticationFilter = new AuthenticationRequestFilter(entUrl, handlerExceptionResolver);
http.csrf().disable()
.sessionManagement().sessionCreationPolicy(STATELESS)
.and()
.authorizeRequests()
.anyRequest().authenticated()
.and()
.addFilterAfter(authhenticationFilter, UsernamePasswordAuthenticationFilter.class);
}
@Override
public void init(WebSecurity web) throws Exception {
web.ignoring().mvcMatchers(ALLOWED_URLS);
super.init(web);
}
}
......@@ -34,7 +34,7 @@ public class SwaggerConfiguration {
public Docket api(List<Parameter> globalParameters) {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.apis(RequestHandlerSelectors.basePackage("org.opengroup.osdu.crs.api"))
.paths(s -> !startsWithIgnoreCase(s, "/error"))
.build()
.globalOperationParameters(globalParameters)
......
package org.opengroup.osdu.crs.api;
package org.opengroup.osdu.crs.swagger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class Home {
public class HomeController {
@RequestMapping(value = {"/", "/swagger"})
public String swagger() {
return "redirect:swagger-ui.html";
......
......@@ -49,17 +49,17 @@ import org.opengroup.osdu.crs.model.TestUtils;
import org.opengroup.osdu.crs.model.interfaces.*;
import org.opengroup.osdu.crs.model.search.*;
public class CRSApiTestMock {
public class CrsCatalogApiTestMock {
@Mock
private static Catalog catalogMock;
@InjectMocks
private static CRSApi crsApi;
private static CrsCatalogApi crsCatalogApi;
@BeforeClass
public static void setUpBeforeClass() {
crsApi = new CRSApi(catalogMock);
crsCatalogApi = new CrsCatalogApi(catalogMock);
}
@Before
......@@ -69,10 +69,10 @@ public class CRSApiTestMock {
@Test
public void testGetCatalogAttributes() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
when(catalogMock.getAttributes()).thenReturn(new CatalogAttributesImpl("name", "description", "20180731"));
CatalogAttributes catalogAttributes = crsApi.getCatalogAttributes();
CatalogAttributes catalogAttributes = crsCatalogApi.getCatalogAttributes();
assertNotNull(catalogAttributes);
assertEquals("name", catalogAttributes.getName());
assertEquals("description", catalogAttributes.getDescription());
......@@ -86,10 +86,10 @@ public class CRSApiTestMock {
@Test
public void testGetCatalog() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
when(catalogMock.getCatalogResponse()).thenReturn(new CatalogImpl());
Catalog catalog = crsApi.getCatalog();
Catalog catalog = crsCatalogApi.getCatalog();
assertNotNull(catalog);
}
catch(Exception ex) {
......@@ -100,12 +100,12 @@ public class CRSApiTestMock {
@Test
public void testGetAllCRSes() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<CRS> allCRSes = new ArrayList<>();
allCRSes.add(new EarlyBoundCRSImpl());
when(catalogMock.getAllCRSes()).thenReturn(allCRSes);
CRSResults results = crsApi.getAllCRSes(0, 100, "essence");
CRSResults results = crsCatalogApi.getAllCRSes(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " CRSes");
......@@ -118,7 +118,7 @@ public class CRSApiTestMock {
@Test
public void testGetCRS() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("LateBoundCRSEssence.json");
LateBoundCRSEssence lateBoundCRSEssence = LateBoundCRSEssenceImpl.fromJson(essenceJson);
......@@ -127,7 +127,7 @@ public class CRSApiTestMock {
lateBoundCRS.setEssence(lateBoundCRSEssence);
when(catalogMock.getCRS((CRSEssence)lateBoundCRSEssence)).thenReturn((CRS)lateBoundCRS);
CRSRequest request = new CRSRequest(anyCRSEssence);
CRS result = crsApi.getCRS(request, "essence");
CRS result = crsCatalogApi.getCRS(request, "essence");
assertNotNull(result);
}
catch(Exception ex) {
......@@ -138,7 +138,7 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetCRSBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
CRSEssenceImpl essence = null;
try {
String essenceJson = TestUtils.readFile("LateBoundCRSEssence.json");
......@@ -150,17 +150,17 @@ public class CRSApiTestMock {
}
when(catalogMock.getCRS(any())).thenThrow(AppException.class);
CRSRequest request = new CRSRequest(essence);
crsApi.getCRS(request, "essence");
crsCatalogApi.getCRS(request, "essence");
}
@Test
public void testGetLateBoundCRSes() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<LateBoundCRS> lateBoundCRSes = new ArrayList<>();
lateBoundCRSes.add(new LateBoundCRSImpl());
when(catalogMock.getLateBoundCRSes()).thenReturn(lateBoundCRSes);
LateBoundCRSResults results = crsApi.getLateBoundCRSes(0, 100, "Persistable");
LateBoundCRSResults results = crsCatalogApi.getLateBoundCRSes(0, 100, "Persistable");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " LateBoundCRSes");
......@@ -173,14 +173,14 @@ public class CRSApiTestMock {
@Test
public void testGetLateBoundCRS() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("LateBoundCRSEssence.json");
LateBoundCRSEssenceImpl essence = LateBoundCRSEssenceImpl.fromJson(essenceJson);
LateBoundCRS crs = new LateBoundCRSImpl();
when(catalogMock.getLateBoundCRS(essence)).thenReturn(crs);
LateBoundCRSRequest request = new LateBoundCRSRequest(essence);
LateBoundCRS result = crsApi.getLateBoundCRS(request, "Essence");
LateBoundCRS result = crsCatalogApi.getLateBoundCRS(request, "Essence");
assertNotNull(result);
assertEquals(crs, result);
}
......@@ -192,21 +192,21 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetLateBoundCRSBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
when(catalogMock.getLateBoundCRS(any())).thenThrow(AppException.class);
LateBoundCRSRequest request = new LateBoundCRSRequest(null, null);
crsApi.getLateBoundCRS(request, null);
crsCatalogApi.getLateBoundCRS(request, null);
}
@Test
public void testGetEarlyBoundCRSes() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<EarlyBoundCRS> earlyBoundCRSes = new ArrayList<>();
earlyBoundCRSes.add(new EarlyBoundCRSImpl());
when(catalogMock.getEarlyBoundCRSes()).thenReturn(earlyBoundCRSes);
EarlyBoundCRSResults results = crsApi.getEarlyBoundCRSes(0, 100, "essence");
EarlyBoundCRSResults results = crsCatalogApi.getEarlyBoundCRSes(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " EarlyBoundCRSes");
......@@ -219,14 +219,14 @@ public class CRSApiTestMock {
@Test
public void testGetEarlyBoundCRS() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("EarlyBoundCRSEssence.json");
EarlyBoundCRSEssenceImpl essence = EarlyBoundCRSEssenceImpl.fromJson(essenceJson);
EarlyBoundCRS crs = new EarlyBoundCRSImpl();
when(catalogMock.getEarlyBoundCRS(essence)).thenReturn(crs);
EarlyBoundCRSRequest request = new EarlyBoundCRSRequest(essence);
EarlyBoundCRS result = crsApi.getEarlyBoundCRS(request, "essence");
EarlyBoundCRS result = crsCatalogApi.getEarlyBoundCRS(request, "essence");
assertNotNull(result);
assertEquals(crs, result);
}
......@@ -238,21 +238,21 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetEarlyBoundCRSBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
when(catalogMock.getEarlyBoundCRS(any())).thenThrow(AppException.class);
EarlyBoundCRSRequest request = new EarlyBoundCRSRequest(null, null);
crsApi.getEarlyBoundCRS(request, "essence");
crsCatalogApi.getEarlyBoundCRS(request, "essence");
}
@Test
public void testGetCompoundCRSes() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<CompoundCRS> compoundCRSes = new ArrayList<>();
compoundCRSes.add(new CompoundCRSImpl());
when(catalogMock.getCompoundCRSes()).thenReturn(compoundCRSes);
CompoundCRSResults results = crsApi.getCompoundCRSes(0, 100, "essence");
CompoundCRSResults results = crsCatalogApi.getCompoundCRSes(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " CompoundCRSes");
......@@ -265,14 +265,14 @@ public class CRSApiTestMock {
@Test
public void testGetCompoundCRS() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("CompoundCRSEssence.json");
CompoundCRSEssenceImpl essence = CompoundCRSEssenceImpl.fromJson(essenceJson);
CompoundCRS crs = new CompoundCRSImpl();
when(catalogMock.getCompoundCRS(essence)).thenReturn(crs);
CompoundCRSRequest request = new CompoundCRSRequest(essence);
CompoundCRS result = crsApi.getCompoundCRS(request, "essence");
CompoundCRS result = crsCatalogApi.getCompoundCRS(request, "essence");
assertNotNull(result);
assertEquals(crs, result);
}
......@@ -284,21 +284,21 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetCompoundCRSBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
when(catalogMock.getCompoundCRS(any())).thenThrow(AppException.class);
CompoundCRSRequest request = new CompoundCRSRequest(null);
crsApi.getCompoundCRS(request, "essence");
crsCatalogApi.getCompoundCRS(request, "essence");
}
@Test
public void testGetAllCTs() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<CT> allCTs = new ArrayList<>();
allCTs.add(new CompoundCTImpl());
when(catalogMock.getAllCTs()).thenReturn(allCTs);
CTResults results = crsApi.getAllCTs(0, 100, "essence");
CTResults results = crsCatalogApi.getAllCTs(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " CTs");
......@@ -311,12 +311,12 @@ public class CRSApiTestMock {
@Test
public void testGetSingleCTs() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<SingleCT> singleCTs = new ArrayList<>();
singleCTs.add(new SingleCTImpl());
when(catalogMock.getSingleCTs()).thenReturn(singleCTs);
SingleCTResults results = crsApi.getSingleCTs(0, 100, "essence");
SingleCTResults results = crsCatalogApi.getSingleCTs(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " SingleCTs");
......@@ -329,14 +329,14 @@ public class CRSApiTestMock {
@Test
public void testGetSingleCT() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("SingleCTEssence.json");
SingleCTEssenceImpl essence = SingleCTEssenceImpl.fromJson(essenceJson);
SingleCT ct = new SingleCTImpl();
when(catalogMock.getSingleCT(essence)).thenReturn(ct);
SingleCTRequest request = new SingleCTRequest(essence);
SingleCT result = crsApi.getSingleCT(request, "essence");
SingleCT result = crsCatalogApi.getSingleCT(request, "essence");
assertNotNull(result);
assertEquals(ct, result);
}
......@@ -348,21 +348,21 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetSingleCTBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
when(catalogMock.getSingleCT(any())).thenThrow(AppException.class);
SingleCTRequest request = new SingleCTRequest(null);
crsApi.getSingleCT(request, "essence");
crsCatalogApi.getSingleCT(request, "essence");
}
@Test
public void testGetCompoundCTs() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<CompoundCT> compoundCTs = new ArrayList<>();
compoundCTs.add(new CompoundCTImpl());
when(catalogMock.getCompoundCTs()).thenReturn(compoundCTs);
CompoundCTResults results = crsApi.getCompoundCTs(0, 100, "essence");
CompoundCTResults results = crsCatalogApi.getCompoundCTs(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " CompoundCTs");
......@@ -375,14 +375,14 @@ public class CRSApiTestMock {
@Test
public void testGetCompoundCT() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("CompoundCTEssence.json");
CompoundCTEssenceImpl essence = CompoundCTEssenceImpl.fromJson(essenceJson);
CompoundCT ct = new CompoundCTImpl();
when(catalogMock.getCompoundCT(essence)).thenReturn(ct);
CompoundCTRequest request = new CompoundCTRequest(essence);
CompoundCT result = crsApi.getCompoundCT(request, "essence");
CompoundCT result = crsCatalogApi.getCompoundCT(request, "essence");
assertNotNull(result);
assertEquals(ct, result);
}
......@@ -394,21 +394,21 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetCompoundCTBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
when(catalogMock.getCompoundCT(any())).thenThrow(AppException.class);
CompoundCTRequest request = new CompoundCTRequest(null);
crsApi.getCompoundCT(request, "essence");
crsCatalogApi.getCompoundCT(request, "essence");
}
@Test
public void testGetAreasOfUse() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
List<AreaOfUse> areasOfUse = new ArrayList<>();
areasOfUse.add(new AreaOfUseImpl());
when(catalogMock.getAreasOfUse()).thenReturn(areasOfUse);
AreaOfUseResults results = crsApi.getAreasOfUse(0, 100, "essence");
AreaOfUseResults results = crsCatalogApi.getAreasOfUse(0, 100, "essence");
assertNotNull(results);
assertEquals(1, results.getCount());
System.out.println("There are " + results.getCount() + " AreasOfUse");
......@@ -421,14 +421,14 @@ public class CRSApiTestMock {
@Test
public void testGetAreaOfUse() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
String essenceJson = TestUtils.readFile("AreaOfUseEssence.json");
AreaOfUseEssenceImpl essence = AreaOfUseEssenceImpl.fromJson(essenceJson);
AreaOfUse areaOfUse = new AreaOfUseImpl();
when(catalogMock.getAreaOfUse(essence)).thenReturn(areaOfUse);
AreaOfUseRequest request = new AreaOfUseRequest(essence);
AreaOfUse result = crsApi.getAreaOfUse(request, "essence");
AreaOfUse result = crsCatalogApi.getAreaOfUse(request, "essence");
assertNotNull(result);
assertEquals(areaOfUse, result);
}
......@@ -440,15 +440,15 @@ public class CRSApiTestMock {
@Test(expected = AppException.class)
public void testGetAreaOfUseBadRequest() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
when(catalogMock.getAreaOfUse(any())).thenThrow(AppException.class);
AreaOfUseRequest request = new AreaOfUseRequest(null);
crsApi.getAreaOfUse(request, "essence");
crsCatalogApi.getAreaOfUse(request, "essence");
}
@Test
public void testSearchAreasOfUse() {
assertNotNull(crsApi);
assertNotNull(crsCatalogApi);
try {
double longitudeLeft = -180;
double latitudeLower = -90;
......@@ -465,7 +465,7 @@ public class CRSApiTestMock {
AreaOfUseResults areaOfUseResults = new AreaOfUseResults(areasOfUse, offset, totalCount);
when(catalogMock.searchAreasOfUse(request, boundingBox, offset, limit, RepresentationMode.ESSENCE)).thenReturn(areaOfUseResults);
AreaOfUseResults results;
results = crsApi.searchAreasOfUse(request, longitudeLeft, latitudeLower, longitudeRight, latitudeUpper, offset, limit, "essence");
results = crsCatalogApi.searchAreasOfUse(request, longitudeLeft, latitudeLower, longitudeRight, latitudeUpper, offset, limit, "essence");
assertNotNull(results);
assertEquals(offset, results.getOffset());
assertEquals(areasOfUse.size(), results.getCount());