Search in sources :

Example 1 with NameListHolder

use of org.codice.alliance.nsili.common.UCO.NameListHolder 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 NameListHolder

use of org.codice.alliance.nsili.common.UCO.NameListHolder 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 NameListHolder

use of org.codice.alliance.nsili.common.UCO.NameListHolder 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 NameListHolder

use of org.codice.alliance.nsili.common.UCO.NameListHolder 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 NameListHolder

use of org.codice.alliance.nsili.common.UCO.NameListHolder 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)10 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)2 GetRelatedFilesRequest (org.codice.alliance.nsili.common.GIAS.GetRelatedFilesRequest)1 NameValue (org.codice.alliance.nsili.common.UCO.NameValue)1 Product (org.codice.alliance.nsili.common.UID.Product)1 Any (org.omg.CORBA.Any)1