Skip to content
Snippets Groups Projects
Commit ee166730 authored by Rustam Lotsmanenko (EPAM)'s avatar Rustam Lotsmanenko (EPAM) Committed by Rostislav Dublin (EPAM)
Browse files

GONRG-1059

Updated all poms.
parent 25633b21
No related branches found
No related tags found
No related merge requests found
...@@ -142,18 +142,19 @@ You will need to have the following environment variables defined. ...@@ -142,18 +142,19 @@ You will need to have the following environment variables defined.
| `DE_EDITOR_TESTER` | `********` | A base64 encoded google service account json credentials with _editor_ level authorization for OSDU services | yes | https://console.cloud.google.com/iam-admin/serviceaccounts | | `DE_EDITOR_TESTER` | `********` | A base64 encoded google service account json credentials with _editor_ level authorization for OSDU services | yes | https://console.cloud.google.com/iam-admin/serviceaccounts |
| `DE_NO_ACCESS_TESTER` | `********` | A base64 encoded google service account json credentials with no authorization for OSDU services | yes | https://console.cloud.google.com/iam-admin/serviceaccounts | | `DE_NO_ACCESS_TESTER` | `********` | A base64 encoded google service account json credentials with no authorization for OSDU services | yes | https://console.cloud.google.com/iam-admin/serviceaccounts |
| `REGISTER_BASE_URL` | ex `https://os-register-dot-opendes.appspot.com/` | Register API endpoint | no | output of infrastructure deployment | | `REGISTER_BASE_URL` | ex `https://os-register-dot-opendes.appspot.com/` | Register API endpoint | no | output of infrastructure deployment |
| `ENVIRONMENT` | ex `local` | 'local' for local testing or 'dev' for dev testing | no | - | | `ENVIRONMENT` | ex `local` OR `dev` | 'local' for local testing or 'dev' for dev testing | no | - |
| `SUBSCRIBER_SECRET` | ex `********` | Sensitive secret to run HMAC tests | yes | output of infrastructure deployment | | `SUBSCRIBER_SECRET` | ex `********` | String in hex , must match pattern ^[a-zA-Z0-9]{8,30}+$ & be in register variable SUBSCRIBER_SECRET | yes | - |
| `INTEGRATION_TEST_AUDIENCE` | ex `*****.apps.googleusercontent.com` | Client ID for getting access to cloud resources | yes | https://console.cloud.google.com/apis/credentials | | `INTEGRATION_TEST_AUDIENCE` | ex `*****.apps.googleusercontent.com` | Client ID for getting access to cloud resources | yes | https://console.cloud.google.com/apis/credentials |
| `CLIENT_TENANT` | ex `opendes` | Client tenant | no | - | | `CLIENT_TENANT` | ex `nonexistenttenant` | Client tenant, it's supposed to be tenant that we do not have access to, it can be not existing tenant| no | - |
| `OSDU_TENANT` | ex `osdu` | Osdu tenant | no | - | | `OSDU_TENANT` | ex `osdu` | Osdu tenant | no | - |
| `SUBSCRIPTION_ID` | `********` | Subscription id | no | - | | `SUBSCRIPTION_ID` | `********` | A base64 encoded string of subscribed topic + subscriber url ex `records-changedhttp://localhost:8081/api/register/v1/test/challenge/1` | no | - |
| `REGISTER_CUSTOM_PUSH_URL` | ex`https://os-register-dot-opendes.appspot.com/api/register/v1/test/challenge/1` | Register push url, that will act as subscriber | no | - |
**Entitlements configuration for integration accounts** **Entitlements configuration for integration accounts**
| DE_OPS_TESTER | DE_ADMIN_TESTER | DE_EDITOR_TESTER | DE_NO_ACCESS_TESTER | DE_OPS_TESTER | DE_ADMIN_TESTER | DE_EDITOR_TESTER | DE_NO_ACCESS_TESTER
| --- | --- | --- | --- | | --- | --- | --- | --- |
| service.entitlements.user<br/>users.datalake.ops<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | service.entitlements.user<br/>users.datalake.admins<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | users<br/>service.entitlements.user<br/>users.datalake.editors<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | users<br/>service.entitlements.user<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | service.entitlements.user<br/>users.datalake.ops<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | service.entitlements.user<br/>users.datalake.admins<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | service.entitlements.user<br/>users.datalake.editors<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | service.entitlements.user<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com
Execute following command to build code and run all the integration tests: Execute following command to build code and run all the integration tests:
......
...@@ -99,8 +99,12 @@ public class DatastoreActionRepo implements IActionRepo { ...@@ -99,8 +99,12 @@ public class DatastoreActionRepo implements IActionRepo {
txn.put(entity); txn.put(entity);
txn.commit(); txn.commit();
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) { if (ex.getCode() == 10) {
return throwConflict(); if (ex.getMessage().startsWith("too much contention")) {
return throwConflict();
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else } else
throw ex; throw ex;
} finally { } finally {
...@@ -129,9 +133,13 @@ public class DatastoreActionRepo implements IActionRepo { ...@@ -129,9 +133,13 @@ public class DatastoreActionRepo implements IActionRepo {
output = true; output = true;
} }
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) if (ex.getCode() == 10) {
throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS."); if (ex.getMessage().startsWith("too much contention")) {
else throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS.");
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex; throw ex;
} finally { } finally {
if (txn.isActive()) { if (txn.isActive()) {
......
...@@ -64,9 +64,13 @@ public class DatastoreDdmsRepository implements IDdmsRepository { ...@@ -64,9 +64,13 @@ public class DatastoreDdmsRepository implements IDdmsRepository {
txn.put(entity); txn.put(entity);
txn.commit(); txn.commit();
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) if (ex.getCode() == 10) {
throw new AppException(409, "Conflict", "A DDMS already exists with the same id"); if (ex.getMessage().startsWith("too much contention")) {
else throw new AppException(409, "Conflict", "A DDMS already exists with the same id");
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex; throw ex;
} finally { } finally {
if (txn.isActive()) { if (txn.isActive()) {
...@@ -118,9 +122,13 @@ public class DatastoreDdmsRepository implements IDdmsRepository { ...@@ -118,9 +122,13 @@ public class DatastoreDdmsRepository implements IDdmsRepository {
output = true; output = true;
} }
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) if (ex.getCode() == 10) {
throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS."); if (ex.getMessage().startsWith("too much contention")) {
else throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS.");
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex; throw ex;
} finally { } finally {
if (txn.isActive()) { if (txn.isActive()) {
......
...@@ -108,6 +108,7 @@ public class DatastoreAccess implements IDatastoreAccess { ...@@ -108,6 +108,7 @@ public class DatastoreAccess implements IDatastoreAccess {
@Override @Override
public List<Subscription> getAll() throws Exception { public List<Subscription> getAll() throws Exception {
Datastore ds = dataStoreTenants.get(tenantInfo.getName()); Datastore ds = dataStoreTenants.get(tenantInfo.getName());
Query<Entity> q = Query Query<Entity> q = Query
.newGqlQueryBuilder(Query.ResultType.ENTITY, "Select * from SUBSCRIPTION") .newGqlQueryBuilder(Query.ResultType.ENTITY, "Select * from SUBSCRIPTION")
...@@ -137,9 +138,13 @@ public class DatastoreAccess implements IDatastoreAccess { ...@@ -137,9 +138,13 @@ public class DatastoreAccess implements IDatastoreAccess {
txn.put(entity); txn.put(entity);
txn.commit(); txn.commit();
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) if (ex.getCode() == 10) {
throw new AppException(409, "Conflict", "A subscriber already exists with the same topic and endpoint combination"); if (ex.getMessage().startsWith("too much contention")) {
else throw new AppException(409, "Conflict", "A subscriber already exists with the same topic and endpoint combination");
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex; throw ex;
} catch (IOException ex) { } catch (IOException ex) {
throw new AppException(500, "Server Error", "Unexpected error creating subscription.", ex); throw new AppException(500, "Server Error", "Unexpected error creating subscription.", ex);
...@@ -169,9 +174,13 @@ public class DatastoreAccess implements IDatastoreAccess { ...@@ -169,9 +174,13 @@ public class DatastoreAccess implements IDatastoreAccess {
output = true; output = true;
} }
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) if (ex.getCode() == 10) {
throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS."); if (ex.getMessage().startsWith("too much contention")) {
else throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS.");
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex; throw ex;
} catch (IOException ex) { } catch (IOException ex) {
throw new AppException(500, "Server Error", "Unexpected error deleting subscription.", ex); throw new AppException(500, "Server Error", "Unexpected error deleting subscription.", ex);
...@@ -198,9 +207,13 @@ public class DatastoreAccess implements IDatastoreAccess { ...@@ -198,9 +207,13 @@ public class DatastoreAccess implements IDatastoreAccess {
output = true; output = true;
} }
} catch (DatastoreException ex) { } catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) if (ex.getCode() == 10) {
throw new AppException(409, "Conflict", "Another request is trying to update the same subscription."); if (ex.getMessage().startsWith("too much contention")) {
else throw new AppException(409, "Conflict", "Another request is trying to update the same subscription.");
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex; throw ex;
} catch (IOException ex) { } catch (IOException ex) {
throw new AppException(500, "Server Error", "Unexpected error updating subscription.", ex); throw new AppException(500, "Server Error", "Unexpected error updating subscription.", ex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment