Examples of StackOverflowQuestionEntity


Examples of com.so.happy.model.StackOverflowQuestionEntity

        Gson gson = new GsonBuilder().create();
        final StackOverflowEntity soEntity = gson.fromJson(stringWriter.toString(), StackOverflowEntity.class);
        System.err.println("--------------------------");
        System.err.println(soEntity);
        System.err.println("--------------------------");
        final StackOverflowQuestionEntity questionEntity = new StackOverflowQuestionEntity();
        questionEntity.setQuestionId(questionId);
        final SOItem soItem = soEntity.getItems()[0];
        questionEntity.setTitle(soItem.getTitle());
        questionEntity.setLink(soItem.getLink());
        questionEntity.setAnswered(soItem.isAnswered());
        questionEntity.setViewCount(soItem.getViewCount());
        questionEntity.setAnswerCount(soItem.getAnswerCount());
        return questionEntity;
    }
View Full Code Here

Examples of com.so.happy.model.StackOverflowQuestionEntity

    @Test
    public void shouldBeAbleToLoadFirst100SOQuestionsByIndicatedTagRestlet() throws IOException {
        final StackOverFlowQuestion happy = INJECTOR.getInstance(StackOverFlowQuestion.class);
        final String expectedQuestionId = "21733439";
        final StackOverflowQuestionEntity question = happy.findQuestionById(expectedQuestionId);
        Assertions.assertThat(question.getQuestionId()).isNotEmpty().isEqualTo(expectedQuestionId);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.