@@ -0,0 +1,1973 @@
+package edu.kit.ipd.crowdcontrol.objectservice.crowdworking.mturk;%0A%0Aimport edu.kit.ipd.crowdcontrol.objectservice.crowdworking.mturk.mturk.HIT;%0Aimport edu.kit.ipd.crowdcontrol.objectservice.crowdworking.mturk.mturk.HITStatus;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.FileInputStream;%0Aimport java.math.BigDecimal;%0Aimport java.util.Date;%0Aimport java.util.Properties;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * Created by marcel on 01.02.16.%0A */%0Apublic class MTurkRestApiTest %7B%0A    private MTurkRestApi api;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        Properties properties = new Properties();%0A        properties.load(new FileInputStream(%22src/integration-test/resources/mturk.properties%22));%0A        api = new MTurkRestApi(%0A                properties.getProperty(%22User%22),%0A                properties.getProperty(%22Password%22),%0A                %22https://mechanicalturk.sandbox.amazonaws.com/%22);%0A    %7D%0A%0A    @Test%0A    public void testPublishHIT() throws Exception %7B%0A        String id = api.publishHIT(%22Description2%22,%22Title1%22,%0A                0.20,60,2000,%22test,for,everything%22,%0A                2,2000000,%22data%22,new Date().toString()).get();%0A%0A        assertNotEquals(id, null);%0A%0A        HIT hit = api.getHit(id).get();%0A%0A        assertEquals(hit.getTitle(), %22Title1%22);%0A        assertEquals(hit.getDescription(), %22Description2%22);%0A        assertTrue(hit.getReward().getAmount().subtract(new BigDecimal(0.20)).doubleValue() %3C 0.0001);%0A        assertEquals(hit.getAssignmentDurationInSeconds(), new Long(60));%0A        //FIXME check the lifetime%0A        assertEquals(hit.getKeywords(), %22test,for,everything%22);%0A        assertEquals(hit.getMaxAssignments(), new Integer(2));%0A        assertEquals(hit.getAutoApprovalDelayInSeconds(), new Long(2000000));%0A        assertEquals(hit.getRequesterAnnotation(), %22data%22);%0A%0A        assertTrue(api.unpublishHIT(id).get());%0A%0A        assertEquals(api.getHit(id).get().getHITStatus(), HITStatus.DISPOSED);%0A%0A    %7D%0A%7D

Add test for mturkrestapi