Skip to content
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

Fix CounterController Metric value type & add tests #527

Conversation

ilayaperumalg
Copy link
Contributor

@ilayaperumalg ilayaperumalg commented Apr 19, 2016

  • The metric value type used in the CounterController is set to use Long instead of Double
    • Add CounterControllerTests

Resolves #526
Resolves #460

 - The metric value type used in the CounterController is set to use `Long` instead of `Double`
 - Add CounterControllerTests

This resolves spring-cloud#526 and 460
@markpollack
Copy link
Contributor

@ilayaperumalg
Copy link
Contributor Author

It is weird that the DefaultCounterService uses Double and will have problem when using this as a CounterService. Since data flow explicitly uses RedisCounterRepository, I have updated this PR to use Double as the metric value type and updated the tests to use RedisCounterRepository.

Update test to use RedisMetricRepository as the DataFlow server use that
@markpollack
Copy link
Contributor

Getting a test failure on testList

java.lang.AssertionError: JSON path "$.page.totalElements"
Expected: is <2>
     but: was <3>
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.springframework.test.util.JsonPathExpectationsHelper.assertValue(JsonPathExpectationsHelper.java:103)
    at org.springframework.test.web.servlet.result.JsonPathResultMatchers$1.match(JsonPathResultMatchers.java:65)
    at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:171)
    at org.springframework.cloud.dataflow.server.controller.CounterControllerTests.testList(CounterControllerTests.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

@markpollack
Copy link
Contributor

I cleaned redis and it worked, not sure the root cause as I didn't look at my keys/contents before flushing....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants