Skip to content

Commit

Permalink
updated unit tests under api
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaSuckro committed Oct 13, 2016
1 parent 55030b5 commit 685f612
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright 2016 Intuit
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -23,6 +23,7 @@
import com.intuit.wasabi.exceptions.AssignmentNotFoundException;
import com.intuit.wasabi.experimentobjects.*;
import com.intuit.wasabi.experimentobjects.Bucket.Label;
import org.apache.commons.httpclient.HttpStatus;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -32,11 +33,13 @@
import org.mockito.runners.MockitoJUnitRunner;

import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.when;
Expand All @@ -63,7 +66,9 @@ public class AssignmentsResourceTest {
@Mock
private ExperimentBatch experimentBatch;
@Mock
private @javax.ws.rs.core.Context HttpHeaders headers;
private
@javax.ws.rs.core.Context
HttpHeaders headers;
@Mock
private Map<String, Object> submittedData;
@Mock
Expand Down Expand Up @@ -203,6 +208,6 @@ public void postBatchAssignmentForPage() throws Exception {

@Test
public void getAssignmentsQueueLength() throws Exception {
assertNotNull(resource.getAssignmentsQueueLength());
assertTrue(resource.getAssignmentsQueueLength().getStatus() == HttpStatus.SC_OK);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright 2016 Intuit
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -22,6 +22,7 @@
import com.intuit.wasabi.events.Events;
import com.intuit.wasabi.experimentobjects.Application;
import com.intuit.wasabi.experimentobjects.Experiment;
import org.apache.commons.httpclient.HttpStatus;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -33,6 +34,7 @@
import java.util.*;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;

Expand Down Expand Up @@ -110,6 +112,6 @@ public void recordExperimentsEvents() throws Exception {

@Test
public void getEventsQueueLength() throws Exception {
assertNotNull(resource.getEventsQueueLength());
assertTrue(resource.getEventsQueueLength().getStatus() == HttpStatus.SC_OK);
}
}

0 comments on commit 685f612

Please sign in to comment.