/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.timerstatus.qualified_integration_test_name) %>;

public class <%= repository.timerstatus.integration_test_name %>
  extends <%= repository.ee.qualified_base_integration_test_name %>
{
  @org.testng.annotations.Test
  public void checkTimersExposed()
    throws Exception
  {
<%
  timers = repository.timerstatus.timers
  timers.each do |timer|
  -%>
    org.testng.Assert.assertEquals( httpGet( "/api/timers/<%= timer %>", javax.json.JsonObject.class ).getString( "info", "" ), "<%= timer %>" );
<% end -%>
    org.testng.Assert.assertEquals( httpGet( "/api/timers", javax.json.JsonArray.class ).size(), <%= timers.size %> );
  }
}

/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.timerstatus.qualified_integration_test_name) %>;

public class <%= repository.timerstatus.integration_test_name %>
  extends <%= repository.ee.qualified_base_integration_test_name %>
{
  @org.testng.annotations.Test
  public void checkTimersExposed()
    throws Exception
  {
<%
  timers = repository.timerstatus.timers
  timers.each do |timer|
  -%>
    org.testng.Assert.assertEquals( httpGet( "/api/timers/<%= timer %>", javax.json.JsonObject.class ).getString( "info", "" ), "<%= timer %>" );
<% end -%>
    final javax.json.JsonArray values = httpGet( "/api/timers?fields=info", javax.json.JsonArray.class );
    final java.util.List<java.lang.String> workers = new java.util.ArrayList<>();
<% timers.each do |timer| -%>
    workers.add( "<%= timer %>.Worker" );
<% end -%>
    final java.util.List<java.lang.String> expectedValues = new java.util.ArrayList<>();
<% timers.each do |timer| -%>
    expectedValues.add( "<%= timer %>" );
<% end -%>
    final java.util.ArrayList<java.lang.String> unexpectedValues = new java.util.ArrayList<>();
    for ( final javax.json.JsonValue value : values )
    {
      final java.lang.String info = ( (javax.json.JsonObject) value ).getString( "info", "" );
      if ( expectedValues.contains( info ) )
      {
        expectedValues.remove( info );
      }
      // Workers appear briefly as part of infrastructure for managing timers but will go away, soon after
      else if ( !workers.contains( info ) )
      {
        unexpectedValues.add( info );
      }
    }
    org.testng.Assert.assertTrue( expectedValues.isEmpty(), "Failed to find expected timers " + expectedValues + ". Unexpected timers: " + unexpectedValues );
    org.testng.Assert.assertTrue( unexpectedValues.isEmpty(), "Found unexpected timers: " + unexpectedValues );
  }
}

Update test so it is tolerant of the timers firing during the test
Update test so it is tolerant of the timers firing during the test
