Skip to content

Commit 8d513c1

Browse files
authored
updates to get func tests working locally (#1205)
* updates to get func tests working locally * disabling test
1 parent 161dd5d commit 8d513c1

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

src/functionalTest/java/uk/gov/hmcts/reform/bulkscan/payment/processor/JmsPaymentForExceptionRecordTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.junit.jupiter.api.Test;
66
import org.springframework.beans.factory.annotation.Autowired;
77
import org.springframework.boot.test.context.SpringBootTest;
8+
import org.springframework.boot.test.mock.mockito.MockBean;
89
import org.springframework.test.context.ActiveProfiles;
910
import uk.gov.hmcts.reform.bulkscan.payment.processor.ccd.CcdAuthenticator;
1011
import uk.gov.hmcts.reform.bulkscan.payment.processor.ccd.CcdAuthenticatorFactory;
@@ -13,6 +14,7 @@
1314
import uk.gov.hmcts.reform.bulkscan.payment.processor.helper.JmsPaymentsMessageSender;
1415
import uk.gov.hmcts.reform.bulkscan.payment.processor.model.CreatePaymentsCommand;
1516
import uk.gov.hmcts.reform.bulkscan.payment.processor.model.PaymentData;
17+
import uk.gov.hmcts.reform.bulkscan.payment.processor.service.servicebus.PaymentMessageProcessor;
1618
import uk.gov.hmcts.reform.ccd.client.CoreCaseDataApi;
1719
import uk.gov.hmcts.reform.ccd.client.model.CaseDetails;
1820

@@ -23,8 +25,8 @@
2325
import static org.awaitility.Awaitility.await;
2426

2527
@SpringBootTest
26-
@ActiveProfiles("functional")
27-
@Disabled // For local dev testing only
28+
@ActiveProfiles("dev")
29+
@Disabled
2830
class JmsPaymentForExceptionRecordTest {
2931

3032
private static final String AWAITING_DNC_PROCESSING_FLAG_NAME = "awaitingPaymentDCNProcessing";
@@ -33,6 +35,9 @@ class JmsPaymentForExceptionRecordTest {
3335
private static final String JURISDICTION = "BULKSCAN";
3436
private static final String BULKSCAN_PO_BOX = "BULKSCANPO1";
3537

38+
@MockBean
39+
private PaymentMessageProcessor paymentMessageProcessor;
40+
3641
@Autowired
3742
private CoreCaseDataApi coreCaseDataApi;
3843

src/functionalTest/java/uk/gov/hmcts/reform/bulkscan/payment/processor/PaymentForExceptionRecordTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class PaymentForExceptionRecordTest {
4646
@Autowired
4747
private CcdAuthenticatorFactory ccdAuthenticatorFactory;
4848

49+
// Note: if running locally, refer to JmsPaymentForExceptionRecordTest, not this one
50+
// Remove @Disabled on the other if you want to run it locally
4951
@Test
5052
public void should_set_awaiting_payment_false_after_payment_sent() {
5153
// given

src/functionalTest/java/uk/gov/hmcts/reform/bulkscan/payment/processor/helper/CaseSearcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.Map;
1212

1313
@Service
14-
@Profile("functional")
14+
@Profile({"functional", "dev"})
1515
public class CaseSearcher {
1616

1717
private final CcdAuthenticatorFactory factory;

src/functionalTest/java/uk/gov/hmcts/reform/bulkscan/payment/processor/helper/ExceptionRecordCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Map;
1616

1717
@Service
18-
@Profile("functional")
18+
@Profile({"functional", "dev"})
1919
public class ExceptionRecordCreator {
2020

2121
private static final Logger log = LoggerFactory.getLogger(ExceptionRecordCreator.class);

src/functionalTest/java/uk/gov/hmcts/reform/bulkscan/payment/processor/helper/JmsPaymentsMessageSender.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import uk.gov.hmcts.reform.bulkscan.payment.processor.model.CreatePaymentsCommand;
1414

1515
@Service
16-
@Profile("functional")
16+
@Profile("dev")
1717
public class JmsPaymentsMessageSender {
1818

1919
private static final Logger log = LoggerFactory.getLogger(JmsPaymentsMessageSender.class);
@@ -44,7 +44,7 @@ public void send(CreatePaymentsCommand cmd) {
4444
}
4545

4646
public ConnectionFactory getTestFactory() {
47-
String connection = String.format("amqp://localhost:%1s?amqp.idleTimeout=%2d", "5672", 30000);
47+
String connection = "tcp://localhost:61616";
4848
ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(connection);
4949
activeMQConnectionFactory.setUserName("admin");
5050
activeMQConnectionFactory.setPassword("admin");

src/main/java/uk/gov/hmcts/reform/bulkscan/payment/processor/service/servicebus/JmsPaymentMessageProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* For LOCAL Dev Only. For AAT and upwards Azure Service Bus is used
1818
*/
1919
@Service
20-
@Profile("!functional & !integration")
20+
@Profile("dev")
2121
public class JmsPaymentMessageProcessor {
2222
private static final Logger log = LoggerFactory.getLogger(JmsPaymentMessageProcessor.class);
2323

0 commit comments

Comments
 (0)