Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
c871cb1d
Unverified
Commit
c871cb1d
authored
Mar 03, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
获取 prefs
parent
f21b216d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
28 deletions
+3
-28
src/test/java/org/b3log/solo/service/OptionQueryServiceTestCase.java
...va/org/b3log/solo/service/OptionQueryServiceTestCase.java
+3
-28
No files found.
src/test/java/org/b3log/solo/service/OptionQueryServiceTestCase.java
View file @
c871cb1d
...
...
@@ -17,7 +17,6 @@
*/
package
org
.
b3log
.
solo
.
service
;
import
org.b3log.latke.Keys
;
import
org.b3log.solo.AbstractTestCase
;
import
org.b3log.solo.model.Option
;
import
org.json.JSONObject
;
...
...
@@ -35,37 +34,13 @@ import org.testng.annotations.Test;
public
class
OptionQueryServiceTestCase
extends
AbstractTestCase
{
/**
*
Gets
.
*
Init
.
*
* @throws Exception exception
*/
@Test
public
void
get
()
throws
Exception
{
// Check
final
OptionQueryService
optionQueryService
=
getOptionQueryService
();
JSONObject
options
=
optionQueryService
.
getOptions
(
Option
.
CATEGORY_C_PREFERENCE
);
Assert
.
assertNull
(
options
);
// Add one
final
OptionMgmtService
optionMgmtService
=
getOptionMgmtService
();
JSONObject
option
=
new
JSONObject
();
option
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_BLOG_TITLE
);
option
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
option
.
put
(
Option
.
OPTION_VALUE
,
5L
);
final
String
id
=
optionMgmtService
.
addOrUpdateOption
(
option
);
Assert
.
assertNotNull
(
id
);
// Check again
option
=
optionQueryService
.
getOptionById
(
Option
.
ID_C_BLOG_TITLE
);
Assert
.
assertNotNull
(
option
);
options
=
optionQueryService
.
getOptions
(
Option
.
CATEGORY_C_PREFERENCE
);
Assert
.
assertNotNull
(
options
);
Assert
.
assertEquals
(
options
.
optLong
(
Option
.
ID_C_BLOG_TITLE
),
5L
);
public
void
init
()
throws
Exception
{
super
.
init
();
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment