CenturyLinkCloud / clc-java-sdk

Apache License 2.0
6 stars 4 forks source link

Improve Server Monitoring Test #59

Closed idrabenia closed 9 years ago

idrabenia commented 9 years ago
Gradle test > com.centurylink.cloud.sdk.servers.services.statistics.MonitoringStatisticsTest.testGroupByServer FAILED
    java.lang.AssertionError: check count of grouping rows expected [12] but found [11]
        at org.testng.Assert.fail(Assert.java:94)
        at org.testng.Assert.failNotEquals(Assert.java:494)
        at org.testng.Assert.assertEquals(Assert.java:123)
        at org.testng.Assert.assertEquals(Assert.java:370)
        at com.centurylink.cloud.sdk.servers.services.statistics.MonitoringStatisticsTest.testGroupByServer(MonitoringStatisticsTest.java:145)

Could you make this test more reliable.

Notes: REST API may returns different statistics for sequential requests according to eventually consistency. Could you improve this test aligned with this behaviour.

Thanks!

idrabenia commented 9 years ago

Delayed

idrabenia commented 9 years ago

@push1st1k Alex, if not difficult, could today try to rewrite this test using mocks and spies.

You may try to create some infrastructure in cloud by hand, then copy json for all needed requests, and mock remote calls using this json. You may see instance of this approach implementation at search functionality tests.

Thanks!