Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
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
spring-cloud-netflix
Commits
9a6dad11
Commit
9a6dad11
authored
Nov 08, 2017
by
Ryan Baxter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing test failures
parent
f511c267
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
HystrixStreamTests.java
...work/cloud/netflix/hystrix/stream/HystrixStreamTests.java
+1
-3
StreamSourceTestBase.java
...rk/cloud/netflix/hystrix/stream/StreamSourceTestBase.java
+1
-2
ZuulMetricsApplicationTests.java
...oud/netflix/zuul/metrics/ZuulMetricsApplicationTests.java
+6
-1
No files found.
spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java
View file @
9a6dad11
...
...
@@ -91,9 +91,7 @@ public class HystrixStreamTests {
assertThat
(
this
.
registration
.
getServiceId
()).
isEqualTo
(
"mytestapp"
);
this
.
task
.
gatherMetrics
();
Message
<?>
message
=
this
.
collector
.
forChannel
(
output
).
take
();
// TODO: possible regression with Edgware?
assertThat
(
message
.
getPayload
()).
isInstanceOf
(
byte
[].
class
);
JsonNode
tree
=
mapper
.
readTree
(
new
String
((
byte
[])
message
.
getPayload
()));
JsonNode
tree
=
mapper
.
readTree
((
String
)
message
.
getPayload
());
assertThat
(
tree
.
hasNonNull
(
"origin"
));
assertThat
(
tree
.
hasNonNull
(
"data"
));
}
...
...
spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/StreamSourceTestBase.java
View file @
9a6dad11
...
...
@@ -155,8 +155,7 @@ public abstract class StreamSourceTestBase {
if
(
message
==
null
)
{
return
message
;
}
Object
fromMessage
=
converter
().
fromMessage
(
message
,
String
.
class
);
return
MessageBuilder
.
createMessage
(
fromMessage
,
message
.
getHeaders
());
return
MessageBuilder
.
createMessage
(
message
.
getPayload
(),
message
.
getHeaders
());
}
catch
(
Exception
e
)
{
log
.
error
(
"Exception occurred while trying to read a message from "
...
...
spring-cloud-netflix-zuul/src/test/java/org/springframework/cloud/netflix/zuul/metrics/ZuulMetricsApplicationTests.java
View file @
9a6dad11
...
...
@@ -32,10 +32,13 @@ import com.netflix.zuul.exception.ZuulException;
import
com.netflix.zuul.monitoring.CounterFactory
;
import
com.netflix.zuul.monitoring.TracerFactory
;
import
static
io
.
micrometer
.
core
.
instrument
.
MockClock
.
clock
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
springframework
.
boot
.
test
.
context
.
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
;
import
io.micrometer.core.instrument.MeterRegistry
;
import
io.micrometer.core.instrument.MockClock
;
import
io.micrometer.core.instrument.simple.SimpleConfig
;
import
io.micrometer.core.instrument.simple.SimpleMeterRegistry
;
@RunWith
(
SpringRunner
.
class
)
...
...
@@ -68,6 +71,7 @@ public class ZuulMetricsApplicationTests {
new
ZuulException
(
"any"
,
500
,
"cause"
);
new
ZuulException
(
"any"
,
500
,
"cause"
);
clock
(
meterRegistry
).
add
(
SimpleConfig
.
DEFAULT_STEP
);
Double
count
=
meterRegistry
.
counter
(
"ZUUL::EXCEPTION:cause:500"
).
count
();
assertEquals
(
count
.
longValue
(),
2L
);
...
...
@@ -75,6 +79,7 @@ public class ZuulMetricsApplicationTests {
new
ZuulException
(
"any"
,
404
,
"cause2"
);
new
ZuulException
(
"any"
,
404
,
"cause2"
);
clock
(
meterRegistry
).
add
(
SimpleConfig
.
DEFAULT_STEP
);
count
=
meterRegistry
.
counter
(
"ZUUL::EXCEPTION:cause2:404"
).
count
();
assertEquals
(
count
.
longValue
(),
3L
);
}
...
...
@@ -92,7 +97,7 @@ public class ZuulMetricsApplicationTests {
@Bean
public
MeterRegistry
meterRegistry
()
{
return
new
SimpleMeterRegistry
();
return
new
SimpleMeterRegistry
(
SimpleConfig
.
DEFAULT
,
new
MockClock
()
);
}
}
}
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