Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ActiveMQ module when ActiveMQ/Artemis and Testcontainers are selected #1415

Closed

Conversation

eddumelendez
Copy link
Contributor

@eddumelendez eddumelendez commented Feb 21, 2024

Testcontainers 1.19.4 offers an ActiveMQ module, which provides two implementations
ActiveMQContainer and ArtemisContainer. Both, are already supported as part of
Spring Boot 3.3.0-M2.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 21, 2024
@mhalbritter mhalbritter added type: enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 22, 2024
@mhalbritter
Copy link
Contributor

mhalbritter commented Feb 29, 2024

Thanks! I've tested it, but there are some pieces missing:

When i generate a 3.3.0-SNAPSHOT project, it doesn't include the activemq testcontainers module. That's because

private static final VersionRange SPRING_BOOT_3_3_0_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0");

doesn't match 3.3.0-SNAPSHOT. I guess it should be:

private static final VersionRange SPRING_BOOT_3_3_0_M2_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0-M2");

However, with that change, the generated test main looks like this:

	@Bean
	@ServiceConnection
	ActiveMQContainer<?> activemqContainer() {
		return new ActiveMQContainer<>(DockerImageName.parse("apache/activemq-classic:latest"));
	}

When compiling, this fails with:

> Task :compileTestJava FAILED
/home/mhalbritter/Downloads/demo330/src/test/java/com/example/demo330/TestDemo330Application.java:15: error: type ActiveMQContainer does not take parameters
        ActiveMQContainer<?> activemqContainer() {
                         ^
/home/mhalbritter/Downloads/demo330/src/test/java/com/example/demo330/TestDemo330Application.java:16: error: cannot infer type arguments for ActiveMQContainer
                return new ActiveMQContainer<>(DockerImageName.parse("apache/activemq-classic:latest"));
                                            ^
  reason: cannot use '<>' with non-generic class ActiveMQContainer
2 errors

FAILURE: Build failed with an exception.

@mhalbritter mhalbritter self-assigned this Feb 29, 2024
@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Feb 29, 2024
@eddumelendez
Copy link
Contributor Author

Thanks @mhalbritter ! I missed to set the containerClassNameGeneric to false. Now, it works as expected.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 29, 2024
@mhalbritter
Copy link
Contributor

Thanks!

@eddumelendez eddumelendez deleted the support-tc-activemq-module branch March 1, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants