Skip to content

Instantly share code, notes, and snippets.

@ederrafo
Last active April 8, 2023 04:03
Show Gist options
  • Save ederrafo/4b3e97b6e2f5b409f6e4e40a05e6dd6d to your computer and use it in GitHub Desktop.
Save ederrafo/4b3e97b6e2f5b409f6e4e40a05e6dd6d to your computer and use it in GitHub Desktop.
junit test

test @bean from file json

package tech.zdev.payment.bot.bean;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import tech.zdev.payment.bot.bean.payme.PaymeBean;


import static org.junit.Assert.*;

@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("dev")
public class PaymeBeanTest {

    @Autowired
    @Qualifier("paymeBean")
    PaymeBean paymeBean;


    @Test
    public void test() {
        paymeBean.getCommissions();
        assertFalse(paymeBean.getCommissions().isEmpty());
        assertFalse(paymeBean.getRemarks().isEmpty());
    }

}
assertNotSame("", response.getData().getRefunds().getCreateAttachmentUploadURL());
       
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment