Skip to content

Commit

Permalink
BXC-3284 fix ID and start on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharon Luong committed Nov 16, 2023
1 parent b9d0007 commit 471b27c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void getMetadata(String id, OutputStream outStream,
ImageService3 respData = iiifReader.readValue(httpResp.getEntity().getContent());
var iiifWriter = new ObjectMapper().writerFor(ImageService3.class);

respData.setID(new URI(URIUtil.join(baseIiifv3Path, id, "info.json")));
respData.setID(new URI(URIUtil.join(baseIiifv3Path, id)));

HttpEntity updatedRespData = EntityBuilder.create()
.setText(iiifWriter.writeValueAsString(respData))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
package edu.unc.lib.boxc.web.services.rest;

import edu.unc.lib.boxc.auth.api.models.AccessGroupSet;
import edu.unc.lib.boxc.auth.api.services.AccessControlService;
import edu.unc.lib.boxc.auth.fcrepo.models.AccessGroupSetImpl;
import edu.unc.lib.boxc.web.services.processing.ImageServerProxyService;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.mockito.InjectMocks;
import org.mockito.Mock;

import static org.mockito.MockitoAnnotations.openMocks;

/**
* @author snluong
*/
public class ImageProxyServerControllerTest {
private static final String IMAGE_SERVER_PROXY_PATH = "http://cantaloupe.com/iiif/v3/";
private static final String BASE_IIIF_V3_PATH = "http://example.com/iiif/v3/";
private final static String USERNAME = "test_user";
private final static AccessGroupSet GROUPS = new AccessGroupSetImpl("adminGroup");
private AutoCloseable closeable;
private ImageServerProxyService imageServerProxyService;

@InjectMocks
private ImageServerProxyController imageServerProxyController;
@Mock
private AccessControlService accessControlService;


@BeforeEach
public void setup() {
closeable = openMocks(this);
imageServerProxyService = new ImageServerProxyService();
imageServerProxyService.setImageServerProxyBasePath(IMAGE_SERVER_PROXY_PATH);
imageServerProxyService.setBaseIiifv3Path(BASE_IIIF_V3_PATH);
}

@AfterEach
void closeService() throws Exception {
closeable.close();
}
}

0 comments on commit 471b27c

Please sign in to comment.