target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test(expected = BadRequestException.class) public void executeThrowsABadRequestExceptionIfBrokerIsUnknown() { underTest.execute("unknown-broker"); } | @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(); } | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... |
@Test public void createResendScheduledExecutorServiceBeanDefinition(){ AbstractBeanDefinition abstractBeanDefinition = underTest.create( executorService, "queueBrowserService", 0, 10, SECONDS); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(QueueBrowserScheduledExecutorService.class)); Constructo... | public AbstractBeanDefinition create(ScheduledExecutorService executorService, String queueBrowserServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(QueueBrowserScheduledExecutorService.class) .addConstructorArgValue(executorService) .addConstructorArgReferenc... | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String queueBrowserServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(QueueBrowserScheduledExecutorService.class) .addCon... | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String queueBrowserServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(QueueBrowserScheduledExecutorService.class) .addCon... | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String queueBrowserServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(QueueBrowserScheduledExecutorService.class) .addCon... | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String queueBrowserServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(QueueBrowserScheduledExecutorService.class) .addCon... |
@Test public void createBeanName() throws Exception { assertThat(underTest.createBeanName(BROKER_NAME), is(equalTo(QUEUE_BROWSER_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + BROKER_NAME))); } | public String createBeanName(String brokerName) { return QUEUE_BROWSER_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return QUEUE_BROWSER_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } } | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return QUEUE_BROWSER_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } } | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return QUEUE_BROWSER_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(ScheduledExecutorService executorService,
String queueBro... | QueueBrowserScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return QUEUE_BROWSER_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(ScheduledExecutorService executorService,
String queueBro... |
@Test(expected = NotFoundException.class) public void startThrowsANotFoundExceptionIfBrokerIsUnknown() { underTest.start("unknown-broker"); } | @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @ApiParam(value = "name of the broker... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... |
@Test(expected = NotFoundException.class) public void stopThrowsANotFoundExceptionIfBrokerIsUnknown() { underTest.stop("unknown-broker"); } | @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiParam(value = "name of the broker as... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... |
@Test public void startDefaultMessageListenerContainer() { underTest.start("internal-broker"); verify(defaultMessageListenerContainer).start(); } | @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @ApiParam(value = "name of the broker... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... | MessageConsumerManagerResource { @ApiOperation("Start consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption started successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/start/{brokerName}") public void start( @Api... |
@Test public void stopDefaultMessageListenerContainer() { underTest.stop("internal-broker"); verify(defaultMessageListenerContainer).stop(); } | @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiParam(value = "name of the broker as... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... | MessageConsumerManagerResource { @ApiOperation("Stop consuming messages from the DLQ on the given broker") @ApiResponses({ @ApiResponse(code = 204, message = "DLQ consumption stopped successfully"), @ApiResponse(code = 404, message = "brokerName not found") }) @POST @Path("/stop/{brokerName}") public void stop( @ApiPar... |
@Test(expected = NotFoundException.class) public void readMessagesThrowsANotFoundExceptionIfBrokerIsUnknown() { underTest.readMessages("unknown-broker"); } | @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "brokerName not found"), @ApiResponse(c... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... |
@Test public void readMessagesThrowsAServerErrorExceptionIfBrokerIsNotReadOnly() { StubRuntimeDelegate.setExpectedStatus(Response.Status.NOT_IMPLEMENTED); expectedException.expect(ServerErrorException.class); expectedException.expectMessage("HTTP 501 Not Implemented"); underTest.readMessages("internal-broker"); } | @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "brokerName not found"), @ApiResponse(c... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... |
@Test public void readMessagesForAReadOnlyBroker() { underTest.readMessages("readonly-broker"); verify(queueBrowserScheduledExecutorService).execute(); } | @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "brokerName not found"), @ApiResponse(c... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... | MessageConsumerManagerResource { @ApiOperation("Read all messages on the DLQ for the given broker. This operation is only supported if the queue on the given broker is in read-only mode") @ApiResponses({ @ApiResponse(code = 204, message = "Queue Browser executed successfully"), @ApiResponse(code = 404, message = "broke... |
@Test public void createABeanDefinitionForActiveMqConnectionFactory() throws Exception { AbstractBeanDefinition abstractBeanDefinition = underTest.create(BROKER_NAME); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(ActiveMQConnectionFactoryFactory.class)); assertThat(abstractBeanDefinition.getCons... | public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(ActiveMQConnectionFactoryFactory.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("jmsListenerProperties") .getBeanDefinition(); } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(ActiveMQConnectionFactoryFactory.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("jmsListenerProperties") .getBeanDefinition(); } } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(ActiveMQConnectionFactoryFactory.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("jmsListenerProperties") .getBeanDefinition(); } } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(ActiveMQConnectionFactoryFactory.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("jmsListenerProperties") .getBeanDefinition(); } AbstractBeanDefinition ... | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(ActiveMQConnectionFactoryFactory.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("jmsListenerProperties") .getBeanDefinition(); } AbstractBeanDefinition ... |
@Test(expected = BadRequestException.class) public void pauseThrowsABadRequestExceptionIfBrokerIsUnknown() { underTest.pause("unknown-broker"); } | @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } } | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } ResendSchedul... | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } ResendSchedul... | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } ResendSchedul... |
@Test public void createBeanName() throws Exception { assertThat(underTest.createBeanName("foo"), is(equalTo(FACTORY_BEAN_NAME_PREFIX + "foo"))); } | public String createBeanName(String brokerName) { return FACTORY_BEAN_NAME_PREFIX + brokerName; } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return FACTORY_BEAN_NAME_PREFIX + brokerName; } } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return FACTORY_BEAN_NAME_PREFIX + brokerName; } } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return FACTORY_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String brokerName); String createBeanName(String brokerName); } | ActiveMQConnectionFactoryFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return FACTORY_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String brokerName); String createBeanName(String brokerName); } |
@Test public void createFailedMessageListenerBeanDefinition() { AbstractBeanDefinition abstractBeanDefinition = underTest.create(BROKER_NAME); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(FailedMessageListener.class)); assertThat(abstractBeanDefinition.getConstructorArgumentValues().getIndexedAr... | public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(FailedMessageListener.class) .addConstructorArgValue(activeMQFailedMessageFactoryFactory.apply(brokerName)) .addConstructorArgReference("failedMessageProcessor") .getBeanDefinition(); } | FailedMessageListenerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(FailedMessageListener.class) .addConstructorArgValue(activeMQFailedMessageFactoryFactory.apply(brokerName)) .addConstructorArgReference("failedMessageProcessor") .getBeanDefinition(); } } | FailedMessageListenerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(FailedMessageListener.class) .addConstructorArgValue(activeMQFailedMessageFactoryFactory.apply(brokerName)) .addConstructorArgReference("failedMessageProcessor") .getBeanDefinition(); } Fa... | FailedMessageListenerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(FailedMessageListener.class) .addConstructorArgValue(activeMQFailedMessageFactoryFactory.apply(brokerName)) .addConstructorArgReference("failedMessageProcessor") .getBeanDefinition(); } Fa... | FailedMessageListenerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName) { return genericBeanDefinition(FailedMessageListener.class) .addConstructorArgValue(activeMQFailedMessageFactoryFactory.apply(brokerName)) .addConstructorArgReference("failedMessageProcessor") .getBeanDefinition(); } Fa... |
@Test public void createBeanName() { assertThat(underTest.createBeanName(BROKER_NAME), is(equalTo(FAILED_MESSAGE_LISTENER_BEAN_NAME_PREFIX + BROKER_NAME))); } | public String createBeanName(String brokerName) { return FAILED_MESSAGE_LISTENER_BEAN_NAME_PREFIX + brokerName; } | FailedMessageListenerBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_LISTENER_BEAN_NAME_PREFIX + brokerName; } } | FailedMessageListenerBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_LISTENER_BEAN_NAME_PREFIX + brokerName; } FailedMessageListenerBeanDefinitionFactory(Function<String, ActiveMQFailedMessageFactory> activeMQFailedMessageFactoryFactory); } | FailedMessageListenerBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_LISTENER_BEAN_NAME_PREFIX + brokerName; } FailedMessageListenerBeanDefinitionFactory(Function<String, ActiveMQFailedMessageFactory> activeMQFailedMessageFactoryFactory); AbstractBeanDefinition create(Str... | FailedMessageListenerBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_LISTENER_BEAN_NAME_PREFIX + brokerName; } FailedMessageListenerBeanDefinitionFactory(Function<String, ActiveMQFailedMessageFactory> activeMQFailedMessageFactoryFactory); AbstractBeanDefinition create(Str... |
@Test public void createBeanDefinitionForDefaultMessageListenerContainer() { AbstractBeanDefinition abstractBeanDefinition = underTest.create( BROKER_NAME, CONNECTION_FACTORY_BEAN_NAME, QUEUE_NAME, FAILED_MESSAGE_LISTENER_BEAN_NAME ); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(NamedMessageList... | public AbstractBeanDefinition create(String brokerName, String connectionFactoryBeanName, String queueName, String failedMessageListenerBeanName) { LOGGER.debug("Creating NamedMessageListenerContainer BeanDefinition for {}", brokerName); return genericBeanDefinition(NamedMessageListenerContainer.class) .addConstructorA... | NamedMessageListenerContainerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String connectionFactoryBeanName, String queueName, String failedMessageListenerBeanName) { LOGGER.debug("Creating NamedMessageListenerContainer BeanDefinition for {}", brokerName); return genericBeanDefinition(... | NamedMessageListenerContainerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String connectionFactoryBeanName, String queueName, String failedMessageListenerBeanName) { LOGGER.debug("Creating NamedMessageListenerContainer BeanDefinition for {}", brokerName); return genericBeanDefinition(... | NamedMessageListenerContainerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String connectionFactoryBeanName, String queueName, String failedMessageListenerBeanName) { LOGGER.debug("Creating NamedMessageListenerContainer BeanDefinition for {}", brokerName); return genericBeanDefinition(... | NamedMessageListenerContainerBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String connectionFactoryBeanName, String queueName, String failedMessageListenerBeanName) { LOGGER.debug("Creating NamedMessageListenerContainer BeanDefinition for {}", brokerName); return genericBeanDefinition(... |
@Test public void createBeanName() throws Exception { assertThat(underTest.createBeanName("foo"), is(equalTo(NAMED_MESSAGE_LISTENER_CONTAINER_BEAN_NAME_PREFIX + "foo"))); } | public String createBeanName(String brokerName) { return NAMED_MESSAGE_LISTENER_CONTAINER_BEAN_NAME_PREFIX + brokerName; } | NamedMessageListenerContainerBeanDefinitionFactory { public String createBeanName(String brokerName) { return NAMED_MESSAGE_LISTENER_CONTAINER_BEAN_NAME_PREFIX + brokerName; } } | NamedMessageListenerContainerBeanDefinitionFactory { public String createBeanName(String brokerName) { return NAMED_MESSAGE_LISTENER_CONTAINER_BEAN_NAME_PREFIX + brokerName; } } | NamedMessageListenerContainerBeanDefinitionFactory { public String createBeanName(String brokerName) { return NAMED_MESSAGE_LISTENER_CONTAINER_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String brokerName,
String connectionFactoryBeanName,
... | NamedMessageListenerContainerBeanDefinitionFactory { public String createBeanName(String brokerName) { return NAMED_MESSAGE_LISTENER_CONTAINER_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String brokerName,
String connectionFactoryBeanName,
... |
@Test public void ifNoTlsConffigExistsThenCreateVanillaActiveMQConnectionFactory() throws Exception { JmsListenerProperties.BrokerProperties brokerConfig = new JmsListenerProperties.BrokerProperties(); brokerConfig.setName(BROKER_NAME); brokerConfig.setUrl("tcp: JmsListenerProperties testConfig = new JmsListenerPropert... | public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.BrokerProperties.TlsProperties> tlsC... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... |
@Test public void ifTlsOptionsAreDefinedInConfigThenSslConnectionFactoryShouldBeCreated() throws Exception { JmsListenerProperties.BrokerProperties.TlsProperties tlsProperties = new JmsListenerProperties.BrokerProperties.TlsProperties(); String expectedKeystoreFilePath = "keystoreFilePath"; String expectedKeyStorePassw... | public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.BrokerProperties.TlsProperties> tlsC... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... | ActiveMQConnectionFactoryFactory { public ConnectionFactory create() { JmsListenerProperties.BrokerProperties brokerConfig = jmsListenerProperties.getBrokerConfigFor(brokerName) .orElseThrow(() -> new RuntimeException("Could not find broker config for broker with name: " + brokerName)); Optional<JmsListenerProperties.B... |
@Test public void createABeanDefinitionForActiveMqConnectionFactory() throws Exception { AbstractBeanDefinition abstractBeanDefinition = underTest.create(NAME_OF_FACTORY_BEAN); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(ActiveMQConnectionFactory.class)); assertThat(abstractBeanDefinition.getFa... | public AbstractBeanDefinition create(String nameOfFactoryBean) { return genericBeanDefinition(ActiveMQConnectionFactory.class) .setFactoryMethodOnBean("create", nameOfFactoryBean) .getBeanDefinition(); } | ActiveMQConnectionFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String nameOfFactoryBean) { return genericBeanDefinition(ActiveMQConnectionFactory.class) .setFactoryMethodOnBean("create", nameOfFactoryBean) .getBeanDefinition(); } } | ActiveMQConnectionFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String nameOfFactoryBean) { return genericBeanDefinition(ActiveMQConnectionFactory.class) .setFactoryMethodOnBean("create", nameOfFactoryBean) .getBeanDefinition(); } } | ActiveMQConnectionFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String nameOfFactoryBean) { return genericBeanDefinition(ActiveMQConnectionFactory.class) .setFactoryMethodOnBean("create", nameOfFactoryBean) .getBeanDefinition(); } AbstractBeanDefinition create(String nameOfFactoryBean); String cr... | ActiveMQConnectionFactoryBeanDefinitionFactory { public AbstractBeanDefinition create(String nameOfFactoryBean) { return genericBeanDefinition(ActiveMQConnectionFactory.class) .setFactoryMethodOnBean("create", nameOfFactoryBean) .getBeanDefinition(); } AbstractBeanDefinition create(String nameOfFactoryBean); String cr... |
@Test public void createBeanName() throws Exception { assertThat(underTest.createBeanName("foo"), is(equalTo(ACTIVE_MQ_CONNECTION_FACTORY_BEAN_NAME_PREFIX + "foo"))); } | public String createBeanName(String brokerName) { return ACTIVE_MQ_CONNECTION_FACTORY_BEAN_NAME_PREFIX + brokerName; } | ActiveMQConnectionFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return ACTIVE_MQ_CONNECTION_FACTORY_BEAN_NAME_PREFIX + brokerName; } } | ActiveMQConnectionFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return ACTIVE_MQ_CONNECTION_FACTORY_BEAN_NAME_PREFIX + brokerName; } } | ActiveMQConnectionFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return ACTIVE_MQ_CONNECTION_FACTORY_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String nameOfFactoryBean); String createBeanName(String brokerName); } | ActiveMQConnectionFactoryBeanDefinitionFactory { public String createBeanName(String brokerName) { return ACTIVE_MQ_CONNECTION_FACTORY_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String nameOfFactoryBean); String createBeanName(String brokerName); static final String ACTIVE_MQ_CONNECTION_FACTORY_BEA... |
@Test public void testRenderPage() throws Exception { try (ByteArrayOutputStream output = new ByteArrayOutputStream()) { underTest.render(new TestPage(), output); assertThat(output.toString(), containsString("<p>some content</p>")); } } | public void render(Page page, OutputStream output) throws IOException { try { final Mustache template = mustacheFactory.compile(page.getTemplate()); try (OutputStreamWriter writer = new OutputStreamWriter(output, UTF_8)) { template.execute(writer, Arrays.asList( page )); } } catch (Throwable e) { throw new RuntimeExcep... | MustachePageRenderer { public void render(Page page, OutputStream output) throws IOException { try { final Mustache template = mustacheFactory.compile(page.getTemplate()); try (OutputStreamWriter writer = new OutputStreamWriter(output, UTF_8)) { template.execute(writer, Arrays.asList( page )); } } catch (Throwable e) {... | MustachePageRenderer { public void render(Page page, OutputStream output) throws IOException { try { final Mustache template = mustacheFactory.compile(page.getTemplate()); try (OutputStreamWriter writer = new OutputStreamWriter(output, UTF_8)) { template.execute(writer, Arrays.asList( page )); } } catch (Throwable e) {... | MustachePageRenderer { public void render(Page page, OutputStream output) throws IOException { try { final Mustache template = mustacheFactory.compile(page.getTemplate()); try (OutputStreamWriter writer = new OutputStreamWriter(output, UTF_8)) { template.execute(writer, Arrays.asList( page )); } } catch (Throwable e) {... | MustachePageRenderer { public void render(Page page, OutputStream output) throws IOException { try { final Mustache template = mustacheFactory.compile(page.getTemplate()); try (OutputStreamWriter writer = new OutputStreamWriter(output, UTF_8)) { template.execute(writer, Arrays.asList( page )); } } catch (Throwable e) {... |
@Test public void startResendScheduledExecutorService() { underTest.start("internal-broker"); verify(resendScheduledExecutorService).start(); } | @ApiOperation("Start the resend executor for the given broker") @POST @Path("/start") public void start( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).start(); } | ResendScheduledExecutorsResource { @ApiOperation("Start the resend executor for the given broker") @POST @Path("/start") public void start( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).start(); } } | ResendScheduledExecutorsResource { @ApiOperation("Start the resend executor for the given broker") @POST @Path("/start") public void start( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).start(); } ResendSchedu... | ResendScheduledExecutorsResource { @ApiOperation("Start the resend executor for the given broker") @POST @Path("/start") public void start( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).start(); } ResendSchedu... | ResendScheduledExecutorsResource { @ApiOperation("Start the resend executor for the given broker") @POST @Path("/start") public void start( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).start(); } ResendSchedu... |
@Test public void createFailedMessageListPage() { FailedMessageListPage underTest = new FailedMessageListPage(true); assertTrue(underTest.isPopupRendered()); assertEquals("list.mustache", underTest.getTemplate()); } | public boolean isPopupRendered() { return popupRendered; } | FailedMessageListPage extends Page { public boolean isPopupRendered() { return popupRendered; } } | FailedMessageListPage extends Page { public boolean isPopupRendered() { return popupRendered; } FailedMessageListPage(boolean popupRendered); } | FailedMessageListPage extends Page { public boolean isPopupRendered() { return popupRendered; } FailedMessageListPage(boolean popupRendered); boolean isPopupRendered(); } | FailedMessageListPage extends Page { public boolean isPopupRendered() { return popupRendered; } FailedMessageListPage(boolean popupRendered); boolean isPopupRendered(); } |
@Test public void getFailedMessageListPage() { final FailedMessageListPage failedMessages = underTest.getFailedMessages(); assertThat(failedMessages.getTemplate(), is(equalTo("list.mustache"))); assertThat(failedMessages.isPopupRendered(), is(true)); } | @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) public FailedMessageListPage getFailedMessages() { return new FailedMessageListPage(popupRendered); } | FailedMessageListController { @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) public FailedMessageListPage getFailedMessages() { return new FailedMessageListPage(popupRendered); } } | FailedMessageListController { @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) public FailedMessageListPage getFailedMessages() { return new FailedMessageListPage(popupRendered); } FailedMessageListController(boolean popupRendered); } | FailedMessageListController { @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) public FailedMessageListPage getFailedMessages() { return new FailedMessageListPage(popupRendered); } FailedMessageListController(boolean popupRendered); @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) FailedMessageListPage getFai... | FailedMessageListController { @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) public FailedMessageListPage getFailedMessages() { return new FailedMessageListPage(popupRendered); } FailedMessageListController(boolean popupRendered); @GET @Consumes(APPLICATION_JSON) @Produces(TEXT_HTML) FailedMessageListPage getFai... |
@Test public void emptyStingReturnsEmptySet() throws Exception { assertThat(underTest.extractLabels(""), is(emptyIterable())); } | public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } |
@Test public void stringContainingWhitespaceReturnsEmptySet() throws Exception { assertThat(underTest.extractLabels(" \t"), is(emptyIterable())); } | public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } |
@Test public void stringContainingOnlyCommasWhitespaceReturnsEmptySet() throws Exception { assertThat(underTest.extractLabels(" ,,\t,"), is(emptyIterable())); } | public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } |
@Test public void leadingAndTrailingWhitespaceIsRemovedFromLabels() { assertThat(underTest.extractLabels(" foo , bar\t"), containsInAnyOrder("foo", "bar")); } | public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } | LabelExtractor { public Set<String> extractLabels(String labels) { return Stream.of(split(labels, ",")) .map(String::trim) .filter(label -> !label.isEmpty()) .collect(toSet()); } Set<String> extractLabels(String labels); } |
@Test public void updateLabels() throws Exception { when(labelExtractor.extractLabels("foo, bar")).thenReturn(labels1); when(labelExtractor.extractLabels("black, white")).thenReturn(labels2); String result = underTest.updateLabelsOnFailedMessages( newLabelRequest() .withChange(newChange().withRecid(FAILED_MESSAGE_1_ID)... | @POST @Path("/labels") public String updateLabelsOnFailedMessages(LabelRequest request) { LOGGER.info("Updating the labels on {} failedMessages", request.getChanges().size()); request.getChanges() .forEach(change -> { LOGGER.info("Setting labels on FailedMessage: {} to '{}'", change.getRecid(), change.getLabels()); lab... | FailedMessageChangeResource { @POST @Path("/labels") public String updateLabelsOnFailedMessages(LabelRequest request) { LOGGER.info("Updating the labels on {} failedMessages", request.getChanges().size()); request.getChanges() .forEach(change -> { LOGGER.info("Setting labels on FailedMessage: {} to '{}'", change.getRec... | FailedMessageChangeResource { @POST @Path("/labels") public String updateLabelsOnFailedMessages(LabelRequest request) { LOGGER.info("Updating the labels on {} failedMessages", request.getChanges().size()); request.getChanges() .forEach(change -> { LOGGER.info("Setting labels on FailedMessage: {} to '{}'", change.getRec... | FailedMessageChangeResource { @POST @Path("/labels") public String updateLabelsOnFailedMessages(LabelRequest request) { LOGGER.info("Updating the labels on {} failedMessages", request.getChanges().size()); request.getChanges() .forEach(change -> { LOGGER.info("Setting labels on FailedMessage: {} to '{}'", change.getRec... | FailedMessageChangeResource { @POST @Path("/labels") public String updateLabelsOnFailedMessages(LabelRequest request) { LOGGER.info("Updating the labels on {} failedMessages", request.getChanges().size()); request.getChanges() .forEach(change -> { LOGGER.info("Setting labels on FailedMessage: {} to '{}'", change.getRec... |
@Test public void deleteFailedMessages() { String result = underTest.deleteFailedMessages( newDeleteRequest().withSelectedRecords(FAILED_MESSAGE_1_ID, FAILED_MESSAGE_2_ID).build() ); assertThat(result, is(equalTo("{ 'status': 'success' }"))); verify(deleteFailedMessageClient).deleteFailedMessage(FAILED_MESSAGE_1_ID); v... | @POST @Path("/delete") public String deleteFailedMessages(DeleteRequest request) { request.getSelected() .forEach(recid -> deleteFailedMessageClient.deleteFailedMessage(fromString(recid))); return "{ 'status': 'success' }"; } | FailedMessageChangeResource { @POST @Path("/delete") public String deleteFailedMessages(DeleteRequest request) { request.getSelected() .forEach(recid -> deleteFailedMessageClient.deleteFailedMessage(fromString(recid))); return "{ 'status': 'success' }"; } } | FailedMessageChangeResource { @POST @Path("/delete") public String deleteFailedMessages(DeleteRequest request) { request.getSelected() .forEach(recid -> deleteFailedMessageClient.deleteFailedMessage(fromString(recid))); return "{ 'status': 'success' }"; } FailedMessageChangeResource(LabelFailedMessageClient labelFailed... | FailedMessageChangeResource { @POST @Path("/delete") public String deleteFailedMessages(DeleteRequest request) { request.getSelected() .forEach(recid -> deleteFailedMessageClient.deleteFailedMessage(fromString(recid))); return "{ 'status': 'success' }"; } FailedMessageChangeResource(LabelFailedMessageClient labelFailed... | FailedMessageChangeResource { @POST @Path("/delete") public String deleteFailedMessages(DeleteRequest request) { request.getSelected() .forEach(recid -> deleteFailedMessageClient.deleteFailedMessage(fromString(recid))); return "{ 'status': 'success' }"; } FailedMessageChangeResource(LabelFailedMessageClient labelFailed... |
@Test public void formatNullInstant() { assertEquals(Optional.empty(), Constants.toIsoDateTimeWithMs(null)); } | public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } private Constants(); } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } private Constants(); static Optional<String> toIsoDateTimeWithMs(Instant instant); static Optional<Instant> toInstantFromIsoDateTime(String instantAsString); } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } private Constants(); static Optional<String> toIsoDateTimeWithMs(Instant instant); static Optional<Instant> toInstantFromIsoDateTime(String instantAsString); } |
@Test public void formatGivenInstant() { assertEquals(Optional.of("1970-01-01T00:00:00.000Z"), Constants.toIsoDateTimeWithMs(Instant.ofEpochMilli(0))); } | public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } private Constants(); } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } private Constants(); static Optional<String> toIsoDateTimeWithMs(Instant instant); static Optional<Instant> toInstantFromIsoDateTime(String instantAsString); } | Constants { public static Optional<String> toIsoDateTimeWithMs(Instant instant) { return Optional.ofNullable(instant).map(ISO_DATE_TIME_WITH_MS::format); } private Constants(); static Optional<String> toIsoDateTimeWithMs(Instant instant); static Optional<Instant> toInstantFromIsoDateTime(String instantAsString); } |
@Test public void executeResendScheduledExecutorService() { underTest.execute("internal-broker"); verify(resendScheduledExecutorService).execute(); } | @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(); } | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... | ResendScheduledExecutorsResource { @ApiOperation("Synchronously execute the resend job for the given broker") @POST @Path("/execute") public void execute( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).execute(... |
@Test public void loginPageIsCreatedSuccessfully() throws Exception { when(httpServletRequest.getSession()).thenReturn(httpSession); when(httpSession.getAttribute(AUTHENTICATION_EXCEPTION)).thenReturn(authenticationException); when(authenticationExceptionAdapter.toErrorMessage(authenticationException)).thenReturn(Optio... | @GET public LoginPage getLoginPage(@Context HttpServletRequest request) { Optional<String> errorMessage = authenticationExceptionAdapter .toErrorMessage((AuthenticationException) request.getSession().getAttribute(AUTHENTICATION_EXCEPTION)); return new LoginPage(errorMessage); } | LoginController { @GET public LoginPage getLoginPage(@Context HttpServletRequest request) { Optional<String> errorMessage = authenticationExceptionAdapter .toErrorMessage((AuthenticationException) request.getSession().getAttribute(AUTHENTICATION_EXCEPTION)); return new LoginPage(errorMessage); } } | LoginController { @GET public LoginPage getLoginPage(@Context HttpServletRequest request) { Optional<String> errorMessage = authenticationExceptionAdapter .toErrorMessage((AuthenticationException) request.getSession().getAttribute(AUTHENTICATION_EXCEPTION)); return new LoginPage(errorMessage); } LoginController(Authent... | LoginController { @GET public LoginPage getLoginPage(@Context HttpServletRequest request) { Optional<String> errorMessage = authenticationExceptionAdapter .toErrorMessage((AuthenticationException) request.getSession().getAttribute(AUTHENTICATION_EXCEPTION)); return new LoginPage(errorMessage); } LoginController(Authent... | LoginController { @GET public LoginPage getLoginPage(@Context HttpServletRequest request) { Optional<String> errorMessage = authenticationExceptionAdapter .toErrorMessage((AuthenticationException) request.getSession().getAttribute(AUTHENTICATION_EXCEPTION)); return new LoginPage(errorMessage); } LoginController(Authent... |
@Test public void nullExceptionReturnsEmptyString() throws Exception { assertThat(underTest.toErrorMessage(null), is(Optional.empty())); } | public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/password"; }); } | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... |
@Test public void anyAuthenticationExceptionReturns() { assertThat(underTest.toErrorMessage(mock(AuthenticationException.class)), is(Optional.of("Incorrect username/password"))); } | public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/password"; }); } | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... | AuthenticationExceptionAdapter { public Optional<String> toErrorMessage(AuthenticationException authenticationException) { return Optional.ofNullable(authenticationException) .map(exception -> { String message = exception.getMessage(); LOGGER.debug("Translating error message: {}", message); return "Incorrect username/p... |
@Test public void searchWithMultipleCriteria() throws Exception { when(searchW2UIRequest.getSearchCriteria()).thenReturn(Arrays.asList( new Criteria(Criteria.Field.BROKER, Criteria.Operator.BEGINS, "Lorem"), new Criteria(Criteria.Field.CONTENT, Criteria.Operator.ENDS, "Ipsum"), new Criteria(Criteria.Field.DESTINATION, ... | public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilder); } return searchFailedMessageRequ... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... |
@Test public void searchWithNoCriteria() throws Exception { when(searchW2UIRequest.getSearchCriteria()).thenReturn(Collections.emptyList()); SearchFailedMessageRequest request = underTest.adapt(searchW2UIRequest); assertThat(request, aSearchRequestMatchingAnyCriteria() .withBroker(equalTo(Optional.empty())) .withConten... | public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilder); } return searchFailedMessageRequ... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... | SearchFailedMessageRequestAdapter { public SearchFailedMessageRequest adapt(SearchW2UIRequest request) { SearchFailedMessageRequestBuilder searchFailedMessageRequestBuilder = searchMatchingAnyCriteria(); for (Criteria criteria : request.getSearchCriteria()) { criteria.addToSearchRequest(searchFailedMessageRequestBuilde... |
@Test public void pauseResendScheduledExecutorService() { underTest.pause("internal-broker"); verify(resendScheduledExecutorService).pause(); } | @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } } | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } ResendSchedul... | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } ResendSchedul... | ResendScheduledExecutorsResource { @ApiOperation("Pause the resend executor for the given broker") @PUT @Path("/pause") public void pause( @ApiParam(value = "name of the broker as defined in application.yml", required = true) @PathParam("brokerName") String brokerName) { getExecutor(brokerName).pause(); } ResendSchedul... |
@Test public void effectiveDateTimeInPastReturnsTrue() throws Exception { when(failedMessage.getStatusHistoryEvent()).thenReturn(statusHistoryEvent); when(statusHistoryEvent.getEffectiveDateTime()).thenReturn(Instant.now().minus(1, MILLIS)); assertThat(underTest.test(failedMessage), is(true)); } | @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } @Override boolean test(FailedMessage failedMessage); } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } @Override boolean test(FailedMessage failedMessage); } |
@Test public void effectiveDateTimeInFutureReturnsFalse() throws Exception { when(failedMessage.getStatusHistoryEvent()).thenReturn(statusHistoryEvent); when(statusHistoryEvent.getEffectiveDateTime()).thenReturn(Instant.now().plus(1, SECONDS)); assertThat(underTest.test(failedMessage), is(false)); } | @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } @Override boolean test(FailedMessage failedMessage); } | HistoricStatusPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessage.getStatusHistoryEvent().getEffectiveDateTime().isBefore(Instant.now()); } @Override boolean test(FailedMessage failedMessage); } |
@Test public void createFailedMessageSenderBeanDefinition() throws Exception { AbstractBeanDefinition abstractBeanDefinition = underTest.create("messageSenderDelegate"); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(FailedMessageSender.class)); assertThat(abstractBeanDefinition.getConstructorArgu... | public AbstractBeanDefinition create(String messageSenderDelegate) { return genericBeanDefinition(FailedMessageSender.class) .addConstructorArgReference(messageSenderDelegate) .addConstructorArgReference("failedMessageService") .addDependsOn("failedMessageDao") .getBeanDefinition(); } | FailedMessageSenderBeanDefinitionFactory { public AbstractBeanDefinition create(String messageSenderDelegate) { return genericBeanDefinition(FailedMessageSender.class) .addConstructorArgReference(messageSenderDelegate) .addConstructorArgReference("failedMessageService") .addDependsOn("failedMessageDao") .getBeanDefinit... | FailedMessageSenderBeanDefinitionFactory { public AbstractBeanDefinition create(String messageSenderDelegate) { return genericBeanDefinition(FailedMessageSender.class) .addConstructorArgReference(messageSenderDelegate) .addConstructorArgReference("failedMessageService") .addDependsOn("failedMessageDao") .getBeanDefinit... | FailedMessageSenderBeanDefinitionFactory { public AbstractBeanDefinition create(String messageSenderDelegate) { return genericBeanDefinition(FailedMessageSender.class) .addConstructorArgReference(messageSenderDelegate) .addConstructorArgReference("failedMessageService") .addDependsOn("failedMessageDao") .getBeanDefinit... | FailedMessageSenderBeanDefinitionFactory { public AbstractBeanDefinition create(String messageSenderDelegate) { return genericBeanDefinition(FailedMessageSender.class) .addConstructorArgReference(messageSenderDelegate) .addConstructorArgReference("failedMessageService") .addDependsOn("failedMessageDao") .getBeanDefinit... |
@Test public void unableToWriteAResponse() throws IOException, ServletException { when(httpServletResponse.getWriter()).thenThrow(IOException.class); underTest.doGet(httpServletRequest, httpServletResponse); verify(httpServletResponse).sendError(500, "An error occurred writing the response"); verifyZeroInteractions(res... | @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { try { responseWriter.write(resp.getWriter()); } catch (IOException e) { handleError(resp, e); } } | PingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { try { responseWriter.write(resp.getWriter()); } catch (IOException e) { handleError(resp, e); } } } | PingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { try { responseWriter.write(resp.getWriter()); } catch (IOException e) { handleError(resp, e); } } PingServlet(PingResponseWriter responseWriter); } | PingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { try { responseWriter.write(resp.getWriter()); } catch (IOException e) { handleError(resp, e); } } PingServlet(PingResponseWriter responseWriter); } | PingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { try { responseWriter.write(resp.getWriter()); } catch (IOException e) { handleError(resp, e); } } PingServlet(PingResponseWriter responseWriter); } |
@Test public void createBeanName() { assertThat(underTest.createBeanName(BROKER_NAME), is(equalTo(FAILED_MESSAGE_SENDER_BEAN_NAME_PREFIX + BROKER_NAME))); } | public String createBeanName(String brokerName) { return FAILED_MESSAGE_SENDER_BEAN_NAME_PREFIX + brokerName; } | FailedMessageSenderBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_SENDER_BEAN_NAME_PREFIX + brokerName; } } | FailedMessageSenderBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_SENDER_BEAN_NAME_PREFIX + brokerName; } } | FailedMessageSenderBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_SENDER_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String messageSenderDelegate); String createBeanName(String brokerName); } | FailedMessageSenderBeanDefinitionFactory { public String createBeanName(String brokerName) { return FAILED_MESSAGE_SENDER_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(String messageSenderDelegate); String createBeanName(String brokerName); } |
@Test public void createResendScheduledExecutorServiceBeanDefinition() throws Exception { AbstractBeanDefinition abstractBeanDefinition = underTest.create( executorService, "resendFailedMessageService", 0, 10, SECONDS); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(ResendScheduledExecutorService.... | public AbstractBeanDefinition create(ScheduledExecutorService executorService, String resendFailedMessageServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(ResendScheduledExecutorService.class) .addConstructorArgValue(executorService) .addConstructorArgReferen... | ResendScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String resendFailedMessageServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(ResendScheduledExecutorService.class) .addConstruc... | ResendScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String resendFailedMessageServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(ResendScheduledExecutorService.class) .addConstruc... | ResendScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String resendFailedMessageServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(ResendScheduledExecutorService.class) .addConstruc... | ResendScheduledExecutorServiceBeanDefinitionFactory { public AbstractBeanDefinition create(ScheduledExecutorService executorService, String resendFailedMessageServiceBeanName, long initialDelay, long executionFrequency, TimeUnit timeUnit) { return genericBeanDefinition(ResendScheduledExecutorService.class) .addConstruc... |
@Test public void createBeanName() throws Exception { assertThat(underTest.createBeanName(BROKER_NAME), is(equalTo(RESEND_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + BROKER_NAME))); } | public String createBeanName(String brokerName) { return RESEND_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } | ResendScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } } | ResendScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } } | ResendScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(ScheduledExecutorService executorService,
String resendFailedMessageSe... | ResendScheduledExecutorServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_SCHEDULED_EXECUTOR_SERVICE_BEAN_NAME_PREFIX + brokerName; } AbstractBeanDefinition create(ScheduledExecutorService executorService,
String resendFailedMessageSe... |
@Test public void createResendFailedMessageServiceBeanDefinition() throws Exception { AbstractBeanDefinition abstractBeanDefinition = underTest.create(BROKER_NAME, "messageSender"); assertThat(abstractBeanDefinition.getBeanClass(), typeCompatibleWith(ResendFailedMessageService.class)); assertThat(abstractBeanDefinition... | public AbstractBeanDefinition create(String brokerName, String messageSenderBeanName) { return genericBeanDefinition(ResendFailedMessageService.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("failedMessageSearchService") .addConstructorArgReference(messageSenderBeanName) .addConstructorArgValue(... | ResendFailedMessageServiceBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String messageSenderBeanName) { return genericBeanDefinition(ResendFailedMessageService.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("failedMessageSearchService") .addConstructorArgReferen... | ResendFailedMessageServiceBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String messageSenderBeanName) { return genericBeanDefinition(ResendFailedMessageService.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("failedMessageSearchService") .addConstructorArgReferen... | ResendFailedMessageServiceBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String messageSenderBeanName) { return genericBeanDefinition(ResendFailedMessageService.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("failedMessageSearchService") .addConstructorArgReferen... | ResendFailedMessageServiceBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String messageSenderBeanName) { return genericBeanDefinition(ResendFailedMessageService.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("failedMessageSearchService") .addConstructorArgReferen... |
@Test public void createBeanName() throws Exception { assertThat(underTest.createBeanName(BROKER_NAME), is(equalTo(RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + BROKER_NAME))); } | public String createBeanName(String brokerName) { return RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + brokerName; } | ResendFailedMessageServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + brokerName; } } | ResendFailedMessageServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + brokerName; } ResendFailedMessageServiceBeanDefinitionFactory(HistoricStatusPredicate historicStatusPredicate); } | ResendFailedMessageServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + brokerName; } ResendFailedMessageServiceBeanDefinitionFactory(HistoricStatusPredicate historicStatusPredicate); AbstractBeanDefinition create(String brokerName, Str... | ResendFailedMessageServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + brokerName; } ResendFailedMessageServiceBeanDefinitionFactory(HistoricStatusPredicate historicStatusPredicate); AbstractBeanDefinition create(String brokerName, Str... |
@Test public void successfullyResendFailedMessages() throws Exception { SearchFailedMessageRequest searchRequest = argThat(new HamcrestArgumentMatcher<>(aSearchRequestMatchingAllCriteria() .withBroker(equalTo(Optional.of(BROKER_NAME))) .withStatusMatcher(contains(RESENDING)))); when(failedMessageSearchService.search(se... | public void resendMessages() { LOGGER.debug("Resending FailedMessages to: {}", brokerName); failedMessageSearchService .search(searchMatchingAllCriteria() .withBroker(brokerName) .withStatus(RESENDING) .build()) .stream() .filter(historicStatusPredicate::test) .forEach(messageSender::send); } | ResendFailedMessageService { public void resendMessages() { LOGGER.debug("Resending FailedMessages to: {}", brokerName); failedMessageSearchService .search(searchMatchingAllCriteria() .withBroker(brokerName) .withStatus(RESENDING) .build()) .stream() .filter(historicStatusPredicate::test) .forEach(messageSender::send);... | ResendFailedMessageService { public void resendMessages() { LOGGER.debug("Resending FailedMessages to: {}", brokerName); failedMessageSearchService .search(searchMatchingAllCriteria() .withBroker(brokerName) .withStatus(RESENDING) .build()) .stream() .filter(historicStatusPredicate::test) .forEach(messageSender::send);... | ResendFailedMessageService { public void resendMessages() { LOGGER.debug("Resending FailedMessages to: {}", brokerName); failedMessageSearchService .search(searchMatchingAllCriteria() .withBroker(brokerName) .withStatus(RESENDING) .build()) .stream() .filter(historicStatusPredicate::test) .forEach(messageSender::send);... | ResendFailedMessageService { public void resendMessages() { LOGGER.debug("Resending FailedMessages to: {}", brokerName); failedMessageSearchService .search(searchMatchingAllCriteria() .withBroker(brokerName) .withStatus(RESENDING) .build()) .stream() .filter(historicStatusPredicate::test) .forEach(messageSender::send);... |
@Test public void throwsExceptionWhenTokenFileNotFound() throws Exception { VaultProperties vaultProperties = createVaultPropertiesWithTokenFileAt(FILE_LOCATION_THAT_DOES_NOT_EXIST); expectedException.expect(VaultException.class); expectedException.expectCause(isA(NoSuchFileException.class)); expectedException.expectMe... | Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } |
@Test public void readsTokenFileWhenItExists() throws Exception { String tokenFileLocation = ensureTokenFileExists(); VaultProperties vaultProperties = createVaultPropertiesWithTokenFileAt(tokenFileLocation); Vault vaultAPI = underTest.createVaultAPI(vaultProperties); assertThat(new File(tokenFileLocation).exists(), is... | Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } |
@Test public void readsTokenFileWhenItIsAFileUri() throws Exception { String tokenFileLocation = ensureTokenFileExists(); VaultProperties vaultProperties = createVaultPropertiesWithTokenFileAt("file:" + tokenFileLocation); Vault vaultAPI = underTest.createVaultAPI(vaultProperties); assertThat(vaultAPI, is(notNullValue(... | Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } |
@Test public void readsTokenFileWhenItIsAClasspathFile() throws Exception { VaultProperties vaultProperties = createVaultPropertiesWithTokenFileAt("classpath:test-token-value-file"); Vault vaultAPI = underTest.createVaultAPI(vaultProperties); assertThat(vaultAPI, is(notNullValue())); } | Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } | VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } } |
@Test public void equalsTest() { assertFalse(FAILED_MESSAGE_ID.equals(null)); assertFalse(FailedMessageId.fromUUID(A_UUID).equals(A_UUID)); assertFalse(FailedMessageId.newFailedMessageId().equals(FAILED_MESSAGE_ID)); assertTrue(FAILED_MESSAGE_ID.equals(FAILED_MESSAGE_ID)); assertTrue(FailedMessageId.fromUUID(A_UUID).eq... | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return id.equals(((FailedMessageId) o).id); } | FailedMessageId implements Id { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return id.equals(((FailedMessageId) o).id); } } | FailedMessageId implements Id { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return id.equals(((FailedMessageId) o).id); } private FailedMessageId(UUID id); } | FailedMessageId implements Id { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return id.equals(((FailedMessageId) o).id); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID... | FailedMessageId implements Id { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return id.equals(((FailedMessageId) o).id); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID... |
@Test public void matchesWhenConfiguredAndCorrectPath() throws Exception { assertThat(underTest.matches(MATCHING_PATH), is(true)); } | @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } } | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); } | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); @Override boolean matches(String secret); @... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); @Override boolean matches(String secret); @... |
@Test public void secretPathDoesNotMatch() throws Exception { assertThat(underTest.matches(NON_MATCHING_PATH), is(false)); } | @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } } | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); } | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); @Override boolean matches(String secret); @... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); @Override boolean matches(String secret); @... |
@Test public void unableToRetrieveIfNotAVaultSecretPath() throws Exception { expectedException.expect(IllegalStateException.class); underTest.retrieveSecret(NON_MATCHING_PATH); } | @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getData().get(VALUE_KEY); return new DecryptedValue(value.toCharArray()); } catch (Va... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... |
@Test public void readsSecretFromVault() throws Exception { DecryptedValue decryptedPassword = underTest.retrieveSecret(MATCHING_PATH); assertThat(decryptedPassword.getClearText(), is(SECRET_VALUE.toCharArray())); } | @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getData().get(VALUE_KEY); return new DecryptedValue(value.toCharArray()); } catch (Va... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... |
@Test public void wrapsVaultException() throws Exception { doAnswer(invocation -> { throw new VaultException("expected"); }).when(vault).logical(); expectedException.expect(RuntimeException.class); expectedException.expectMessage("Unable to connect to vault at:'null', looking up the path 'VAULT(/some/secret/path)'"); u... | @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getData().get(VALUE_KEY); return new DecryptedValue(value.toCharArray()); } catch (Va... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... |
@Test public void ensureThatARuntimeExceptionIsThrownWhenVaultKeyIsNotFound() throws Exception { expectedException.expect(RuntimeException.class); expectedException.expectMessage(is("Connected to '" + VAULT_PROPERTIES.getAddress() + "': unable to read secret at path '" + MATCHING_PATH + "'")); Logical logical = mock(Lo... | @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getData().get(VALUE_KEY); return new DecryptedValue(value.toCharArray()); } catch (Va... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... | SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vaultPath).getDat... |
@Test public void ensureThatIfNoResolutionStrategyForAVaultKeyCanBeFound_thenThrowAnIllegalArgumentException() throws Exception { SensitiveConfigValueLookupRegistry registry = new SensitiveConfigValueLookupRegistry(emptyList()); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(i... | public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy could be found to resolve vault path for:... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... |
@Test public void ensureThatIfResolutionStrategyIsFoundButItReturnsNull_thenThrowAnIllegalArgumentException() throws Exception { List<SensitiveConfigValueLookupStrategy> listOfStrategies = new ArrayList<>(); listOfStrategies.add(new SensitiveConfigValueLookupStrategy() { @Override public DecryptedValue retrieveSecret(S... | public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy could be found to resolve vault path for:... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... | SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant strategy coul... |
@Test public void ensureThatPropertyKeyThatRequiresResolutionFromVault_isDelegatedToTheUnderlyingRegistry() throws Exception { Map<String, Object> mapOfKeys = new HashMap<>(); String expectedTestKey = "expected.test.key"; String vaultConfigValue = "VAULT(my/secret/path)"; char[] expectedResolvedValue = new char[]{'p', ... | @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } } | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } Vau... | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } Vau... | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } Vau... |
@Test public void ensureThatIfAttemptingToRetriveAKeyThatIsNotInTheListOfResovableKeys_thenReturnNull() throws Exception { VaultPropertySource vaultPropertySource = new VaultPropertySource(new HashMap<>(), registry); char[] property = vaultPropertySource.getProperty("non-existent-key"); assertNull(property); verifyZero... | @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } } | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } Vau... | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } Vau... | VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } return null; } Vau... |
@Test public void hashCodeTest() { assertNotEquals(FAILED_MESSAGE_ID.hashCode(), FailedMessageId.newFailedMessageId().hashCode()); assertEquals(FAILED_MESSAGE_ID.getId().hashCode(), FAILED_MESSAGE_ID.hashCode()); } | @Override public int hashCode() { return id.hashCode(); } | FailedMessageId implements Id { @Override public int hashCode() { return id.hashCode(); } } | FailedMessageId implements Id { @Override public int hashCode() { return id.hashCode(); } private FailedMessageId(UUID id); } | FailedMessageId implements Id { @Override public int hashCode() { return id.hashCode(); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID(UUID uuid); @JsonCreator static FailedMessageId fromString(String uuid); @Override UUID getId(); @Override int hashCod... | FailedMessageId implements Id { @Override public int hashCode() { return id.hashCode(); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID(UUID uuid); @JsonCreator static FailedMessageId fromString(String uuid); @Override UUID getId(); @Override int hashCod... |
@Test public void failedMessageNotFoundExceptionThrownWhenFailedMessageEmpty() { expectedException.expect(FailedMessageNotFoundException.class); expectedException.expectMessage("Failed Message: " + FAILED_MESSAGE_ID + " not found"); when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.empty()); underT... | public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapterRegistry); } | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... |
@Test public void failedMessageNotFoundExceptionThrownIfStatusIsDeleted() { expectedException.expect(FailedMessageNotFoundException.class); expectedException.expectMessage("Failed Message: " + FAILED_MESSAGE_ID + " not found"); when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.of(failedMessage)); w... | public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapterRegistry); } | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... |
@Test public void successfullyCreateAFailedMessageBuilder() { when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.of(failedMessage)); when(failedMessage.getStatus()).thenReturn(FAILED); when(failedMessageBuilder.withUpdateRequestAdapterRegistry(updateRequestAdapterRegistry)).thenReturn(failedMessageB... | public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapterRegistry); } | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... | FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updateRequestAdapte... |
@Test public void addLabelDelegatesToDao() throws Exception { underTest.addLabel(FAILED_MESSAGE_ID, LABEL); verify(failedMessageDao).addLabel(FAILED_MESSAGE_ID, LABEL); } | public void addLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Adding label '{}' to FailedMessage: {}", label, failedMessageId); failedMessageDao.addLabel(failedMessageId, label); } | FailedMessageLabelService { public void addLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Adding label '{}' to FailedMessage: {}", label, failedMessageId); failedMessageDao.addLabel(failedMessageId, label); } } | FailedMessageLabelService { public void addLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Adding label '{}' to FailedMessage: {}", label, failedMessageId); failedMessageDao.addLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); } | FailedMessageLabelService { public void addLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Adding label '{}' to FailedMessage: {}", label, failedMessageId); failedMessageDao.addLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel(FailedMessage... | FailedMessageLabelService { public void addLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Adding label '{}' to FailedMessage: {}", label, failedMessageId); failedMessageDao.addLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel(FailedMessage... |
@Test public void removeLabelDelegatesToDao() throws Exception { underTest.removeLabel(FAILED_MESSAGE_ID, LABEL); verify(failedMessageDao).removeLabel(FAILED_MESSAGE_ID, LABEL); } | public void removeLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Removing label '{}' from FailedMessage: {}", label, failedMessageId); failedMessageDao.removeLabel(failedMessageId, label); } | FailedMessageLabelService { public void removeLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Removing label '{}' from FailedMessage: {}", label, failedMessageId); failedMessageDao.removeLabel(failedMessageId, label); } } | FailedMessageLabelService { public void removeLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Removing label '{}' from FailedMessage: {}", label, failedMessageId); failedMessageDao.removeLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); } | FailedMessageLabelService { public void removeLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Removing label '{}' from FailedMessage: {}", label, failedMessageId); failedMessageDao.removeLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel(Fai... | FailedMessageLabelService { public void removeLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Removing label '{}' from FailedMessage: {}", label, failedMessageId); failedMessageDao.removeLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel(Fai... |
@Test public void setLabelsDelegatesToDao() { underTest.setLabels(FAILED_MESSAGE_ID, singleton(LABEL)); verify(failedMessageDao).setLabels(FAILED_MESSAGE_ID, singleton(LABEL)); } | public void setLabels(FailedMessageId failedMessageId, Set<String> labels) { LOGGER.debug("Replacing all labels on FailedMessage: {}", failedMessageId); failedMessageDao.setLabels(failedMessageId, labels); } | FailedMessageLabelService { public void setLabels(FailedMessageId failedMessageId, Set<String> labels) { LOGGER.debug("Replacing all labels on FailedMessage: {}", failedMessageId); failedMessageDao.setLabels(failedMessageId, labels); } } | FailedMessageLabelService { public void setLabels(FailedMessageId failedMessageId, Set<String> labels) { LOGGER.debug("Replacing all labels on FailedMessage: {}", failedMessageId); failedMessageDao.setLabels(failedMessageId, labels); } FailedMessageLabelService(FailedMessageDao failedMessageDao); } | FailedMessageLabelService { public void setLabels(FailedMessageId failedMessageId, Set<String> labels) { LOGGER.debug("Replacing all labels on FailedMessage: {}", failedMessageId); failedMessageDao.setLabels(failedMessageId, labels); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel(FailedMe... | FailedMessageLabelService { public void setLabels(FailedMessageId failedMessageId, Set<String> labels) { LOGGER.debug("Replacing all labels on FailedMessage: {}", failedMessageId); failedMessageDao.setLabels(failedMessageId, labels); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel(FailedMe... |
@Test public void createFailedMessageDelegatesToDao() { underTest.create(failedMessage); Mockito.verify(failedMessageDao).insert(failedMessage); } | public void create(FailedMessage failedMessage) { failedMessageDao.insert(failedMessage); } | FailedMessageService { public void create(FailedMessage failedMessage) { failedMessageDao.insert(failedMessage); } } | FailedMessageService { public void create(FailedMessage failedMessage) { failedMessageDao.insert(failedMessage); } FailedMessageService(FailedMessageDao failedMessageDao,
FailedMessageBuilderFactory failedMessageBuilderFactory); } | FailedMessageService { public void create(FailedMessage failedMessage) { failedMessageDao.insert(failedMessage); } FailedMessageService(FailedMessageDao failedMessageDao,
FailedMessageBuilderFactory failedMessageBuilderFactory); void create(FailedMessage failedMessage); void delete(Faile... | FailedMessageService { public void create(FailedMessage failedMessage) { failedMessageDao.insert(failedMessage); } FailedMessageService(FailedMessageDao failedMessageDao,
FailedMessageBuilderFactory failedMessageBuilderFactory); void create(FailedMessage failedMessage); void delete(Faile... |
@Test public void noUpdatesArePerformedIfTheUpdateRequestListIsEmpty() { underTest.update(FAILED_MESSAGE_ID, Collections.emptyList()); verifyZeroInteractions(failedMessageDao); verifyZeroInteractions(failedMessageBuilderFactory); } | public <T extends UpdateRequest> void update(FailedMessageId failedMessageId, T updateRequest) { update(failedMessageId, Collections.singletonList(updateRequest)); } | FailedMessageService { public <T extends UpdateRequest> void update(FailedMessageId failedMessageId, T updateRequest) { update(failedMessageId, Collections.singletonList(updateRequest)); } } | FailedMessageService { public <T extends UpdateRequest> void update(FailedMessageId failedMessageId, T updateRequest) { update(failedMessageId, Collections.singletonList(updateRequest)); } FailedMessageService(FailedMessageDao failedMessageDao,
FailedMessageBuilderFactory failedMessageBu... | FailedMessageService { public <T extends UpdateRequest> void update(FailedMessageId failedMessageId, T updateRequest) { update(failedMessageId, Collections.singletonList(updateRequest)); } FailedMessageService(FailedMessageDao failedMessageDao,
FailedMessageBuilderFactory failedMessageBu... | FailedMessageService { public <T extends UpdateRequest> void update(FailedMessageId failedMessageId, T updateRequest) { update(failedMessageId, Collections.singletonList(updateRequest)); } FailedMessageService(FailedMessageDao failedMessageDao,
FailedMessageBuilderFactory failedMessageBu... |
@Test public void messageIsADuplicate() { duplicate = true; underTest.process(failedMessage); verify(duplicateFailedMessageProcessor).process(failedMessage); verifyZeroInteractions(newFailedMessageProcessor); } | @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } } | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } PredicateO... | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } PredicateO... | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } PredicateO... |
@Test public void messageIsNotADuplicate() { duplicate = false; underTest.process(failedMessage); verify(newFailedMessageProcessor).process(failedMessage); verifyZeroInteractions(duplicateFailedMessageProcessor); } | @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } } | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } PredicateO... | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } PredicateO... | PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); } } PredicateO... |
@Test public void toStringTest() { assertEquals(FAILED_MESSAGE_ID.getId().toString(), FAILED_MESSAGE_ID.toString()); } | @Override public String toString() { return id.toString(); } | FailedMessageId implements Id { @Override public String toString() { return id.toString(); } } | FailedMessageId implements Id { @Override public String toString() { return id.toString(); } private FailedMessageId(UUID id); } | FailedMessageId implements Id { @Override public String toString() { return id.toString(); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID(UUID uuid); @JsonCreator static FailedMessageId fromString(String uuid); @Override UUID getId(); @Override int hash... | FailedMessageId implements Id { @Override public String toString() { return id.toString(); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID(UUID uuid); @JsonCreator static FailedMessageId fromString(String uuid); @Override UUID getId(); @Override int hash... |
@Test public void delegatesToFailedMessageService() { underTest.process(failedMessage); } | @Override public void process(FailedMessage failedMessage) { failedMessageService.create(failedMessage); } | NewFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageService.create(failedMessage); } } | NewFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageService.create(failedMessage); } NewFailedMessageProcessor(FailedMessageService failedMessageService); } | NewFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageService.create(failedMessage); } NewFailedMessageProcessor(FailedMessageService failedMessageService); @Override void process(FailedMessage failedMessage); } | NewFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageService.create(failedMessage); } NewFailedMessageProcessor(FailedMessageService failedMessageService); @Override void process(FailedMessage failedMessage); } |
@Test public void predicateReturnsTrueWhenFailedMesageWithIdDoesNotExist() { when(failedMessage.getFailedMessageId()).thenReturn(FAILED_MESSAGE_ID); when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.empty()); assertThat(underTest.test(failedMessage), is(true)); } | @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } } | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); } | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); @Override boolean test(FailedMessage f... | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); @Override boolean test(FailedMessage f... |
@Test public void predicateReturnsFalseWhenFailedMessageWithIdExists() { when(failedMessage.getFailedMessageId()).thenReturn(FAILED_MESSAGE_ID); when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.of(failedMessage)); assertThat(underTest.test(failedMessage), is(false)); } | @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } } | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); } | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); @Override boolean test(FailedMessage f... | UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); @Override boolean test(FailedMessage f... |
@Test public void successfullyProcessExistingFailedMessage() { underTest.process(failedMessage); verify(failedMessageDao).update(failedMessage); } | @Override public void process(FailedMessage failedMessage) { failedMessageDao.update(failedMessage); } | ExistingFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageDao.update(failedMessage); } } | ExistingFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageDao.update(failedMessage); } ExistingFailedMessageProcessor(FailedMessageDao failedMessageDao); } | ExistingFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageDao.update(failedMessage); } ExistingFailedMessageProcessor(FailedMessageDao failedMessageDao); @Override void process(FailedMessage failedMessage); } | ExistingFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageDao.update(failedMessage); } ExistingFailedMessageProcessor(FailedMessageDao failedMessageDao); @Override void process(FailedMessage failedMessage); } |
@Test public void predicateReturnsTrueIfSearchFindsAResult() { when(destination.getBrokerName()).thenReturn(BROKER_NAME); when(failedMessage.getDestination()).thenReturn(destination); when(failedMessage.getJmsMessageId()).thenReturn(JMS_MESSAGE_ID); when(failedMessageSearchService.search(any(SearchFailedMessageRequest.... | @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).isEmpty(); } | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... |
@Test public void predicateReturnsFalseIfSearchFindsAResult() { when(destination.getBrokerName()).thenReturn(BROKER_NAME); when(failedMessage.getDestination()).thenReturn(destination); when(failedMessage.getJmsMessageId()).thenReturn(JMS_MESSAGE_ID); when(failedMessageSearchService.search(any(SearchFailedMessageRequest... | @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).isEmpty(); } | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... | UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId()) .build() ).is... |
@Test public void nullPropertiesReturnsANewHashMap() { assertThat(underTest.convertToObject(null), is(equalTo(new HashMap<>()))); } | @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGGER.error("Could read the following properties: " + value, e); } return Collect... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... |
@Test public void convertingNullMapToStringReturnsNull() { assertThat(underTest.convertFromObject(null), is(nullValue())); } | @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following Map: " + item, e); } return null; } | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... |
@Test public void nullValueIsReturnedIfTheJsonCannotBeRead() throws IOException { when(objectMapper.readValue(any(String.class), any(TypeReference.class))).thenThrow(IOException.class); assertThat(new PropertiesConverter(objectMapper).convertToObject("foo"), is(Collections.emptyMap())); } | @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGGER.error("Could read the following properties: " + value, e); } return Collect... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOException e) { LOGG... |
@Test public void nullValueIsReturnedIfTheMapCannotBeParsed() throws Exception { when(objectMapper.writeValueAsString(singletonMap("foo", "bar"))).thenThrow(JsonProcessingException.class); assertThat(new PropertiesConverter(objectMapper).convertFromObject(singletonMap("foo", "bar")), is(nullValue())); } | @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following Map: " + item, e); } return null; } | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... | PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert the following M... |
@Test public void encode() { underTest.encode(bsonWriter, AN_INSTANT, encoderContext); verify(bsonWriter).writeDateTime(EPOCH_MILLI); } | @Override public void encode(BsonWriter writer, Instant value, EncoderContext encoderContext) { writer.writeDateTime(value.toEpochMilli()); } | InstantAsDateTimeCodec implements Codec<Instant> { @Override public void encode(BsonWriter writer, Instant value, EncoderContext encoderContext) { writer.writeDateTime(value.toEpochMilli()); } } | InstantAsDateTimeCodec implements Codec<Instant> { @Override public void encode(BsonWriter writer, Instant value, EncoderContext encoderContext) { writer.writeDateTime(value.toEpochMilli()); } } | InstantAsDateTimeCodec implements Codec<Instant> { @Override public void encode(BsonWriter writer, Instant value, EncoderContext encoderContext) { writer.writeDateTime(value.toEpochMilli()); } @Override void encode(BsonWriter writer, Instant value, EncoderContext encoderContext); @Override Instant decode(BsonReader re... | InstantAsDateTimeCodec implements Codec<Instant> { @Override public void encode(BsonWriter writer, Instant value, EncoderContext encoderContext) { writer.writeDateTime(value.toEpochMilli()); } @Override void encode(BsonWriter writer, Instant value, EncoderContext encoderContext); @Override Instant decode(BsonReader re... |
@Test public void statusHistoryResponseTest() { assertThat(underTest, is(statusHistoryResponse().withStatus(FAILED).withEffectiveDateTime(NOW))); } | public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } } | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status,
... | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status,
... | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status,
... |
@Test public void serialiseAndDeserialiseObject() throws IOException { final String json = OBJECT_MAPPER.writeValueAsString(underTest); assertThat(OBJECT_MAPPER.readValue(json, StatusHistoryResponse.class), is(statusHistoryResponse().withStatus(FAILED).withEffectiveDateTime(NOW))); } | public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } } | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status,
... | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status,
... | StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status,
... |
@Test public void attemptingToSetNullPropertiesCreatesAnEmptyMap() { final CreateFailedMessageRequest createFailedMessageRequest = createFailedMessageRequestBuilder .withProperties(null) .build(); assertThat(createFailedMessageRequest, is(createFailedMessageRequest().withProperties(equalTo(emptyMap())))); } | CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty("content") String content, @J... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... |
@Test public void attemptingToSetNullLabelsCreatesAnEmptySet() { final CreateFailedMessageRequest createFailedMessageRequest = createFailedMessageRequestBuilder .withLabels(null) .build(); assertThat(createFailedMessageRequest, is(createFailedMessageRequest().withLabels(emptyIterable()))); } | CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty("content") String content, @J... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... |
@Test public void addProperties() { final CreateFailedMessageRequest createFailedMessageRequest = createFailedMessageRequestBuilder .withProperties(Collections.singletonMap("foo", "bar")) .withProperty("ham", "eggs") .build(); assertThat(createFailedMessageRequest, is(createFailedMessageRequest() .withProperties(allOf(... | CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty("content") String content, @J... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... |
@Test public void addLabels() { final CreateFailedMessageRequest createFailedMessageRequest = createFailedMessageRequestBuilder .withLabels(Collections.singleton("foo")) .withLabel("bar") .build(); assertThat(createFailedMessageRequest, is(createFailedMessageRequest() .withLabels(containsInAnyOrder("foo", "bar")))); } | CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty("content") String content, @J... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... | CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, @JsonProperty(... |
@Test public void serialiseAndDeserialiseWithOptionalFieldsMissing() throws Exception { String json = OBJECT_MAPPER.writeValueAsString( SearchFailedMessageRequest.searchMatchingAllCriteria() .withStatus(FAILED) .build()); assertThat(OBJECT_MAPPER.readValue(json, SearchFailedMessageRequest.class), is( aSearchRequestMatc... | public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } } | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker,
@JsonProperty("destination") Optiona... | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker,
@JsonProperty("destination") Optiona... | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker,
@JsonProperty("destination") Optiona... |
@Test public void serialiseAndDeserialiseWithAllFieldsPopulated() throws Exception { String json = OBJECT_MAPPER.writeValueAsString( SearchFailedMessageRequest.searchMatchingAllCriteria() .withBroker("broker") .withDestination("queue") .withStatus(FAILED) .withJmsMessageId("ID:localhost.localdomain-46765-1518703251379-... | public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } } | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker,
@JsonProperty("destination") Optiona... | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker,
@JsonProperty("destination") Optiona... | SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker,
@JsonProperty("destination") Optiona... |
@Test public void removeDelegatesToTheDao() { when(failedMessageDao.removeFailedMessages()).thenReturn(NUMBER_OF_MESSAGES_REMOVED); underTest.removeFailedMessages(); verify(failedMessageDao).removeFailedMessages(); } | public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } } | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } Remove... | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } Remove... | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } Remove... |
@Test public void exceptionsAreSwallowedAndLogged() { when(failedMessageDao.removeFailedMessages()).thenThrow(exception); underTest.removeFailedMessages(); verify(logger).error("Could not remove messages", exception); } | public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } } | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } Remove... | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } Remove... | RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", e); } } Remove... |
@Test public void decode() { when(bsonReader.readDateTime()).thenReturn(EPOCH_MILLI); assertThat(underTest.decode(bsonReader, decoderContext), equalTo(AN_INSTANT)); } | @Override public Instant decode(BsonReader reader, DecoderContext decoderContext) { return Instant.ofEpochMilli(reader.readDateTime()); } | InstantAsDateTimeCodec implements Codec<Instant> { @Override public Instant decode(BsonReader reader, DecoderContext decoderContext) { return Instant.ofEpochMilli(reader.readDateTime()); } } | InstantAsDateTimeCodec implements Codec<Instant> { @Override public Instant decode(BsonReader reader, DecoderContext decoderContext) { return Instant.ofEpochMilli(reader.readDateTime()); } } | InstantAsDateTimeCodec implements Codec<Instant> { @Override public Instant decode(BsonReader reader, DecoderContext decoderContext) { return Instant.ofEpochMilli(reader.readDateTime()); } @Override void encode(BsonWriter writer, Instant value, EncoderContext encoderContext); @Override Instant decode(BsonReader reader... | InstantAsDateTimeCodec implements Codec<Instant> { @Override public Instant decode(BsonReader reader, DecoderContext decoderContext) { return Instant.ofEpochMilli(reader.readDateTime()); } @Override void encode(BsonWriter writer, Instant value, EncoderContext encoderContext); @Override Instant decode(BsonReader reader... |
@Test public void successfullyMarkAMessageForResending() { underTest.resendFailedMessage(FAILED_MESSAGE_ID); verify(failedMessageService).update(eq(FAILED_MESSAGE_ID), statusUpdateRequest.capture()); assertThat(statusUpdateRequest.getValue(), aStatusUpdateRequest(RESEND)); } | @Override public void resendFailedMessage(FailedMessageId failedMessageId) { failedMessageService.update(failedMessageId, statusUpdateRequest(RESEND)); } | ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessage(FailedMessageId failedMessageId) { failedMessageService.update(failedMessageId, statusUpdateRequest(RESEND)); } } | ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessage(FailedMessageId failedMessageId) { failedMessageService.update(failedMessageId, statusUpdateRequest(RESEND)); } ResendFailedMessageResource(FailedMessageService failedMessageService,
... | ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessage(FailedMessageId failedMessageId) { failedMessageService.update(failedMessageId, statusUpdateRequest(RESEND)); } ResendFailedMessageResource(FailedMessageService failedMessageService,
... | ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessage(FailedMessageId failedMessageId) { failedMessageService.update(failedMessageId, statusUpdateRequest(RESEND)); } ResendFailedMessageResource(FailedMessageService failedMessageService,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.