@Test public void should_return_no_perf_issue_if_query_execution_time_is_same_as_expected() { VerifiablePerformanceIssue<ExpectMaxQueryExecutionTime, ExecutionTime> verifier = SqlQueryMaxExecutionTimeVerifier.INSTANCE; ExpectMaxQueryExecutionTime expectedMaxExecutionTime = SqlAnnotationBuilder.expectMaxQueryExecutionTime(1); ExecutionTime sqlExecTime = new ExecutionTime(1, TimeUnit.MILLISECONDS); PerfIssue perfIssue = verifier.verifyPerfIssue(expectedMaxExecutionTime, sqlExecTime); Assertions.assertThat(PerfIssue.NONE).isEqualTo(perfIssue); Assertions.assertThat(PerfIssue.NONE.getDescription()).isEqualTo(perfIssue.getDescription()); }
@Override public PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure) { ExecutionTime maxExpectedSqlExecutionTime = new ExecutionTime(annotation.thresholdInMilliSeconds(), TimeUnit.MILLISECONDS); if(measure.isGreaterThan(maxExpectedSqlExecutionTime)) { return buildPerfIssue(measure, maxExpectedSqlExecutionTime); } return PerfIssue.NONE; }
SqlQueryMaxExecutionTimeVerifier implements VerifiablePerformanceIssue<ExpectMaxQueryExecutionTime, ExecutionTime> { @Override public PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure) { ExecutionTime maxExpectedSqlExecutionTime = new ExecutionTime(annotation.thresholdInMilliSeconds(), TimeUnit.MILLISECONDS); if(measure.isGreaterThan(maxExpectedSqlExecutionTime)) { return buildPerfIssue(measure, maxExpectedSqlExecutionTime); } return PerfIssue.NONE; } }
SqlQueryMaxExecutionTimeVerifier implements VerifiablePerformanceIssue<ExpectMaxQueryExecutionTime, ExecutionTime> { @Override public PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure) { ExecutionTime maxExpectedSqlExecutionTime = new ExecutionTime(annotation.thresholdInMilliSeconds(), TimeUnit.MILLISECONDS); if(measure.isGreaterThan(maxExpectedSqlExecutionTime)) { return buildPerfIssue(measure, maxExpectedSqlExecutionTime); } return PerfIssue.NONE; } private  SqlQueryMaxExecutionTimeVerifier(); }
SqlQueryMaxExecutionTimeVerifier implements VerifiablePerformanceIssue<ExpectMaxQueryExecutionTime, ExecutionTime> { @Override public PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure) { ExecutionTime maxExpectedSqlExecutionTime = new ExecutionTime(annotation.thresholdInMilliSeconds(), TimeUnit.MILLISECONDS); if(measure.isGreaterThan(maxExpectedSqlExecutionTime)) { return buildPerfIssue(measure, maxExpectedSqlExecutionTime); } return PerfIssue.NONE; } private  SqlQueryMaxExecutionTimeVerifier(); @Override PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure); }
SqlQueryMaxExecutionTimeVerifier implements VerifiablePerformanceIssue<ExpectMaxQueryExecutionTime, ExecutionTime> { @Override public PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure) { ExecutionTime maxExpectedSqlExecutionTime = new ExecutionTime(annotation.thresholdInMilliSeconds(), TimeUnit.MILLISECONDS); if(measure.isGreaterThan(maxExpectedSqlExecutionTime)) { return buildPerfIssue(measure, maxExpectedSqlExecutionTime); } return PerfIssue.NONE; } private  SqlQueryMaxExecutionTimeVerifier(); @Override PerfIssue verifyPerfIssue(ExpectMaxQueryExecutionTime annotation, ExecutionTime measure); static final SqlQueryMaxExecutionTimeVerifier INSTANCE; }