whatsapp-business-java-api icon indicating copy to clipboard operation
whatsapp-business-java-api copied to clipboard

issue running test

Open alkahtani opened this issue 2 years ago • 2 comments

I am getting this error when running testing unit below

`WhatsappApiFactory factory = WhatsappApiFactory.newInstance(TestConstants.TOKEN);

    WhatsappBusinessCloudApi whatsappBusinessCloudApi = factory.newBusinessCloudApi();
    Message message = MessageBuilder.builder()//
            .setTo(PHONE_NUMBER_1)//
            .buildTextMessage(new TextMessage()//
                    .setBody(Formatter.bold("Hello world!") + "\nSome code here: \n" + Formatter.code("hello world code here"))//
                    .setPreviewUrl(false));


    MessageResponse messageResponse = whatsappBusinessCloudApi.sendMessage(PHONE_NUMBER_ID, message);

    System.out.println(messageResponse.toString());`

My Pom.xml :

` <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> 2.7.17 <relativePath /> <groupId>com.waba.connector</groupId> <artifactId>waba-connector</artifactId> 0.0.1-SNAPSHOT waba-connector to connect to whatsapp api <java.version>1.8</java.version> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId>

	<dependency>
		<groupId>com.h2database</groupId>
		<artifactId>h2</artifactId>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>com.oracle.database.jdbc</groupId>
		<artifactId>ojdbc8</artifactId>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>org.postgresql</groupId>
		<artifactId>postgresql</artifactId>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.github.Bindambc</groupId>
		<artifactId>whatsapp-business-java-api</artifactId>
		<version>v0.3.4</version>
	</dependency>
</dependencies>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
	</plugins>
</build>
<repositories>
<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>
`

My JAVA Version : java 13.0.2 2020-01-14 Java(TM) SE Runtime Environment (build 13.0.2+8)

Please direct me

alkahtani avatar Oct 23 '23 09:10 alkahtani

Hello and welcome! We're glad to see that you've opened your first issue. We appreciate your contribution and would love to hear more about the problem you're experiencing. Our team is actively monitoring this repository and we will do our best to respond to your issue as soon as possible. Thank you for using our project and we look forward to working with you!

github-actions[bot] avatar Oct 23 '23 09:10 github-actions[bot]

Hello @alkahtani, this WhatsApp SDK works only with Java versions 17 or higher.

Bindambc avatar May 07 '24 03:05 Bindambc