Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
openSource
apollo
Commits
30bade80
Commit
30bade80
authored
Mar 12, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add portal test configuration
parent
69380224
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
9 deletions
+53
-9
.gitignore
.gitignore
+6
-1
data.sql
apollo-configserver/src/test/resources/data.sql
+0
-0
schema.sql
apollo-configserver/src/test/resources/schema.sql
+0
-0
AppController.java
...ava/com/ctrip/apollo/portal/controller/AppController.java
+3
-7
PortalApplicationTestConfiguration.java
...rip/apollo/portal/PortalApplicationTestConfiguration.java
+8
-0
AppRepositoryTest.java
...com/ctrip/apollo/portal/repository/AppRepositoryTest.java
+35
-0
data.sql
apollo-portal/src/test/resources/data.sql
+0
-0
schema.sql
apollo-portal/src/test/resources/schema.sql
+0
-0
pom.xml
pom.xml
+1
-1
No files found.
.gitignore
View file @
30bade80
...
...
@@ -11,8 +11,12 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Eclipse
.classpath
.project
target
.settings
# Idea
.idea
*.iml
\ No newline at end of file
apollo-configserver/src/test/resources/data.sql
deleted
100644 → 0
View file @
69380224
apollo-configserver/src/test/resources/schema.sql
deleted
100644 → 0
View file @
69380224
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
View file @
30bade80
...
...
@@ -26,12 +26,8 @@ public class AppController {
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
public
App
create
()
{
App
ramdomApp
=
new
App
();
ramdomApp
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
ramdomApp
.
setName
(
"new app "
+
System
.
currentTimeMillis
());
ramdomApp
.
setOwner
(
"owner "
+
System
.
currentTimeMillis
());
ramdomApp
.
setCreateTimestamp
(
new
Date
());
return
appRepository
.
save
(
ramdomApp
);
public
App
create
(
App
app
)
{
app
.
setCreateTimestamp
(
new
Date
());
return
appRepository
.
save
(
app
);
}
}
apollo-portal/src/test/java/com/ctrip/apollo/portal/PortalApplicationTestConfiguration.java
0 → 100644
View file @
30bade80
package
com
.
ctrip
.
apollo
.
portal
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
PortalApplicationTestConfiguration
{
}
apollo-portal/src/test/java/com/ctrip/apollo/portal/repository/AppRepositoryTest.java
0 → 100644
View file @
30bade80
package
com
.
ctrip
.
apollo
.
portal
.
repository
;
import
java.util.Date
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
com.ctrip.apollo.portal.PortalApplicationTestConfiguration
;
import
com.ctrip.apollo.portal.entities.App
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
PortalApplicationTestConfiguration
.
class
)
public
class
AppRepositoryTest
{
@Autowired
AppRepository
repository
;
@Test
public
void
testCreate
()
{
Assert
.
assertEquals
(
0
,
repository
.
count
());
App
ramdomApp
=
new
App
();
ramdomApp
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
ramdomApp
.
setName
(
"new app "
+
System
.
currentTimeMillis
());
ramdomApp
.
setOwner
(
"owner "
+
System
.
currentTimeMillis
());
ramdomApp
.
setCreateTimestamp
(
new
Date
());
repository
.
save
(
ramdomApp
);
Assert
.
assertEquals
(
1
,
repository
.
count
());
}
}
apollo-portal/src/test/resources/data.sql
deleted
100644 → 0
View file @
69380224
apollo-portal/src/test/resources/schema.sql
deleted
100644 → 0
View file @
69380224
pom.xml
View file @
30bade80
...
...
@@ -99,7 +99,7 @@
<plugin>
<groupId>
org.eluder.coveralls
</groupId>
<artifactId>
coveralls-maven-plugin
</artifactId>
<version>
3
.1.0
</version>
<version>
4
.1.0
</version>
</plugin>
</plugins>
</build>
...
...
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