Skip to content

Commit

Permalink
use JUnit 5 instead of Junit 4 and twitter4j 4.1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippSalvisberg committed Nov 13, 2022
1 parent a6e77f7 commit ec3a41e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/test/java/com/salvis/emptracker/tests/TweetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,19 @@
*/
package com.salvis.emptracker.tests;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;

import com.salvis.emptracker.AppConfig;

import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.v1.Status;

@RunWith(SpringRunner.class)
@SpringBootTest
@SpringBootTest(classes=AppConfig.class)
@Import(AppConfig.class)
public class TweetTest {

Expand All @@ -39,9 +36,9 @@ public class TweetTest {

@Test
public void postTweet() throws TwitterException {
String text = "SCOTT got a pay raise of $150. Making $3000 a month now. Congrats.";
Status status = twitter.updateStatus(text);
Assert.assertEquals(text, status.getText());
String text = "SCOTT got a pay raise of $250. Making $3100 a month now. Congrats.";
Status status = twitter.v1().tweets().updateStatus(text);
Assertions.assertEquals(text, status.getText());
}

}

0 comments on commit ec3a41e

Please sign in to comment.