Skip to content

Commit

Permalink
Revert "fix #76"
Browse files Browse the repository at this point in the history
This reverts commit fd321cb.
  • Loading branch information
Bindambc committed Mar 31, 2023
1 parent fd321cb commit 6962fde
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class QuickReplyButton extends Button {
* Instantiates a new Quick reply button.
*/
protected QuickReplyButton() {
super(ButtonType.QUICK_REPLY);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class UrlButton extends Button {
* Instantiates a new Url button.
*/
protected UrlButton() {
super(ButtonType.URL);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.whatsapp.api.impl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.whatsapp.api.MockServerUtilsTest;
import com.whatsapp.api.TestConstants;
import com.whatsapp.api.WhatsappApiFactory;
Expand All @@ -18,7 +17,6 @@
import com.whatsapp.api.domain.templates.PhoneNumberButton;
import com.whatsapp.api.domain.templates.QuickReplyButton;
import com.whatsapp.api.domain.templates.UrlButton;
import com.whatsapp.api.domain.templates.type.ButtonType;
import com.whatsapp.api.domain.templates.type.Category;
import com.whatsapp.api.domain.templates.type.HeaderFormat;
import com.whatsapp.api.domain.templates.type.LanguageType;
Expand Down Expand Up @@ -452,21 +450,16 @@ void testRetrieveMessageTemplate1() throws IOException, URISyntaxException, JSON

var templates = whatsappBusinessCloudApi.retrieveTemplates(WABA_ID);
//TODO: review button
var returnedJson = new ObjectMapper().writeValueAsString(templates);
//var returnedJson = new ObjectMapper().writeValueAsString(templates);

JSONAssert.assertEquals(expectedJson, returnedJson,JSONCompareMode.STRICT);
//JSONAssert.assertEquals(expectedJson, returnedJson,JSONCompareMode.STRICT);
// data[1].components[3].buttons[0]

Assertions.assertEquals(7, templates.data().size());
Assertions.assertEquals("welcome_template3", templates.data().get(0).name());
Assertions.assertEquals("Hello {{1}}, welcome to our {{2}} test.", templates.data().get(0).components().get(1).getText());
Assertions.assertEquals("1772832833109192", templates.data().get(6).id());

var buttonComponent = (ButtonComponent) templates.data().get(1).components().get(3);

Assertions.assertEquals(ButtonType.QUICK_REPLY,buttonComponent.getButtons().get(0).getType());


}

@Test
Expand Down

0 comments on commit 6962fde

Please sign in to comment.