Search in sources :

Example 1 with State

use of org.codice.alliance.nsili.common.UCO.State in project alliance by codice.

the class GetRelatedFilesRequestImplTest method testCompleteNoPort.

@Test
public void testCompleteNoPort() throws Exception {
    NameListHolder locations = new NameListHolder();
    GetRelatedFilesRequestImpl noPortRequest = new GetRelatedFilesRequestImpl(getTestMetacards(), getTestFileLocation(), "THUMBNAIL", null);
    noPortRequest.setHttpClient(mockHttpClient);
    State state = noPortRequest.complete(locations);
    assertValidState(state, locations);
}
Also used : GetRelatedFilesRequestImpl(org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl) State(org.codice.alliance.nsili.common.UCO.State) NameListHolder(org.codice.alliance.nsili.common.UCO.NameListHolder) Test(org.junit.Test)

Example 2 with State

use of org.codice.alliance.nsili.common.UCO.State in project alliance by codice.

the class GetRelatedFilesRequestImplTest method testComplete204.

@Test
public void testComplete204() throws Exception {
    when(mockHttpClient.execute(any(HttpUriRequest.class))).thenReturn(getGoodResponse(204));
    NameListHolder locations = new NameListHolder();
    State state = relatedFilesRequest.complete(locations);
    assertValidState(state, locations);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) State(org.codice.alliance.nsili.common.UCO.State) NameListHolder(org.codice.alliance.nsili.common.UCO.NameListHolder) Test(org.junit.Test)

Example 3 with State

use of org.codice.alliance.nsili.common.UCO.State in project alliance by codice.

the class GetRelatedFilesRequestImplTest method testCompleteBadStatus.

@Test
public void testCompleteBadStatus() throws Exception {
    when(mockHttpClient.execute(any(HttpUriRequest.class))).thenReturn(getBadResponse());
    NameListHolder locations = new NameListHolder();
    State state = relatedFilesRequest.complete(locations);
    assertValidStateNoLocs(state, locations);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) State(org.codice.alliance.nsili.common.UCO.State) NameListHolder(org.codice.alliance.nsili.common.UCO.NameListHolder) Test(org.junit.Test)

Example 4 with State

use of org.codice.alliance.nsili.common.UCO.State in project alliance by codice.

the class GetRelatedFilesRequestImplTest method testComplete200.

@Test
public void testComplete200() throws Exception {
    when(mockHttpClient.execute(any(HttpUriRequest.class))).thenReturn(getGoodResponse(200));
    NameListHolder locations = new NameListHolder();
    State state = relatedFilesRequest.complete(locations);
    assertValidState(state, locations);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) State(org.codice.alliance.nsili.common.UCO.State) NameListHolder(org.codice.alliance.nsili.common.UCO.NameListHolder) Test(org.junit.Test)

Example 5 with State

use of org.codice.alliance.nsili.common.UCO.State in project alliance by codice.

the class GetRelatedFilesRequestImplTest method testNotThumbnailType.

@Test
public void testNotThumbnailType() throws Exception {
    NameListHolder locations = new NameListHolder();
    GetRelatedFilesRequestImpl noPortRequest = new GetRelatedFilesRequestImpl(getBadMetacards(), getTestFileLocation(), "OVERVIEW", null);
    noPortRequest.setHttpClient(mockHttpClient);
    State state = noPortRequest.complete(locations);
    assertValidStateNoLocs(state, locations);
}
Also used : GetRelatedFilesRequestImpl(org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl) State(org.codice.alliance.nsili.common.UCO.State) NameListHolder(org.codice.alliance.nsili.common.UCO.NameListHolder) Test(org.junit.Test)

Aggregations

NameListHolder (org.codice.alliance.nsili.common.UCO.NameListHolder)9 State (org.codice.alliance.nsili.common.UCO.State)9 Test (org.junit.Test)9 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)5 GetRelatedFilesRequestImpl (org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl)4 FileLocation (org.codice.alliance.nsili.common.UCO.FileLocation)1