Skip to content

Commit

Permalink
correct mock for RedisJobExecutorSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Nov 27, 2024
1 parent 5f4d2c3 commit 7b49742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public class RedisJobExecutor implements DistributedJobExecutor {

private static final Logger LOGGER = LoggerFactory.getLogger(RedisJobExecutor.class);

public static final String HOSTNAME_PARAMETER_NAME = "redis-job-executor-hostname";

private static final String LIBRARY_PREFIX = "APMW::";
private static final String PREFIX_LEADER = LIBRARY_PREFIX + "LEADER::";
private static final String PREFIX_COUNT = LIBRARY_PREFIX + "COUNT::";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.agorapulse.worker.redis

import com.agorapulse.worker.executor.ExecutorId
import com.agorapulse.worker.tck.executor.AbstractJobExecutorSpec
import io.micronaut.context.ApplicationContext
import io.micronaut.inject.qualifiers.Qualifiers
Expand All @@ -39,7 +40,7 @@ class RedisJobExecutorSpec extends AbstractJobExecutorSpec {
protected ApplicationContext buildContext() {
ApplicationContext ctx = ApplicationContext
.builder(
'redis.uri': "redis://$redis.containerIpAddress:${redis.getMappedPort(6379)}",
'redis.uri': "redis://$redis.host:${redis.getMappedPort(6379)}",
'worker.jobs.long-running-job-execute-producer.enabled': 'true',
'worker.jobs.long-running-job-execute-on-leader.enabled': 'true',
'worker.jobs.long-running-job-execute-on-follower.enabled': 'true',
Expand All @@ -51,7 +52,7 @@ class RedisJobExecutorSpec extends AbstractJobExecutorSpec {
.environments(CONCURRENT_JOB_TEST_ENVIRONMENT)
.build()

ctx.registerSingleton(String, UUID.randomUUID().toString(), Qualifiers.byName(RedisJobExecutor.HOSTNAME_PARAMETER_NAME))
ctx.registerSingleton(new ExecutorId(UUID.randomUUID().toString()))

return ctx.start()
}
Expand Down

0 comments on commit 7b49742

Please sign in to comment.