-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #219: Refactor AppResources Controller #274
base: feature/task_cwms_support
Are you sure you want to change the base?
Issue #219: Refactor AppResources Controller #274
Conversation
Quality Gate failedFailed conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebasing will give you better code coverage metrics
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Show resolved
Hide resolved
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Outdated
Show resolved
Hide resolved
CompAppInfo ret = new CompAppInfo(); | ||
if (app.getAppId() != null) | ||
{ | ||
ret.setAppId(DbKey.createDbKey(app.getAppId())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think DbKey.NullKey
should be used if the app id is null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added NullKey
as result if app id is null
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Outdated
Show resolved
Hide resolved
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Outdated
Show resolved
Hide resolved
ApiLoadingApp loadingApp1 = (ApiLoadingApp)obj; | ||
}; | ||
|
||
// NOTE: Currently uses available primary key generator to obtain a PID value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into a better way to do this
// A better solution should be found. | ||
TimeSeriesDb tsdb = getLegacyTimeseriesDB(); | ||
KeyGenerator keyGen = tsdb.getKeyGenerator(); | ||
DbKey key = keyGen.getKey("HDB_LOADING_APPLICATION", tsdb.getConnection()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't implementing HDB so that's not going to be the right key
{ | ||
throw new WebAppException(ErrorCodes.DATABASE_ERROR, | ||
String.format("Error attempting to start appId=%s", appId), ex); | ||
} | ||
} | ||
|
||
static ApiLoadingApp mapLoading(CompAppInfo app) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting: brackets should be on a new line
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Outdated
Show resolved
Hide resolved
appid = null; | ||
sessionFilter = new SessionFilter(); | ||
|
||
given() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the same indenting strategy we did for CDA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated formatting; looks like it was lost when moving to the new branch
c7c6a24
to
14aa521
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some updates to formatting
opendcs-rest-api/src/main/java/org/opendcs/odcsapi/res/AppResources.java
Show resolved
Hide resolved
CompAppInfo ret = new CompAppInfo(); | ||
if (app.getAppId() != null) | ||
{ | ||
ret.setAppId(DbKey.createDbKey(app.getAppId())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added NullKey
as result if app id is null
appid = null; | ||
sessionFilter = new SessionFilter(); | ||
|
||
given() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated formatting; looks like it was lost when moving to the new branch
ApiLoadingApp loadingApp1 = (ApiLoadingApp)obj; | ||
}; | ||
|
||
// NOTE: Currently uses available primary key generator to obtain a PID value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into a better way to do this
27e5c29
to
0e3eb53
Compare
Problem Description
Fixes #219 .
Solution
Replaces DAO usage with OpenDCS DAI implementations.
how you tested the change
Unit tests included.
Where the following done:
(Formerly called regression tests.)
If you aren't sure leave unchecked and we will help guide you to want needs changing where.