release 0.1 #30

Manually merged
noemi3 merged 150 commits from release/0.1 into master 2020-01-18 14:59:02 +00:00
1 changed files with 0 additions and 51 deletions
Showing only changes of commit fda9488120 - Show all commits

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();
}
}
}