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
......@@ -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_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 |
| `ENVIRONMENT` | ex `local` | 'local' for local testing or 'dev' for dev testing | no | - |
| `SUBSCRIBER_SECRET` | ex `********` | Sensitive secret to run HMAC tests | yes | output of infrastructure deployment |
| `ENVIRONMENT` | ex `local` OR `dev` | 'local' for local testing or 'dev' for dev testing | no | - |
| `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 |
| `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 | - |
| `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**
| 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:
......
......@@ -99,8 +99,12 @@ public class DatastoreActionRepo implements IActionRepo {
txn.put(entity);
txn.commit();
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention")) {
return throwConflict();
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
return throwConflict();
} else {
throw new AppException(409, "Conflict", "ABORTED due to conflict");
}
} else
throw ex;
} finally {
......@@ -129,9 +133,13 @@ public class DatastoreActionRepo implements IActionRepo {
output = true;
}
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))
throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS.");
else
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
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;
} finally {
if (txn.isActive()) {
......
......@@ -64,9 +64,13 @@ public class DatastoreDdmsRepository implements IDdmsRepository {
txn.put(entity);
txn.commit();
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))
throw new AppException(409, "Conflict", "A DDMS already exists with the same id");
else
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
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;
} finally {
if (txn.isActive()) {
......@@ -118,9 +122,13 @@ public class DatastoreDdmsRepository implements IDdmsRepository {
output = true;
}
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))
throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS.");
else
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
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;
} finally {
if (txn.isActive()) {
......
......@@ -108,6 +108,7 @@ public class DatastoreAccess implements IDatastoreAccess {
@Override
public List<Subscription> getAll() throws Exception {
Datastore ds = dataStoreTenants.get(tenantInfo.getName());
Query<Entity> q = Query
.newGqlQueryBuilder(Query.ResultType.ENTITY, "Select * from SUBSCRIPTION")
......@@ -137,9 +138,13 @@ public class DatastoreAccess implements IDatastoreAccess {
txn.put(entity);
txn.commit();
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))
throw new AppException(409, "Conflict", "A subscriber already exists with the same topic and endpoint combination");
else
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
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;
} catch (IOException ex) {
throw new AppException(500, "Server Error", "Unexpected error creating subscription.", ex);
......@@ -169,9 +174,13 @@ public class DatastoreAccess implements IDatastoreAccess {
output = true;
}
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))
throw new AppException(409, "Conflict", "Another request is trying to delete the same DDMS.");
else
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
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;
} catch (IOException ex) {
throw new AppException(500, "Server Error", "Unexpected error deleting subscription.", ex);
......@@ -198,9 +207,13 @@ public class DatastoreAccess implements IDatastoreAccess {
output = true;
}
} catch (DatastoreException ex) {
if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))
throw new AppException(409, "Conflict", "Another request is trying to update the same subscription.");
else
if (ex.getCode() == 10) {
if (ex.getMessage().startsWith("too much contention")) {
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;
} catch (IOException ex) {
throw new AppException(500, "Server Error", "Unexpected error updating subscription.", ex);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment