remove old test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Raffaele Mignone 2019-11-09 11:53:25 +01:00
parent 7337e1831b
commit fda9488120
Signed by: norangebit
GPG Key ID: F5255658CB220573

View File

@ -1,51 +0,0 @@
package wekan.wrapper.api;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.junit.Test;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import wekan.wrapper.entity.Board;
import java.io.IOException;
import java.util.List;
public class BoardServiceTestX {
@Test
public void test() {
OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
httpClient.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request().newBuilder()
.addHeader("Authorization", "Bearer GC0ibjF-5OlYczYe6WKCXX_72MtXVC-OEUK4puf9VeI")
.addHeader("Accept", "application/json")
.build();
return chain.proceed(request);
}
});
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://board.norangeb.it")
.addConverterFactory(GsonConverterFactory.create())
.client(httpClient.build())
.build();
BoardService boardService = retrofit.create(BoardService.class);
try {
List<Board> list = boardService.getPublicBoard().execute().body();
for (Board b : list){
System.out.println(b.getId());
System.out.println(b.getTitle());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}