Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MilderJoghurt
rlf-server
Commits
e7014af4
Commit
e7014af4
authored
Jun 16, 2015
by
Fjen Undso
Browse files
test: fix session id test
parent
e7148c15
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/Session.java
View file @
e7014af4
...
...
@@ -24,7 +24,7 @@ public class Session extends Model {
@Id
@Constraints
.
MinLength
(
6
)
public
Integer
id
;
public
String
id
;
private
final
int
IDMIN
=
100000
;
private
final
int
IDMAX
=
1000000
;
...
...
@@ -69,7 +69,7 @@ public class Session extends Model {
id
=
rnd
.
nextInt
(
IDMAX
-
IDMIN
)
+
IDMIN
;
}
while
(
Session
.
find
.
byId
(
id
.
toString
())
!=
null
);
this
.
id
=
id
;
this
.
id
=
id
.
toString
()
;
this
.
owner
=
owner
;
this
.
name
=
name
;
this
.
open
=
true
;
...
...
test/ModelTest.java
View file @
e7014af4
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotEquals
;
import
models.QuestionAnswer
;
import
models.Session
;
import
models.Vote
;
...
...
@@ -110,6 +111,7 @@ public class ModelTest {
Session
s2
=
new
Session
(
"owner1"
,
"Session2"
);
s1
.
save
();
s2
.
save
();
assertEquals
(
5
,
s1
.
id
.
length
());
assertEquals
(
6
,
s1
.
id
.
length
());
assertNotEquals
(
s1
.
id
,
s2
.
id
);
}
}
Write
Preview
Supports
Markdown
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