target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test(expected = RecordNotExistsException.class) public void exceptionShouldBeThrowForRecordWithoutRepresentations() throws RecordNotExistsException, ProviderNotExistsException { recordsResource.getRecord(null, PROVIDER_ID, LOCAL_ID_FOR_RECORD_WITHOUT_REPRESENTATIONS); } | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException { final String cloudId = fi... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... |
@Test public void properRecordShouldBeReturned() throws RecordNotExistsException, ProviderNotExistsException { HttpServletRequest info = mockHttpServletRequest(); Record record = recordsResource.getRecord(info, PROVIDER_ID, LOCAL_ID_FOR_EXISTING_RECORD); Assert.assertNotNull(record); for (Representation representation ... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException { final String cloudId = fi... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... | SimplifiedRecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) public @ResponseBody Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String providerId, @PathVariable String localId) throws RecordNotExistsException, ProviderNotExistsException... |
@Test @Parameters(method = "mimeTypes") public void testGetRepresentationVersion(MediaType mediaType) throws Exception { Representation expected = new Representation(representation); URITools.enrich(expected, getBaseUri()); when(recordService.getRepresentation(globalId, schema, version)).thenReturn(new Representation(r... | @GetMapping(value = REPRESENTATION_VERSION, produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public @ResponseBody Repr... | RepresentationVersionResource { @GetMapping(value = REPRESENTATION_VERSION, produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', r... | RepresentationVersionResource { @GetMapping(value = REPRESENTATION_VERSION, produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', r... | RepresentationVersionResource { @GetMapping(value = REPRESENTATION_VERSION, produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', r... | RepresentationVersionResource { @GetMapping(value = REPRESENTATION_VERSION, produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', r... |
@Test public void testDeleteRepresentation() throws Exception { mockMvc.perform(delete(URITools.getVersionPath(globalId, schema, version))) .andExpect(status().isNoContent()); verify(recordService, times(1)).deleteRepresentation(globalId, schema, version); verifyNoMoreInteractions(recordService); } | @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentation( @PathVariable String cloudI... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... |
@Test @Parameters(method = "errors") public void testDeleteRepresentationReturns404IfRecordOrRepresentationDoesNotExists(Throwable exception, String errorCode, int statusCode) throws Exception { Mockito.doThrow(exception).when(recordService).deleteRepresentation(globalId, schema, version); ResultActions response = mock... | @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentation( @PathVariable String cloudI... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... | RepresentationVersionResource { @DeleteMapping(value = REPRESENTATION_VERSION) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', delete)") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRepresentat... |
@Test public void shouldReturnTheExpectedCountStatement() { assertEquals(EXPECTED_COUNT_STATEMENT, CQLBuilder.getMatchCountStatementFromTargetTable(SOURCE_TABLE, primaryKeys)); } | public static String getMatchCountStatementFromTargetTable(String targetTableName, List<String> names) { String wherePart = getStringWherePart(names); StringBuilder selectStatementFromTargetTableBuilder = new StringBuilder(); selectStatementFromTargetTableBuilder.append("Select count(*) from ").append(targetTableName).... | CQLBuilder { public static String getMatchCountStatementFromTargetTable(String targetTableName, List<String> names) { String wherePart = getStringWherePart(names); StringBuilder selectStatementFromTargetTableBuilder = new StringBuilder(); selectStatementFromTargetTableBuilder.append("Select count(*) from ").append(targ... | CQLBuilder { public static String getMatchCountStatementFromTargetTable(String targetTableName, List<String> names) { String wherePart = getStringWherePart(names); StringBuilder selectStatementFromTargetTableBuilder = new StringBuilder(); selectStatementFromTargetTableBuilder.append("Select count(*) from ").append(targ... | CQLBuilder { public static String getMatchCountStatementFromTargetTable(String targetTableName, List<String> names) { String wherePart = getStringWherePart(names); StringBuilder selectStatementFromTargetTableBuilder = new StringBuilder(); selectStatementFromTargetTableBuilder.append("Select count(*) from ").append(targ... | CQLBuilder { public static String getMatchCountStatementFromTargetTable(String targetTableName, List<String> names) { String wherePart = getStringWherePart(names); StringBuilder selectStatementFromTargetTableBuilder = new StringBuilder(); selectStatementFromTargetTableBuilder.append("Select count(*) from ").append(targ... |
@Test public void testPersistRepresentation() throws Exception { when(recordService.persistRepresentation(globalId, schema, version)).thenReturn( new Representation(representation)); mockMvc.perform(post(persistPath).contentType(MediaType.APPLICATION_FORM_URLENCODED)) .andExpect(status().isCreated()) .andExpect(header(... | @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletRequest httpServletRequest, @Path... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... |
@Test @Parameters(method = "persistErrors") public void testPersistRepresentationReturns40XIfExceptionOccur(Throwable exception, String errorCode, int statusCode) throws Exception { when(recordService.persistRepresentation(globalId, schema, version)).thenThrow(exception); ResultActions response = mockMvc.perform(post(p... | @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletRequest httpServletRequest, @Path... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_PERSIST) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', write)") public ResponseEntity<Void> persistRepresentation( HttpServletR... |
@Test public void testCopyRepresentation() throws Exception { when(recordService.copyRepresentation(globalId, schema, version)) .thenReturn(new Representation(representation)); mockMvc.perform(post(copyPath).contentType(MediaType.APPLICATION_FORM_URLENCODED)) .andExpect(status().isCreated()) .andExpect(header().string(... | @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest httpServletRequest, @PathVariabl... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... |
@Test @Parameters(method = "errors") public void testCopyRepresentationReturns404IfRepresentationOrRecordOrVersionDoesNotExists(Throwable exception, String errorCode, int statusCode) throws Exception { when(recordService.copyRepresentation(globalId, schema, version)).thenThrow(exception); ResultActions response = mockM... | @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest httpServletRequest, @PathVariabl... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... | RepresentationVersionResource { @PostMapping(value = REPRESENTATION_VERSION_COPY) @PreAuthorize("hasPermission(#cloudId.concat('/').concat(#representationName).concat('/').concat(#version)," + " 'eu.europeana.cloud.common.model.Representation', read)") public ResponseEntity<Void> copyRepresentation( HttpServletRequest ... |
@Test @Parameters(method = "mimeTypes") public void getRecord(MediaType mediaType) throws Exception { String globalId = "global1"; Record record = new Record(globalId, Lists.newArrayList(new Representation(globalId, "DC", "1", null, null, "FBC", Lists.newArrayList(new File("dc.xml", "text/xml", "91162629d258a876ee994e9... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServletRequest, record);... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... |
@Test public void getRecordReturns404IfRecordDoesNotExists() throws Exception { String globalId = "global1"; Throwable exception = new RecordNotExistsException(); when(recordService.getRecord(globalId)).thenThrow(exception); mockMvc.perform(get("/records/" + globalId).contentType(MediaType.APPLICATION_XML)) .andExpect(... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServletRequest, record);... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... | RecordsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public Record getRecord( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { Record record = recordService.getRecord(cloudId); prepare(httpServle... |
@Test public void deleteRecord() throws Exception { String globalId = "global1"; mockMvc.perform(delete("/records/" + globalId)) .andExpect(status().isNoContent()); verify(recordService, times(1)).deleteRecord(globalId); verifyNoMoreInteractions(recordService); } | @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } } | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... |
@Test public void deleteRecordReturns404IfRecordDoesNotExists() throws Exception { String globalId = "global1"; Throwable exception = new RecordNotExistsException(); Mockito.doThrow(exception).when(recordService).deleteRecord(globalId); mockMvc.perform(delete("/records/" + globalId).contentType(MediaType.APPLICATION_XM... | @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } } | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... |
@Test public void deleteRecordReturns404IfRecordHasNoRepresentations() throws Exception { String globalId = "global1"; Throwable exception = new RepresentationNotExistsException(); Mockito.doThrow(exception).when(recordService).deleteRecord(globalId); mockMvc.perform(delete("/records/" + globalId).contentType(MediaType... | @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } } | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... | RecordsResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRecord( @PathVariable String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { recordService.deleteRecord(cloudId); } RecordsResource(RecordService recordService); ... |
@Test public void shouldCreateDataset() throws Exception { Mockito.doReturn(new DataProvider()).when(uisHandler) .getProvider("provId"); String datasetId = "datasetId"; String description = "dataset description"; ResultActions createResponse = mockMvc.perform(post(dataSetsWebTarget, "provId").contentType(MediaType.APPL... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResultSlice<DataSet> getDataSets( @PathVariable String providerId, @RequestParam(required = false) String startFrom) { return dataSetService.getDataSets(providerId, startFrom, numberOfElementsOnPage); } | DataSetsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResultSlice<DataSet> getDataSets( @PathVariable String providerId, @RequestParam(required = false) String startFrom) { return dataSetService.getDataSets(providerId, startFrom, numberOfElem... | DataSetsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResultSlice<DataSet> getDataSets( @PathVariable String providerId, @RequestParam(required = false) String startFrom) { return dataSetService.getDataSets(providerId, startFrom, numberOfElem... | DataSetsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResultSlice<DataSet> getDataSets( @PathVariable String providerId, @RequestParam(required = false) String startFrom) { return dataSetService.getDataSets(providerId, startFrom, numberOfElem... | DataSetsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResultSlice<DataSet> getDataSets( @PathVariable String providerId, @RequestParam(required = false) String startFrom) { return dataSetService.getDataSets(providerId, startFrom, numberOfElem... |
@Test public void shouldSuccessfullyMigrateData() { MigrationExecutor migrator = new MigrationExecutor(EmbeddedCassandra.KEYSPACE, contactPoint, EmbeddedCassandra.PORT, cassandraUsername, cassandraPassword, scriptsLocations); migrator.migrate(); validateMigration(); List<String> cloudIds = getCloudIds(session.execute("... | public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... |
@Test public void shouldNotCreateTwoDatasetsWithSameId() throws Exception { Mockito.doReturn(new DataProvider()).when(uisHandler) .getProvider("provId"); String dataSetId = "dataset"; dataSetService.createDataSet("provId", dataSetId, ""); ResultActions createResponse = mockMvc.perform(post(dataSetsWebTarget, "provId") ... | @PreAuthorize("isAuthenticated()") @PostMapping public ResponseEntity<Void> createDataSet( HttpServletRequest httpServletRequest, @PathVariable String providerId, @RequestParam String dataSetId, @RequestParam(required = false) String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { DataSe... | DataSetsResource { @PreAuthorize("isAuthenticated()") @PostMapping public ResponseEntity<Void> createDataSet( HttpServletRequest httpServletRequest, @PathVariable String providerId, @RequestParam String dataSetId, @RequestParam(required = false) String description) throws ProviderNotExistsException, DataSetAlreadyExist... | DataSetsResource { @PreAuthorize("isAuthenticated()") @PostMapping public ResponseEntity<Void> createDataSet( HttpServletRequest httpServletRequest, @PathVariable String providerId, @RequestParam String dataSetId, @RequestParam(required = false) String description) throws ProviderNotExistsException, DataSetAlreadyExist... | DataSetsResource { @PreAuthorize("isAuthenticated()") @PostMapping public ResponseEntity<Void> createDataSet( HttpServletRequest httpServletRequest, @PathVariable String providerId, @RequestParam String dataSetId, @RequestParam(required = false) String description) throws ProviderNotExistsException, DataSetAlreadyExist... | DataSetsResource { @PreAuthorize("isAuthenticated()") @PostMapping public ResponseEntity<Void> createDataSet( HttpServletRequest httpServletRequest, @PathVariable String providerId, @RequestParam String dataSetId, @RequestParam(required = false) String description) throws ProviderNotExistsException, DataSetAlreadyExist... |
@Test @Parameters(method = "mimeTypes") public void getRepresentationByRevisionResponse(MediaType mediaType) throws Exception { RepresentationRevisionResponse representationRevisionResponse = new RepresentationRevisionResponse(representationResponse); ArrayList<File> files = new ArrayList<>(1); files.add(new File("1.xm... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVariable String revisionName, @Reques... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... |
@Test public void getRepresentationByRevisionsThrowExceptionWhenReturnsEmptyObjectIfRevisionDoesNotExists() throws Exception { List<RepresentationRevisionResponse> expectedResponse = new ArrayList<>(); expectedResponse.add(new RepresentationRevisionResponse()); doReturn(expectedResponse).when(recordService).getRepresen... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVariable String revisionName, @Reques... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... |
@Test public void getRepresentationByRevisionsThrowExceptionWhenReturnsRepresentationRevisionResponseIsNull() throws Exception { when(recordService.getRepresentationRevisions(globalId, schema, revisionProviderId, revisionName, null)).thenReturn(null); mockMvc.perform(get(URITools.getRepresentationRevisionsPath(globalId... | @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVariable String revisionName, @Reques... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... | RepresentationRevisionsResource { @GetMapping(produces = {MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public RepresentationsListWrapper getRepresentationRevisions( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @PathVar... |
@Test @Parameters(method = "mimeTypes") public void getRepresentation(MediaType mediaType) throws Exception { Representation expected = new Representation(representation); expected.setUri(URITools.getVersionUri(getBaseUri(), globalId, schema, version)); expected.setAllVersionsUri(URITools.getAllVersionsUri(getBaseUri()... | @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") @ResponseBody public R... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... |
@Test @Parameters(method = "representationErrors") public void getRepresentationReturns404IfRepresentationOrRecordDoesNotExists(Throwable exception, String errorCode) throws Exception { when(recordService.getRepresentation(globalId, schema)).thenThrow(exception); ResultActions response = mockMvc.perform(get(URITools.ge... | @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")") @ResponseBody public R... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... | RepresentationResource { @GetMapping(produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @PostAuthorize("hasPermission" + "( " + " (#cloudId).concat('/').concat(#representationName).concat('/').concat(returnObject.version) ," + " 'eu.europeana.cloud.common.model.Representation', read" + ")... |
@Test public void deleteRecord() throws Exception { mockMvc.perform(delete(URITools.getRepresentationPath(globalId, schema))) .andExpect(status().isNoContent()); verify(recordService, times(1)).deleteRepresentation(globalId, schema); verifyNoMoreInteractions(recordService); } | @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representationName); } | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... |
@Test @Parameters(method = "representationErrors") public void deleteRepresentationReturns404IfRecordOrRepresentationDoesNotExists(Throwable exception, String errorCode) throws Exception { Mockito.doThrow(exception).when(recordService).deleteRepresentation(globalId, schema); ResultActions response = mockMvc.perform(del... | @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representationName); } | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... | RepresentationResource { @DeleteMapping @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ROLE_ADMIN')") public void deleteRepresentation( @PathVariable String cloudId, @PathVariable String representationName) throws RepresentationNotExistsException { recordService.deleteRepresentation(cloudId, representat... |
@Test public void createRepresentation() throws Exception { when(recordService.createRepresentation(globalId, schema, providerID)).thenReturn( new Representation(representation)); mockMvc.perform(post(URITools.getRepresentationPath(globalId, schema)) .contentType(MediaType.APPLICATION_FORM_URLENCODED) .param(ParamConst... | @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String providerId) throws RecordNotExist... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... |
@Test @Parameters(method = "recordErrors") public void createRepresentationReturns404IfRecordOrRepresentationDoesNotExists(Throwable exception, String errorCode) throws Exception { Mockito.doThrow(exception).when(recordService).createRepresentation(globalId, schema, providerID); ResultActions response = mockMvc.perform... | @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String providerId) throws RecordNotExist... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... | RepresentationResource { @PostMapping(consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) @PreAuthorize("isAuthenticated()") public ResponseEntity<Void> createRepresentation( HttpServletRequest httpServletRequest, @PathVariable String cloudId, @PathVariable String representationName, @RequestParam String provider... |
@Test public void shouldThrowExceptionOnTwiceDataMigrations() { MigrationExecutor migrator = new MigrationExecutor(EmbeddedCassandra.KEYSPACE, contactPoint, EmbeddedCassandra.PORT, cassandraUsername, cassandraPassword, scriptsLocations); migrator.migrate(); migrator.migrate(); List<String> cloudIds = getCloudIds(sessio... | public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... |
@Test public void shouldReadAndReturnTaskIdsForCSVFile() throws IOException { List<RevisionInformation> taskIds = csvReader.getRevisionsInformation(Paths.get("src/test/resources/revisions.csv").toString()); assertNotNull(taskIds); assertEquals(8, taskIds.size()); } | @Override public List<RevisionInformation> getRevisionsInformation(String filePath) throws IOException { List<RevisionInformation> revisionInformationList = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { String line = ""; br.readLine(); while ((line = br.readLine()) != null)... | CSVReader implements RevisionsReader { @Override public List<RevisionInformation> getRevisionsInformation(String filePath) throws IOException { List<RevisionInformation> revisionInformationList = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { String line = ""; br.readLine();... | CSVReader implements RevisionsReader { @Override public List<RevisionInformation> getRevisionsInformation(String filePath) throws IOException { List<RevisionInformation> revisionInformationList = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { String line = ""; br.readLine();... | CSVReader implements RevisionsReader { @Override public List<RevisionInformation> getRevisionsInformation(String filePath) throws IOException { List<RevisionInformation> revisionInformationList = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { String line = ""; br.readLine();... | CSVReader implements RevisionsReader { @Override public List<RevisionInformation> getRevisionsInformation(String filePath) throws IOException { List<RevisionInformation> revisionInformationList = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { String line = ""; br.readLine();... |
@Test @Parameters(method = "mimeTypes") public void getRepresentations(MediaType mediaType) throws Exception { Record expected = new Record(record); Representation expectedRepresentation = expected.getRepresentations().get(0); expectedRepresentation.setUri(URITools.getVersionUri(getBaseUri(), globalId, schema, version)... | @GetMapping(produces = {MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @ResponseBody public RepresentationsListWrapper getRepresentations( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { List<Representation> representationInfos = recordService.getRecord(cl... | RepresentationsResource { @GetMapping(produces = {MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @ResponseBody public RepresentationsListWrapper getRepresentations( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { List<Representation> representationInfos = ... | RepresentationsResource { @GetMapping(produces = {MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @ResponseBody public RepresentationsListWrapper getRepresentations( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { List<Representation> representationInfos = ... | RepresentationsResource { @GetMapping(produces = {MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @ResponseBody public RepresentationsListWrapper getRepresentations( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { List<Representation> representationInfos = ... | RepresentationsResource { @GetMapping(produces = {MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @ResponseBody public RepresentationsListWrapper getRepresentations( HttpServletRequest httpServletRequest, @PathVariable String cloudId) throws RecordNotExistsException { List<Representation> representationInfos = ... |
@Test @Parameters({ "example_metadata.xml, application/xml", "example_jpg2000.jp2, image/jp2" }) public void shouldProperlyGuessMimeType_Xml(String fileName, String expectedMimeType) throws IOException { URL resource = Resources.getResource(fileName); byte[] expected = Resources.toByteArray(resource); BufferedInputStre... | public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) { throw new UnsupportedOperationException("InputStream marking support is required!"); } return new AutoDetectParser().getDetector().detect(inputStream, new Metadata()); } | ContentStreamDetector { public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) { throw new UnsupportedOperationException("InputStream marking support is required!"); } return new AutoDetectParser().getDetector().detect(inputStream, new Metadata()); } } | ContentStreamDetector { public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) { throw new UnsupportedOperationException("InputStream marking support is required!"); } return new AutoDetectParser().getDetector().detect(inputStream, new Metadata()); } priv... | ContentStreamDetector { public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) { throw new UnsupportedOperationException("InputStream marking support is required!"); } return new AutoDetectParser().getDetector().detect(inputStream, new Metadata()); } priv... | ContentStreamDetector { public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) { throw new UnsupportedOperationException("InputStream marking support is required!"); } return new AutoDetectParser().getDetector().detect(inputStream, new Metadata()); } priv... |
@Test @Parameters({ "example_metadata.xml, DATA_BASE, application/xml", "example_jpg2000.jp2, OBJECT_STORAGE, image/jp2" }) public void shouldDetectStorage(String fileName, String expectedDecision, String mediaType) throws IOException { URL resource = Resources.getResource(fileName); byte[] expected = Resources.toByteA... | public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } StorageSelector(final PreBufferedInputStream inputStream, final String userMediaType); } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } StorageSelector(final PreBufferedInputStream inputStream, final String userMediaType); Storage selectStorage(); } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } StorageSelector(final PreBufferedInputStream inputStream, final String userMediaType); Storage selectStorage(); } |
@Test(expected = BadRequestException.class) @Parameters({ "example_metadata.xml, image/jp2", "example_jpg2000.jp2, application/xml" }) public void shouldThrowBadRequestOnDifferentMimeTypeProvidedByUser(String fileName, String mediaType) throws IOException { URL resource = Resources.getResource(fileName); byte[] expecte... | public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } StorageSelector(final PreBufferedInputStream inputStream, final String userMediaType); } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } StorageSelector(final PreBufferedInputStream inputStream, final String userMediaType); Storage selectStorage(); } | StorageSelector { public Storage selectStorage() { return decide(assertUserMediaType(), getAvailable()); } StorageSelector(final PreBufferedInputStream inputStream, final String userMediaType); Storage selectStorage(); } |
@Test @Parameters({ "10, 20", "20, 10", "10, 10000", "10000, 20", "10000, 3000", "10000, 4000", "10, 20", "20, 10" }) public void shouldProperlyCheckAvailableForByteArrayInputStream(int size, int bufferSize) throws IOException { byte[] expected = Helper.generateRandom(size); ByteArrayInputStream inputStream = new ByteA... | @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avail; } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... |
@Test @Parameters({ "10, example_metadata.xml", "200, example_metadata.xml", "2000, example_metadata.xml", "3000, example_metadata.xml", "10, example_jpg2000.jp2", "2000, example_jpg2000.jp2", "3000, example_jpg2000.jp2" }) public void shouldProperlyCheckAvailableForFile(final int bufferSize, final String fileName) thr... | @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avail; } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int available() throws IOException { ensureIsNotClosed(); int inBufferAvailable = bufferFill - position; int avail = super.available(); return inBufferAvailable > (Integer.MAX_VALUE - avail) ? Integer.MAX_VALUE : inBufferAvailable + avai... |
@Test @Parameters({ "10, 20", "200, 10", "100, 10000", "100, 200", "200, 100" }) public void shouldReadStreamPerByte(int size, int bufferSize) throws IOException { byte[] randomByes = Helper.generateSeq(size); ByteArrayInputStream inputStream = new ByteArrayInputStream(randomByes); PreBufferedInputStream instance = new... | @Override public synchronized int read() throws IOException { ensureIsNotClosed(); if (position < bufferFill) { return buffer[position++] & 0xff; } return super.read(); } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int read() throws IOException { ensureIsNotClosed(); if (position < bufferFill) { return buffer[position++] & 0xff; } return super.read(); } } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int read() throws IOException { ensureIsNotClosed(); if (position < bufferFill) { return buffer[position++] & 0xff; } return super.read(); } PreBufferedInputStream(InputStream stream, int bufferSize); } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int read() throws IOException { ensureIsNotClosed(); if (position < bufferFill) { return buffer[position++] & 0xff; } return super.read(); } PreBufferedInputStream(InputStream stream, int bufferSize); static PreBufferedInputStream wrap(f... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized int read() throws IOException { ensureIsNotClosed(); if (position < bufferFill) { return buffer[position++] & 0xff; } return super.read(); } PreBufferedInputStream(InputStream stream, int bufferSize); static PreBufferedInputStream wrap(f... |
@Test public void shouldCloseClosedStream() throws IOException { PreBufferedInputStream instance = new PreBufferedInputStream(new NullInputStream(1), 1); instance.close(); instance.close(); } | @Override public synchronized void close() throws IOException { if (in == null && buffer == null) { return; } buffer = null; in.close(); in = null; } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized void close() throws IOException { if (in == null && buffer == null) { return; } buffer = null; in.close(); in = null; } } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized void close() throws IOException { if (in == null && buffer == null) { return; } buffer = null; in.close(); in = null; } PreBufferedInputStream(InputStream stream, int bufferSize); } | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized void close() throws IOException { if (in == null && buffer == null) { return; } buffer = null; in.close(); in = null; } PreBufferedInputStream(InputStream stream, int bufferSize); static PreBufferedInputStream wrap(final byte[] data,
... | PreBufferedInputStream extends BufferedInputStream { @Override public synchronized void close() throws IOException { if (in == null && buffer == null) { return; } buffer = null; in.close(); in = null; } PreBufferedInputStream(InputStream stream, int bufferSize); static PreBufferedInputStream wrap(final byte[] data,
... |
@Test public void shouldCreateDataSet() throws Exception { makeUISProviderSuccess(); String dsName = "ds"; String description = "description of data set"; DataSet ds = cassandraDataSetService.createDataSet(PROVIDER_ID, dsName, description); assertThat(ds.getId(), is(dsName)); assertThat(ds.getDescription(), is(descript... | @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException(); } DataSet ds = dataSetDAO.getDataSet(providerId, da... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... |
@Test(expected = DataSetNotExistsException.class) public void shouldNotAssignToNotExistingDataSet() throws Exception { makeUISProviderSuccess(); Representation r = insertDummyPersistentRepresentation("cloud-id", "schema", PROVIDER_ID); cassandraDataSetService.addAssignment(PROVIDER_ID, "not-existing", r.getCloudId(), r... | @Override public void addAssignment(String providerId, String dataSetId, String recordId, String schema, String version) throws DataSetNotExistsException, RepresentationNotExistsException { checkIfDatasetExists(dataSetId, providerId); Representation rep = getRepresentationIfExist(recordId, schema, version); if (!isAssi... | CassandraDataSetService implements DataSetService { @Override public void addAssignment(String providerId, String dataSetId, String recordId, String schema, String version) throws DataSetNotExistsException, RepresentationNotExistsException { checkIfDatasetExists(dataSetId, providerId); Representation rep = getRepresent... | CassandraDataSetService implements DataSetService { @Override public void addAssignment(String providerId, String dataSetId, String recordId, String schema, String version) throws DataSetNotExistsException, RepresentationNotExistsException { checkIfDatasetExists(dataSetId, providerId); Representation rep = getRepresent... | CassandraDataSetService implements DataSetService { @Override public void addAssignment(String providerId, String dataSetId, String recordId, String schema, String version) throws DataSetNotExistsException, RepresentationNotExistsException { checkIfDatasetExists(dataSetId, providerId); Representation rep = getRepresent... | CassandraDataSetService implements DataSetService { @Override public void addAssignment(String providerId, String dataSetId, String recordId, String schema, String version) throws DataSetNotExistsException, RepresentationNotExistsException { checkIfDatasetExists(dataSetId, providerId); Representation rep = getRepresent... |
@Test public void shouldSuccessfullyMigrateDataInUIS() { final String[] scriptsLocations1 = new String[]{"migrations/service/uis", "testMigrations/uis"}; MigrationExecutor migrator = new MigrationExecutor(EmbeddedCassandra.KEYSPACE, contactPoint, EmbeddedCassandra.PORT, cassandraUsername, cassandraPassword, scriptsLoca... | public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... |
@Test(expected = DataSetNotExistsException.class) public void shouldThrowExceptionWhenDeletingNotExistingDataSet() throws Exception { cassandraDataSetService.deleteDataSet("xxx", "xxx"); } | @Override public void deleteDataSet(String providerId, String dataSetId) throws DataSetNotExistsException { checkIfDatasetExists(dataSetId, providerId); String nextToken = null; int maxSize = 10000; List<Properties> representations = dataSetDAO.listDataSet(providerId, dataSetId, null, maxSize); for (Properties represen... | CassandraDataSetService implements DataSetService { @Override public void deleteDataSet(String providerId, String dataSetId) throws DataSetNotExistsException { checkIfDatasetExists(dataSetId, providerId); String nextToken = null; int maxSize = 10000; List<Properties> representations = dataSetDAO.listDataSet(providerId,... | CassandraDataSetService implements DataSetService { @Override public void deleteDataSet(String providerId, String dataSetId) throws DataSetNotExistsException { checkIfDatasetExists(dataSetId, providerId); String nextToken = null; int maxSize = 10000; List<Properties> representations = dataSetDAO.listDataSet(providerId,... | CassandraDataSetService implements DataSetService { @Override public void deleteDataSet(String providerId, String dataSetId) throws DataSetNotExistsException { checkIfDatasetExists(dataSetId, providerId); String nextToken = null; int maxSize = 10000; List<Properties> representations = dataSetDAO.listDataSet(providerId,... | CassandraDataSetService implements DataSetService { @Override public void deleteDataSet(String providerId, String dataSetId) throws DataSetNotExistsException { checkIfDatasetExists(dataSetId, providerId); String nextToken = null; int maxSize = 10000; List<Properties> representations = dataSetDAO.listDataSet(providerId,... |
@Test(expected = ProviderNotExistsException.class) public void shouldThrowExceptionWhenCreatingDatasetForNotExistingProvider() throws Exception { makeUISProviderFailure(); cassandraDataSetService.createDataSet("not-existing-provider", "ds", "description"); } | @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException(); } DataSet ds = dataSetDAO.getDataSet(providerId, da... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... |
@Test(expected = DataSetAlreadyExistsException.class) public void shouldNotCreateTwoDatasetsWithSameNameForProvider() throws Exception { String dsName = "ds"; makeUISProviderSuccess(); cassandraDataSetService .createDataSet(PROVIDER_ID, dsName, "description"); cassandraDataSetService.createDataSet(PROVIDER_ID, dsName, ... | @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException(); } DataSet ds = dataSetDAO.getDataSet(providerId, da... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... | CassandraDataSetService implements DataSetService { @Override public DataSet createDataSet(String providerId, String dataSetId, String description) throws ProviderNotExistsException, DataSetAlreadyExistsException { Date now = new Date(); if (uis.getProvider(providerId) == null) { throw new ProviderNotExistsException();... |
@Test(expected = DataSetNotExistsException.class) public void shouldThrowExceptionWhenRequestingCloudIdsForNonExistingDataSet() throws Exception { makeUISProviderExistsSuccess(); cassandraDataSetService.getDataSetCloudIdsByRepresentationPublished("non-existent-ds", "provider", "representation", new Date(), null, 1); } | @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, DataSetNotExistsException { validateRequest(dataSetId, p... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... |
@Test(expected = ProviderNotExistsException.class) public void shouldThrowExceptionWhenRequestingCloudIdsForNonExistingProvider() throws Exception { makeUISProviderExistsFailure(); cassandraDataSetService.getDataSetCloudIdsByRepresentationPublished("ds", "non-existent-provider", "representation", new Date(), null, 1); ... | @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, DataSetNotExistsException { validateRequest(dataSetId, p... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationPublished(String dataSetId, String providerId, String representationName, Date dateFrom, String startFrom, int numberOfElementsPerPage) throws ProviderNotExistsException, Data... |
@Test public void shouldReturnTheLatestCloudIdsAndTimeStampInsideRevisionDataSet() throws Exception { int size = 10; prepareTestForTheLatestCloudIdAndTimeStampInsideDataSet(size); ResultSlice<CloudIdAndTimestampResponse> cloudIdsAndTimestampResponseResultSlice = cassandraDataSetService.getLatestDataSetCloudIdByRepresen... | @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOfElementsPerPage) throws ProviderNotExistsException, ... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... |
@Test public void shouldReturnTheLatestCloudIdsAndTimeStampInsideRevisionDataSetWhenIsMarkedDeleted() throws Exception { int size = 10; prepareTestForTheLatestCloudIdAndTimeStampInsideDataSet(size); ResultSlice<CloudIdAndTimestampResponse> cloudIdsAndTimestampResponseResultSlice = cassandraDataSetService.getLatestDataS... | @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOfElementsPerPage) throws ProviderNotExistsException, ... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... |
@Test public void shouldReturnTheLatestCloudIdsAndTimeStampInsideRevisionDataSetBatchByBatch() throws Exception { int size = 10; prepareTestForTheLatestCloudIdAndTimeStampInsideDataSet(size); ResultSlice<CloudIdAndTimestampResponse> cloudIdsAndTimestampResponseResultSlice = cassandraDataSetService.getLatestDataSetCloud... | @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOfElementsPerPage) throws ProviderNotExistsException, ... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... |
@Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistedException() throws Exception { int size = 10; prepareTestForTheLatestCloudIdAndTimeStampInsideDataSet(size); cassandraDataSetService.getLatestDataSetCloudIdByRepresentationAndRevision("Non_Existed_Dataset", PROVIDER_ID, REVISION, ... | @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOfElementsPerPage) throws ProviderNotExistsException, ... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... | CassandraDataSetService implements DataSetService { @Override public ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(String dataSetId, String providerId, String revisionName, String revisionProvider, String representationName, String startFrom, Boolean isDeleted, int numberOf... |
@Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsException() throws Exception { makeUISProviderSuccess(); makeUISSuccess(); makeDatasetExists(); Date date = new Date(); String cloudId = "2EEN23VWNXOW7LGLM6SKTDOZUBUOTKEWZ3IULSYEWEMERHISS6XA"; cassandraDataSetService.... | @Override public void deleteRevision(String cloudId, String representationName, String version, String revisionName, String revisionProviderId, Date revisionTimestamp) throws RepresentationNotExistsException { checkIfRepresentationExists(representationName, version, cloudId); Revision revision = new Revision(revisionNa... | CassandraDataSetService implements DataSetService { @Override public void deleteRevision(String cloudId, String representationName, String version, String revisionName, String revisionProviderId, Date revisionTimestamp) throws RepresentationNotExistsException { checkIfRepresentationExists(representationName, version, c... | CassandraDataSetService implements DataSetService { @Override public void deleteRevision(String cloudId, String representationName, String version, String revisionName, String revisionProviderId, Date revisionTimestamp) throws RepresentationNotExistsException { checkIfRepresentationExists(representationName, version, c... | CassandraDataSetService implements DataSetService { @Override public void deleteRevision(String cloudId, String representationName, String version, String revisionName, String revisionProviderId, Date revisionTimestamp) throws RepresentationNotExistsException { checkIfRepresentationExists(representationName, version, c... | CassandraDataSetService implements DataSetService { @Override public void deleteRevision(String cloudId, String representationName, String version, String revisionName, String revisionProviderId, Date revisionTimestamp) throws RepresentationNotExistsException { checkIfRepresentationExists(representationName, version, c... |
@Test public void shouldSuccessfullyMigrateDataInDPS() { final String[] scriptsLocations1 = new String[]{"migrations/service/dps", "testMigrations/dps"}; MigrationExecutor migrator = new MigrationExecutor(EmbeddedCassandra.KEYSPACE, contactPoint, EmbeddedCassandra.PORT, cassandraUsername, cassandraPassword, scriptsLoca... | public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } } | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... | MigrationExecutor { public void migrate() { CassandraMigration cm = new CassandraMigration(); cm.getConfigs().setScriptsLocations(scriptsLocations); cm.setKeyspace(keyspace); cm.migrate(); } MigrationExecutor(String cassandraKeyspace, String cassandraContactPoint, int cassandraPort, String cassandraUsername, String cas... |
@Test(expected = ContentDaoNotFoundException.class) public void shouldThrowExceptionOnNonExistingDAO() throws FileNotExistsException { final DynamicContentDAO instance = new DynamicContentDAO(prepareDAOMap( mock(SwiftContentDAO.class) )); instance.deleteContent("exampleFileName",Storage.DATA_BASE); } | public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } } | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } @Autowired DynamicContentDAO(Map<Storage,ContentDAO> contentDAOs); } | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } @Autowired DynamicContentDAO(Map<Storage,ContentDAO> contentDAOs); void copyContent(String sourceObjectId, String trgObjectId, Storage stored); void deleteCont... | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } @Autowired DynamicContentDAO(Map<Storage,ContentDAO> contentDAOs); void copyContent(String sourceObjectId, String trgObjectId, Storage stored); void deleteCont... |
@Test public void shouldProperlySelectDataBaseDeleteContent() throws FileNotExistsException { SwiftContentDAO daoMock = mock(SwiftContentDAO.class); final DynamicContentDAO instance = new DynamicContentDAO(prepareDAOMap(daoMock)); instance.deleteContent("exampleFileName",Storage.OBJECT_STORAGE); verify(daoMock).deleteC... | public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } } | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } @Autowired DynamicContentDAO(Map<Storage,ContentDAO> contentDAOs); } | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } @Autowired DynamicContentDAO(Map<Storage,ContentDAO> contentDAOs); void copyContent(String sourceObjectId, String trgObjectId, Storage stored); void deleteCont... | DynamicContentDAO { public void deleteContent(String fileName, Storage stored) throws FileNotExistsException { getContentDAO(stored).deleteContent(fileName); } @Autowired DynamicContentDAO(Map<Storage,ContentDAO> contentDAOs); void copyContent(String sourceObjectId, String trgObjectId, Storage stored); void deleteCont... |
@Test(expected = RecordNotExistsException.class) public void shouldThrowExpWhileCreatingRepresentationIfNoRecordInUis() throws Exception { makeUISThrowRecordNotExist(); mockUISProvider1Success(); cassandraRecordService.createRepresentation("globalId", "dc", PROVIDER_1_ID); } | @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(providerId)) == null) { throw new ProviderNotExistsExcept... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... |
@Test(expected = SystemException.class) public void shouldThrowSystemExpWhileCreatingRepresentationIfUisFails() throws Exception { mockUISProvider1Success(); makeUISThrowSystemException(); cassandraRecordService.createRepresentation("globalId", "dc", PROVIDER_1_ID); } | @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(providerId)) == null) { throw new ProviderNotExistsExcept... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... |
@Test(expected = RecordNotExistsException.class) public void shouldThrowExpWhileGettingRecordIfNoRecordInUis() throws Exception { makeUISThrowRecordNotExist(); cassandraRecordService.getRecord("globalId"); } | @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); } } else { throw new RecordNotExistsException(cloud... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... |
@Test(expected = SystemException.class) public void shouldThrowSystemExpWhileGettingRecordIfUisFails() throws Exception { makeUISThrowSystemException(); cassandraRecordService.getRecord("globalId"); } | @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); } } else { throw new RecordNotExistsException(cloud... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... | CassandraRecordService implements RecordService { @Override public Record getRecord(String cloudId) throws RecordNotExistsException { Record record = null; if (uis.existsCloudId(cloudId)) { record = recordDAO.getRecord(cloudId); if (record.getRepresentations().isEmpty()) { throw new RecordNotExistsException(cloudId); }... |
@Test(expected = RecordNotExistsException.class) public void shouldThrowExpWhileDeletingRecordIfNoRecordInUis() throws Exception { makeUISThrowRecordNotExist(); cassandraRecordService.deleteRecord("globalId"); } | @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRecordRepresentationsInAllVersions.isEmpty()) { thro... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... |
@Test(expected = SystemException.class) public void shouldThrowSystemExpWhileDeletingRecordIfUisFails() throws Exception { makeUISThrowSystemException(); cassandraRecordService.deleteRecord("globalId"); } | @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRecordRepresentationsInAllVersions.isEmpty()) { thro... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... |
@Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotFoundExpWhenNoSuchRepresentation() throws Exception { makeUISSuccess(); cassandraRecordService.getRepresentation("globalId", "not_existing_schema"); } | @Override public Representation getRepresentation(String globalId, String schema) throws RepresentationNotExistsException { Representation rep = recordDAO.getLatestPersistentRepresentation(globalId, schema); if (rep == null) { throw new RepresentationNotExistsException(); } else { return rep; } } | CassandraRecordService implements RecordService { @Override public Representation getRepresentation(String globalId, String schema) throws RepresentationNotExistsException { Representation rep = recordDAO.getLatestPersistentRepresentation(globalId, schema); if (rep == null) { throw new RepresentationNotExistsException(... | CassandraRecordService implements RecordService { @Override public Representation getRepresentation(String globalId, String schema) throws RepresentationNotExistsException { Representation rep = recordDAO.getLatestPersistentRepresentation(globalId, schema); if (rep == null) { throw new RepresentationNotExistsException(... | CassandraRecordService implements RecordService { @Override public Representation getRepresentation(String globalId, String schema) throws RepresentationNotExistsException { Representation rep = recordDAO.getLatestPersistentRepresentation(globalId, schema); if (rep == null) { throw new RepresentationNotExistsException(... | CassandraRecordService implements RecordService { @Override public Representation getRepresentation(String globalId, String schema) throws RepresentationNotExistsException { Representation rep = recordDAO.getLatestPersistentRepresentation(globalId, schema); if (rep == null) { throw new RepresentationNotExistsException(... |
@Test(expected = ProviderNotExistsException.class) public void shouldNotCreateRepresentationForNotExistingProvider() throws Exception { makeUISFailure(); makeUISProviderFailure(); cassandraRecordService.createRepresentation("globalId", "dc", "not-existing"); } | @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(providerId)) == null) { throw new ProviderNotExistsExcept... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... | CassandraRecordService implements RecordService { @Override public Representation createRepresentation(String cloudId, String representationName, String providerId) throws ProviderNotExistsException, RecordNotExistsException { Date now = new Date(); DataProvider dataProvider; if ((dataProvider = uis.getProvider(provide... |
@Test public void shouldRetrunNullString() { final String fileName = ""; final String output = migrator.nameConversion(fileName); assertEquals(null, output); } | @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } @Override String nameConversion(final String s); } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } @Override String nameConversion(final String s); } |
@Test(expected = RepresentationNotExistsException.class) public void shouldThrowExcWhenDeletingRecordHasNoRepresentations() throws Exception { makeUISSuccess(); mockUISProvider1Success(); cassandraRecordService.deleteRecord("globalId"); } | @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRecordRepresentationsInAllVersions.isEmpty()) { thro... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... | CassandraRecordService implements RecordService { @Override public void deleteRecord(String cloudId) throws RecordNotExistsException, RepresentationNotExistsException { if (uis.existsCloudId(cloudId)) { List<Representation> allRecordRepresentationsInAllVersions = recordDAO.listRepresentationVersions(cloudId); if (allRe... |
@Test public void shouldDeletePersistentRepresentation() throws Exception { makeUISSuccess(); mockUISProvider1Success(); Representation r = insertDummyPersistentRepresentation("globalId", "dc", PROVIDER_1_ID); cassandraRecordService.deleteRepresentation(r.getCloudId(), r.getRepresentationName(), r.getVersion()); } | @Override public void deleteRepresentation(String globalId, String schema) throws RepresentationNotExistsException { List<Representation> listRepresentations = recordDAO.listRepresentationVersions(globalId, schema); sortByProviderId(listRepresentations); String dPId = null; for (Representation rep : listRepresentations... | CassandraRecordService implements RecordService { @Override public void deleteRepresentation(String globalId, String schema) throws RepresentationNotExistsException { List<Representation> listRepresentations = recordDAO.listRepresentationVersions(globalId, schema); sortByProviderId(listRepresentations); String dPId = n... | CassandraRecordService implements RecordService { @Override public void deleteRepresentation(String globalId, String schema) throws RepresentationNotExistsException { List<Representation> listRepresentations = recordDAO.listRepresentationVersions(globalId, schema); sortByProviderId(listRepresentations); String dPId = n... | CassandraRecordService implements RecordService { @Override public void deleteRepresentation(String globalId, String schema) throws RepresentationNotExistsException { List<Representation> listRepresentations = recordDAO.listRepresentationVersions(globalId, schema); sortByProviderId(listRepresentations); String dPId = n... | CassandraRecordService implements RecordService { @Override public void deleteRepresentation(String globalId, String schema) throws RepresentationNotExistsException { List<Representation> listRepresentations = recordDAO.listRepresentationVersions(globalId, schema); sortByProviderId(listRepresentations); String dPId = n... |
@Test(expected = CannotModifyPersistentRepresentationException.class) public void shouldNotAddFileToPersistentRepresentation() throws Exception { makeUISSuccess(); mockUISProvider1Success(); Representation r = insertDummyPersistentRepresentation("globalId", "dc", PROVIDER_1_ID); byte[] dummyContent = {1, 2, 3}; File f ... | @Override public boolean putContent(String globalId, String schema, String version, File file, InputStream content) throws CannotModifyPersistentRepresentationException, RepresentationNotExistsException { DateTime now = new DateTime(); Representation representation = getRepresentation(globalId, schema, version); if (re... | CassandraRecordService implements RecordService { @Override public boolean putContent(String globalId, String schema, String version, File file, InputStream content) throws CannotModifyPersistentRepresentationException, RepresentationNotExistsException { DateTime now = new DateTime(); Representation representation = ge... | CassandraRecordService implements RecordService { @Override public boolean putContent(String globalId, String schema, String version, File file, InputStream content) throws CannotModifyPersistentRepresentationException, RepresentationNotExistsException { DateTime now = new DateTime(); Representation representation = ge... | CassandraRecordService implements RecordService { @Override public boolean putContent(String globalId, String schema, String version, File file, InputStream content) throws CannotModifyPersistentRepresentationException, RepresentationNotExistsException { DateTime now = new DateTime(); Representation representation = ge... | CassandraRecordService implements RecordService { @Override public boolean putContent(String globalId, String schema, String version, File file, InputStream content) throws CannotModifyPersistentRepresentationException, RepresentationNotExistsException { DateTime now = new DateTime(); Representation representation = ge... |
@Test(expected = CannotModifyPersistentRepresentationException.class) public void shouldNotRemoveFileFromPersistentRepresentation() throws Exception { makeUISSuccess(); mockUISProvider1Success(); Representation r = insertDummyPersistentRepresentation("globalId", "dc", PROVIDER_1_ID); File f = r.getFiles().get(0); cassa... | @Override public void deleteContent(String globalId, String schema, String version, String fileName) throws FileNotExistsException, CannotModifyPersistentRepresentationException, RepresentationNotExistsException { Representation representation = getRepresentation(globalId, schema, version); if (representation.isPersist... | CassandraRecordService implements RecordService { @Override public void deleteContent(String globalId, String schema, String version, String fileName) throws FileNotExistsException, CannotModifyPersistentRepresentationException, RepresentationNotExistsException { Representation representation = getRepresentation(global... | CassandraRecordService implements RecordService { @Override public void deleteContent(String globalId, String schema, String version, String fileName) throws FileNotExistsException, CannotModifyPersistentRepresentationException, RepresentationNotExistsException { Representation representation = getRepresentation(global... | CassandraRecordService implements RecordService { @Override public void deleteContent(String globalId, String schema, String version, String fileName) throws FileNotExistsException, CannotModifyPersistentRepresentationException, RepresentationNotExistsException { Representation representation = getRepresentation(global... | CassandraRecordService implements RecordService { @Override public void deleteContent(String globalId, String schema, String version, String fileName) throws FileNotExistsException, CannotModifyPersistentRepresentationException, RepresentationNotExistsException { Representation representation = getRepresentation(global... |
@Test public void addRevision() throws Exception { makeUISSuccess(); mockUISProvider1Success(); Representation r = cassandraRecordService.createRepresentation( "globalId", "edm", PROVIDER_1_ID); Revision revision = new Revision(REVISION_NAME, REVISION_PROVIDER); cassandraRecordService.addRevision(r.getCloudId(), r.getR... | @Override public void addRevision(String globalId, String schema, String version, Revision revision) throws RevisionIsNotValidException { recordDAO.addOrReplaceRevisionInRepresentation(globalId, schema, version, revision); } | CassandraRecordService implements RecordService { @Override public void addRevision(String globalId, String schema, String version, Revision revision) throws RevisionIsNotValidException { recordDAO.addOrReplaceRevisionInRepresentation(globalId, schema, version, revision); } } | CassandraRecordService implements RecordService { @Override public void addRevision(String globalId, String schema, String version, Revision revision) throws RevisionIsNotValidException { recordDAO.addOrReplaceRevisionInRepresentation(globalId, schema, version, revision); } } | CassandraRecordService implements RecordService { @Override public void addRevision(String globalId, String schema, String version, Revision revision) throws RevisionIsNotValidException { recordDAO.addOrReplaceRevisionInRepresentation(globalId, schema, version, revision); } @Override Record getRecord(String cloudId); ... | CassandraRecordService implements RecordService { @Override public void addRevision(String globalId, String schema, String version, Revision revision) throws RevisionIsNotValidException { recordDAO.addOrReplaceRevisionInRepresentation(globalId, schema, version, revision); } @Override Record getRecord(String cloudId); ... |
@Test public void getRevision() throws Exception { makeUISSuccess(); mockUISProvider1Success(); Representation r = cassandraRecordService.createRepresentation( "globalId", "edm", PROVIDER_1_ID); Revision revision = new Revision(REVISION_NAME, REVISION_PROVIDER, new Date(), true, false, true); cassandraRecordService.add... | @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : rep.getRevisions()) { if (revision != null) { if (Re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... |
@Test(expected = RepresentationNotExistsException.class) public void getRevisionFromNonExistedRepresentation() throws Exception { makeUISSuccess(); mockUISProvider1Success(); String revisionKey = RevisionUtils.getRevisionKey(REVISION_PROVIDER, REVISION_NAME, new Date().getTime()); cassandraRecordService.getRevision("gl... | @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : rep.getRevisions()) { if (revision != null) { if (Re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... | CassandraRecordService implements RecordService { @Override public Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RevisionNotExistsException, RepresentationNotExistsException { Representation rep = getRepresentation(globalId, schema, version); for (Revision revision : re... |
@Test @Parameters(method = "listDatasetParams") public void shouldListDataSet(String threshold, int limit, String nextSlice, int fromIndex, int toIndex) throws Exception { ResultSlice<Representation> actual = dataSetService.listDataSet(providerId, dataSetId, threshold, limit); assertThat("Next slice should be equal '" ... | @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representation> listOfAllStubs = dataSetDAO.listDataSet(provi... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... |
@Test public void shouldListEmptyDataSet() throws Exception { when(datasetDao.listDataSet(providerId, dataSetId)).thenReturn(new ArrayList<Representation>()); InMemoryRecordDAO recordDao = new InMemoryRecordListDAO(new ArrayList<Representation>()); dataSetService = new InMemoryDataSetService(datasetDao, recordDao, uisH... | @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representation> listOfAllStubs = dataSetDAO.listDataSet(provi... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... | InMemoryDataSetService implements DataSetService { @Override public ResultSlice<Representation> listDataSet(String providerId, String dataSetId, String thresholdParam, int limit) throws DataSetNotExistsException { int treshold = 0; if (thresholdParam != null) { treshold = parseInteger(thresholdParam); } List<Representa... |
@Test @Parameters(method = "searchRepresentatonsParams") public void shouldSearchRepresentations(String threshold, int limit, int fromIndex, int toIndex, String nextSlice) { List<Representation> representations = createRepresentations(5, PROVIDER_ID, SCHEMA); when(recordDAO.findRepresentations(PROVIDER_ID, SCHEMA)).the... | public ResultSlice<Representation> search(RepresentationSearchParams searchParams, String thresholdParam, int limit) { int threshold = 0; if (thresholdParam != null) { threshold = parseInteger(thresholdParam); } String providerId = searchParams.getDataProvider(); String schema = searchParams.getSchema(); String dataSet... | InMemoryRecordService implements RecordService { public ResultSlice<Representation> search(RepresentationSearchParams searchParams, String thresholdParam, int limit) { int threshold = 0; if (thresholdParam != null) { threshold = parseInteger(thresholdParam); } String providerId = searchParams.getDataProvider(); String ... | InMemoryRecordService implements RecordService { public ResultSlice<Representation> search(RepresentationSearchParams searchParams, String thresholdParam, int limit) { int threshold = 0; if (thresholdParam != null) { threshold = parseInteger(thresholdParam); } String providerId = searchParams.getDataProvider(); String ... | InMemoryRecordService implements RecordService { public ResultSlice<Representation> search(RepresentationSearchParams searchParams, String thresholdParam, int limit) { int threshold = 0; if (thresholdParam != null) { threshold = parseInteger(thresholdParam); } String providerId = searchParams.getDataProvider(); String ... | InMemoryRecordService implements RecordService { public ResultSlice<Representation> search(RepresentationSearchParams searchParams, String thresholdParam, int limit) { int threshold = 0; if (thresholdParam != null) { threshold = parseInteger(thresholdParam); } String providerId = searchParams.getDataProvider(); String ... |
@Test public void shouldConvertFileProperly() { final String fileName = "test2|test1|tes2"; final String output = migrator.nameConversion(fileName); assertEquals("test2_test1_tes2", output); } | @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } @Override String nameConversion(final String s); } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } @Override String nameConversion(final String s); } |
@Betamax(tape = "dataSets_shouldRetrieveDataSetsFirstChunk") @Test public void shouldRetrieveDataSetsFirstChunk() throws MCSException { String providerId = "Provider002"; int resultSize = 100; String startFrom = "dataset000101"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); ResultSlice<DataSet> res... | public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFr... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... |
@Betamax(tape = "dataSets_shouldRetrieveDataSetsSecondChunk") @Test public void shouldRetrieveDataSetsSecondChunk() throws MCSException { String providerId = "Provider002"; int resultSize = 100; String startFrom = "dataset000101"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); ResultSlice<DataSet> r... | public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFr... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... |
@Betamax(tape = "dataSets_shouldNotThrowProviderNotExistsForDataSetsChunk") @Test public void shouldNotThrowProviderNotExistsForDataSetsChunk() throws MCSException { String providerId = "notFoundProviderId"; String startFrom = null; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); ResultSlice<DataSet>... | public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFr... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... |
@Betamax(tape = "dataSets_shouldReturnAllDataSets") @Test public void shouldReturnAllDataSets() throws MCSException { String providerId = "Provider002"; int resultSize = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); List<DataSet> result = instance.getDataSetsForProvider(providerId); assertNotN... | public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || resultSlice.getResults() == null) { throw... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... |
@Betamax(tape = "dataSets_shouldNotThrowProviderNotExistsForDataSetsAll") @Test public void shouldNotThrowProviderNotExistsForDataSetsAll() throws MCSException { String providerId = "notFoundProviderId"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); List<DataSet> result = instance.getDataSetsForPro... | public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || resultSlice.getResults() == null) { throw... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... | DataSetServiceClient extends MCSClient { public List<DataSet> getDataSetsForProvider(String providerId) throws MCSException { List<DataSet> resultList = new ArrayList<>(); ResultSlice resultSlice; String startFrom = null; do { resultSlice = getDataSetsForProviderChunk(providerId, startFrom); if (resultSlice == null || ... |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForGetDataSetsChunk") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForGetDataSetsChunk() throws MCSException { String providerId = "Provider001"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.getDataSetsFo... | public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFr... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForGetDataSets") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForGetDataSets() throws MCSException { String providerId = "Provider001"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.getDataSetsForProviderC... | public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFr... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... | DataSetServiceClient extends MCSClient { public ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); if (startFrom != null) { target = target.queryP... |
@Betamax(tape = "dataSets_shouldSuccessfullyCreateDataSet") @Test public void shouldSuccessfullyCreateDataSet() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000008"; String description = "description01"; String expectedLocation = baseUrl + "/data-providers/" + providerId + "/data-... | public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASET, dataSetId); form.param(ParamConstants.... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... |
@Betamax(tape = "dataSets_shouldThrowDataSetAlreadyExists") @Test(expected = DataSetAlreadyExistsException.class) public void shouldThrowDataSetAlreadyExists() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000002"; String description = "description"; DataSetServiceClient instance =... | public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASET, dataSetId); form.param(ParamConstants.... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... |
@Betamax(tape = "dataSets_shouldThrowProviderNotExists") @Test(expected = ProviderNotExistsException.class) public void shouldThrowProviderNotExists() throws MCSException { String providerId = "notFoundProviderId"; String dataSetId = "dataSetId"; String description = "description"; DataSetServiceClient instance = new D... | public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASET, dataSetId); form.param(ParamConstants.... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... |
@Test public void shouldConvertFileProperly2() { final String fileName = "test2_test1|tes2"; final String output = migrator.nameConversion(fileName); assertEquals("test2_test1_tes2", output); } | @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } @Override String nameConversion(final String s); } | CustomFileNameMigrator extends SwiftMigrator { @Override public String nameConversion(final String s) { return s.contains("|") ? s.replace("|", "_") : null; } @Override String nameConversion(final String s); } |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForCreateDataSet") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForCreateDataSet() throws MCSException { String providerId = "providerId"; String dataSetId = "dataSetId"; String description = "description"; DataSetServiceClient instanc... | public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASET, dataSetId); form.param(ParamConstants.... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... | DataSetServiceClient extends MCSClient { public URI createDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SETS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId); Form form = new Form(); form.param(ParamConstants.F_DATASE... |
@Betamax(tape = "dataSets_shouldRetrieveRepresentationsFirstChunk") @Test public void shouldRetrieveRepresentationsFirstChunk() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000002"; int resultSize = 100; String startFrom = "G5DFUSCILJFVGQSEJYFHGY3IMVWWCMI="; DataSetServiceClient i... | public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); if (startFrom != nu... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... |
@Betamax(tape = "dataSets_shouldRetrieveRepresentationsSecondChunk") @Test public void shouldRetrieveRepresentationsSecondChunk() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000002"; int resultSize = 100; String startFrom = "G5DFUSCILJFVGQSEJYFHGY3IMVWWCMI="; DataSetServiceClient... | public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); if (startFrom != nu... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... |
@Betamax(tape = "dataSets_shouldThrowDataSetNotExistsForRepresentationsChunk") @Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistsForRepresentationsChunk() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000042"; String startFrom = "G5DFUSCILJFVG... | public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); if (startFrom != nu... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... |
@Betamax(tape = "dataSets_shouldReturnAllRepresentations") @Test public void shouldReturnAllRepresentations() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000002"; int resultSize = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); List<Representation> result ... | public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChunk(providerId, dataSetId, startFrom); if ... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... |
@Betamax(tape = "dataSets_shouldThrowDataSetNotExistsForRepresentationsAll") @Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistsForRepresentationsAll() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000042"; DataSetServiceClient instance = new D... | public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChunk(providerId, dataSetId, startFrom); if ... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForGetRepresentationsChunk") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForGetRepresentationsChunk() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000002"; DataSetServiceClient instance = new Dat... | public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); if (startFrom != nu... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... | DataSetServiceClient extends MCSClient { public ResultSlice<Representation> getDataSetRepresentationsChunk( String providerId, String dataSetId, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DAT... |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForGetRepresentations") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForGetRepresentations() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000002"; DataSetServiceClient instance = new DataSetServic... | public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChunk(providerId, dataSetId, startFrom); if ... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... | DataSetServiceClient extends MCSClient { public List<Representation> getDataSetRepresentations(String providerId, String dataSetId) throws MCSException { List<Representation> resultList = new ArrayList<>(); ResultSlice<Representation> resultSlice; String startFrom = null; do { resultSlice = getDataSetRepresentationsChu... |
@Betamax(tape = "dataSets_shouldThrowDataSetNotExistsForUpdateDescription") @Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistsForUpdateDescription() throws MCSException { String providerId = "Provider002"; String dataSetId = "noSuchDataset"; String description = "TEST4"; DataSetSe... | public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = new Form(); form.param(ParamConst... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForUpdateDescription") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForUpdateDescription() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000001"; String description = "TEST3"; DataSetServiceClient ... | public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = new Form(); form.param(ParamConst... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... | DataSetServiceClient extends MCSClient { public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form... |
@Test public void searchTest() throws IndexerException { boolean ok = false; int i = 0; do { try { createIndex("test"); client().prepareIndex("test", "type", "1").setSource("field1", "value1").execute().actionGet(); client().prepareIndex("test", "type", "2").setSource("field1", "value2").execute().actionGet(); client()... | @Override public SearchResult search(String text, String[] fields) throws ConnectionException, IndexerException { return search(text, fields, PAGE_SIZE, 0); } | Elasticsearch implements Indexer { @Override public SearchResult search(String text, String[] fields) throws ConnectionException, IndexerException { return search(text, fields, PAGE_SIZE, 0); } } | Elasticsearch implements Indexer { @Override public SearchResult search(String text, String[] fields) throws ConnectionException, IndexerException { return search(text, fields, PAGE_SIZE, 0); } Elasticsearch(IndexerInformations ii); Elasticsearch(String clasterAddresses, String index, String type); protected Elastics... | Elasticsearch implements Indexer { @Override public SearchResult search(String text, String[] fields) throws ConnectionException, IndexerException { return search(text, fields, PAGE_SIZE, 0); } Elasticsearch(IndexerInformations ii); Elasticsearch(String clasterAddresses, String index, String type); protected Elastics... | Elasticsearch implements Indexer { @Override public SearchResult search(String text, String[] fields) throws ConnectionException, IndexerException { return search(text, fields, PAGE_SIZE, 0); } Elasticsearch(IndexerInformations ii); Elasticsearch(String clasterAddresses, String index, String type); protected Elastics... |
@Betamax(tape = "dataSets_shouldThrowDataSetNotExistsForDeleteDataSet") @Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistsForDeleteDataSet() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000033"; DataSet dataSet = new DataSet(); dataSet.setPro... | public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { response = target.request().delete(); if (resp... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForDeleteDataSet") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForDeleteDataSet() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000033"; DataSetServiceClient instance = new DataSetServiceClient(ba... | public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { response = target.request().delete(); if (resp... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... | DataSetServiceClient extends MCSClient { public void deleteDataSet(String providerId, String dataSetId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Response response = null; try { respo... |
@Betamax(tape = "dataSets_shouldAssignRepresentation") @Test public void shouldAssignRepresentation() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000008"; String cloudId = "1DZ6HTS415W"; String representationName = "schema66"; String versionId = "b95fcda0-994a-11e3-bfe1-1c6f653f6... | public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId);... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... |
@Betamax(tape = "dataSets_shouldAssignRepresentationVersion") @Test public void shouldAssignRepresentationVersion() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000066"; String cloudId = "1DZ6HTS415W"; String representationName = "schema77"; String versionId1 = "49398390-9a3f-11e3... | public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId);... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... |
@Betamax(tape = "dataSets_shouldOverrideAssignedRepresentationVersion") @Test public void shouldOverrideAssignedRepresentationVersion() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000066"; String cloudId = "1DZ6HTS415W"; String representationName = "schema77"; String versionId2 =... | public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId);... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.