Added api service
This commit is contained in:
@ -2,36 +2,37 @@ package com.plannaplan.services;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.DirtiesContext.MethodMode;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import com.plannaplan.entities.User;
|
||||
import com.plannaplan.exceptions.UserNotFoundException;
|
||||
import com.plannaplan.types.UserRoles;
|
||||
import com.plannaplan.models.UserApiResponse;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@ContextConfiguration
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
public class UsosApiServiceTest {
|
||||
|
||||
@Autowired
|
||||
private UsosApiService service;
|
||||
|
||||
@Test
|
||||
public void chuj() {
|
||||
this.service.xd();
|
||||
@Ignore
|
||||
public void shouldReturnPersonalData() throws IOException, InterruptedException, ExecutionException {
|
||||
|
||||
final UserApiResponse response = this.service.getUserData("499054");
|
||||
|
||||
assertTrue(response.getName().equals("Marcin"));
|
||||
assertTrue(response.getSurname().equals("Woźniak"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,5 +14,8 @@ spring.mail.properties.mail.smtp.auth=false
|
||||
spring.mail.properties.mail.smtp.starttls.enable=false
|
||||
|
||||
plannaplan.email = plannaplan.kontakt@gmail.com
|
||||
plannaplan.apiurl = https://usosapidemo.amu.edu.pl
|
||||
plannaplan.apikey=${PLANNAPLAN_CONSUMER_KEY}
|
||||
plannaplan.apisecret=${PLANNAPLAN_CONSUMER_SECRET}
|
||||
|
||||
server.port=1285
|
Reference in New Issue
Block a user