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 = PersonNotFoundException.class) public void updateWhenPersonIsNotFound() throws PersonNotFoundException { PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, FIRST_NAME_UPDATED, LAST_NAME_UPDATED); when(personRepositoryMock.findOne(updated.getId())).thenReturn(null); personService.update(updated); v...
@Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person update(PersonDTO updated) throws PersonNotFoundException { LOGGER.debug("Updating person with information: " + updated); Person person = personRepository.findOne(updated.getId()); if (person == null) { LOGGER.debug("No person found with...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person update(PersonDTO updated) throws PersonNotFoundException { LOGGER.debug("Updating person with information: " + updated); Person person = personRepository.findOne(updated.getId()); if (p...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person update(PersonDTO updated) throws PersonNotFoundException { LOGGER.debug("Updating person with information: " + updated); Person person = personRepository.findOne(updated.getId()); if (p...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person update(PersonDTO updated) throws PersonNotFoundException { LOGGER.debug("Updating person with information: " + updated); Person person = personRepository.findOne(updated.getId()); if (p...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person update(PersonDTO updated) throws PersonNotFoundException { LOGGER.debug("Updating person with information: " + updated); Person person = personRepository.findOne(updated.getId()); if (p...
@Test public void count() { SearchDTO searchCriteria = createSearchDTO(); when(personServiceMock.count(searchCriteria.getSearchTerm())).thenReturn(PERSON_COUNT); long personCount = controller.count(searchCriteria); verify(personServiceMock, times(1)).count(searchCriteria.getSearchTerm()); verifyNoMoreInteractions(perso...
@RequestMapping(value="/person/count", method = RequestMethod.POST) @ResponseBody public Long count(@RequestBody SearchDTO searchCriteria) { String searchTerm = searchCriteria.getSearchTerm(); LOGGER.debug("Finding person count for search term: " + searchTerm); return personService.count(searchTerm); }
PersonController extends AbstractController { @RequestMapping(value="/person/count", method = RequestMethod.POST) @ResponseBody public Long count(@RequestBody SearchDTO searchCriteria) { String searchTerm = searchCriteria.getSearchTerm(); LOGGER.debug("Finding person count for search term: " + searchTerm); return perso...
PersonController extends AbstractController { @RequestMapping(value="/person/count", method = RequestMethod.POST) @ResponseBody public Long count(@RequestBody SearchDTO searchCriteria) { String searchTerm = searchCriteria.getSearchTerm(); LOGGER.debug("Finding person count for search term: " + searchTerm); return perso...
PersonController extends AbstractController { @RequestMapping(value="/person/count", method = RequestMethod.POST) @ResponseBody public Long count(@RequestBody SearchDTO searchCriteria) { String searchTerm = searchCriteria.getSearchTerm(); LOGGER.debug("Finding person count for search term: " + searchTerm); return perso...
PersonController extends AbstractController { @RequestMapping(value="/person/count", method = RequestMethod.POST) @ResponseBody public Long count(@RequestBody SearchDTO searchCriteria) { String searchTerm = searchCriteria.getSearchTerm(); LOGGER.debug("Finding person count for search term: " + searchTerm); return perso...
@Test public void delete() throws PersonNotFoundException { Person deleted = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personServiceMock.delete(PERSON_ID)).thenReturn(deleted); initMessageSourceForFeedbackMessage(PersonController.FEEDBACK_MESSAGE_KEY_PERSON_DELETED); RedirectAttributes at...
@RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(attributes, FEEDBACK_MESSAGE_KEY_PERSON_DELETE...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
@Test public void deleteWhenPersonIsNotFound() throws PersonNotFoundException { when(personServiceMock.delete(PERSON_ID)).thenThrow(new PersonNotFoundException()); initMessageSourceForErrorMessage(PersonController.ERROR_MESSAGE_KEY_DELETED_PERSON_WAS_NOT_FOUND); RedirectAttributes attributes = new RedirectAttributesMod...
@RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(attributes, FEEDBACK_MESSAGE_KEY_PERSON_DELETE...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
PersonController extends AbstractController { @RequestMapping(value = "/person/delete/{id}", method = RequestMethod.GET) public String delete(@PathVariable("id") Long id, RedirectAttributes attributes) { LOGGER.debug("Deleting person with id: " + id); try { Person deleted = personService.delete(id); addFeedbackMessage(...
@Test public void searchWhenNoPersonsIsFound() { SearchDTO searchCriteria = createSearchDTO(); List<Person> expected = new ArrayList<Person>(); when(personServiceMock.search(searchCriteria.getSearchTerm(), searchCriteria.getPageIndex())).thenReturn(expected); List<PersonDTO> actual = controller.search(searchCriteria); ...
@RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.getSearchTerm(); List<Person> persons = personSer...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
@Test public void search() { SearchDTO searchCriteria = createSearchDTO(); List<Person> expected = createModels(); when(personServiceMock.search(searchCriteria.getSearchTerm(), searchCriteria.getPageIndex())).thenReturn(expected); List<PersonDTO> actual = controller.search(searchCriteria); verify(personServiceMock, tim...
@RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.getSearchTerm(); List<Person> persons = personSer...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
PersonController extends AbstractController { @RequestMapping(value = "/person/search/page", method = RequestMethod.POST) @ResponseBody public List<PersonDTO> search(@RequestBody SearchDTO searchCriteria) { LOGGER.debug("Searching persons with search criteria: " + searchCriteria); String searchTerm = searchCriteria.get...
@Test public void showCreatePersonForm() { Model model = new BindingAwareModelMap(); String view = controller.showCreatePersonForm(model); verifyZeroInteractions(personServiceMock); assertEquals(PersonController.PERSON_ADD_FORM_VIEW, view); PersonDTO added = (PersonDTO) model.asMap().get(PersonController.MODEL_ATTIRUTE...
@RequestMapping(value = "/person/create", method = RequestMethod.GET) public String showCreatePersonForm(Model model) { LOGGER.debug("Rendering create person form"); model.addAttribute(MODEL_ATTIRUTE_PERSON, new PersonDTO()); return PERSON_ADD_FORM_VIEW; }
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.GET) public String showCreatePersonForm(Model model) { LOGGER.debug("Rendering create person form"); model.addAttribute(MODEL_ATTIRUTE_PERSON, new PersonDTO()); return PERSON_ADD_FORM_VIEW; } }
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.GET) public String showCreatePersonForm(Model model) { LOGGER.debug("Rendering create person form"); model.addAttribute(MODEL_ATTIRUTE_PERSON, new PersonDTO()); return PERSON_ADD_FORM_VIEW; } }
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.GET) public String showCreatePersonForm(Model model) { LOGGER.debug("Rendering create person form"); model.addAttribute(MODEL_ATTIRUTE_PERSON, new PersonDTO()); return PERSON_ADD_FORM_VIEW; } @RequestMapping(...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.GET) public String showCreatePersonForm(Model model) { LOGGER.debug("Rendering create person form"); model.addAttribute(MODEL_ATTIRUTE_PERSON, new PersonDTO()); return PERSON_ADD_FORM_VIEW; } @RequestMapping(...
@Test public void submitCreatePersonForm() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/create", "POST"); PersonDTO created = PersonTestUtil.createDTO(PERSON_ID, FIRST_NAME, LAST_NAME); Person model = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personServiceMoc...
@RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was submitted with information: " + created); if (bi...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
@Test public void prePersist() { Person built = Person.getBuilder(FIRST_NAME, LAST_NAME).build(); built.prePersist(); Date creationTime = built.getCreationTime(); Date modificationTime = built.getModificationTime(); assertNotNull(creationTime); assertNotNull(modificationTime); assertEquals(creationTime, modificationTim...
@PrePersist public void prePersist() { Date now = new Date(); creationTime = now; modificationTime = now; }
Person { @PrePersist public void prePersist() { Date now = new Date(); creationTime = now; modificationTime = now; } }
Person { @PrePersist public void prePersist() { Date now = new Date(); creationTime = now; modificationTime = now; } }
Person { @PrePersist public void prePersist() { Date now = new Date(); creationTime = now; modificationTime = now; } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastName(); @Transient String getName(); Date getModificationTime(); ...
Person { @PrePersist public void prePersist() { Date now = new Date(); creationTime = now; modificationTime = now; } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastName(); @Transient String getName(); Date getModificationTime(); ...
@Test public void submitEmptyCreatePersonForm() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/create", "POST"); PersonDTO created = new PersonDTO(); RedirectAttributes attributes = new RedirectAttributesModelMap(); BindingResult result = bindAndValidate(mockRequest, created); String view = ...
@RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was submitted with information: " + created); if (bi...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
@Test public void submitCreatePersonFormWithEmptyFirstName() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/create", "POST"); PersonDTO created = PersonTestUtil.createDTO(null, null, LAST_NAME); RedirectAttributes attributes = new RedirectAttributesModelMap(); BindingResult result = bindAndV...
@RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was submitted with information: " + created); if (bi...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
@Test public void submitCreatePersonFormWithEmptyLastName() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/create", "POST"); PersonDTO created = PersonTestUtil.createDTO(null, FIRST_NAME, null); RedirectAttributes attributes = new RedirectAttributesModelMap(); BindingResult result = bindAndV...
@RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was submitted with information: " + created); if (bi...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
PersonController extends AbstractController { @RequestMapping(value = "/person/create", method = RequestMethod.POST) public String submitCreatePersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO created, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Create person form was su...
@Test public void showEditPersonForm() { Person person = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personServiceMock.findById(PERSON_ID)).thenReturn(person); Model model = new BindingAwareModelMap(); RedirectAttributes attributes = new RedirectAttributesModelMap(); String view = controlle...
@RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personService.findById(id); if (person == null) { LOG...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
@Test public void showEditPersonFormWhenPersonIsNotFound() { when(personServiceMock.findById(PERSON_ID)).thenReturn(null); initMessageSourceForErrorMessage(PersonController.ERROR_MESSAGE_KEY_EDITED_PERSON_WAS_NOT_FOUND); Model model = new BindingAwareModelMap(); RedirectAttributes attributes = new RedirectAttributesMod...
@RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personService.findById(id); if (person == null) { LOG...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit/{id}", method = RequestMethod.GET) public String showEditPersonForm(@PathVariable("id") Long id, Model model, RedirectAttributes attributes) { LOGGER.debug("Rendering edit person form for person with id: " + id); Person person = personS...
@Test public void submitEditPersonForm() throws PersonNotFoundException { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/edit", "POST"); PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, FIRST_NAME_UPDATED, LAST_NAME_UPDATED); Person person = PersonTestUtil.createModelObject(PERSON_ID, F...
@RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitted with information: " + updated); if (bindingR...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
@Test public void submitEditPersonFormWhenPersonIsNotFound() throws PersonNotFoundException { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/edit", "POST"); PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, FIRST_NAME_UPDATED, LAST_NAME_UPDATED); when(personServiceMock.update(updated)).t...
@RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitted with information: " + updated); if (bindingR...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
@Test public void submitEmptyEditPersonForm() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/edit", "POST"); PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, null, null); BindingResult bindingResult = bindAndValidate(mockRequest, updated); RedirectAttributes attributes = new RedirectA...
@RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitted with information: " + updated); if (bindingR...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
@Test public void submitEditPersonFormWhenFirstNameIsEmpty() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/edit", "POST"); PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, null, LAST_NAME_UPDATED); BindingResult bindingResult = bindAndValidate(mockRequest, updated); RedirectAttribute...
@RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitted with information: " + updated); if (bindingR...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
@Test public void submitEditPersonFormWhenLastNameIsEmpty() { MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/edit", "POST"); PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, FIRST_NAME_UPDATED, null); BindingResult bindingResult = bindAndValidate(mockRequest, updated); RedirectAttribute...
@RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitted with information: " + updated); if (bindingR...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
PersonController extends AbstractController { @RequestMapping(value = "/person/edit", method = RequestMethod.POST) public String submitEditPersonForm(@Valid @ModelAttribute(MODEL_ATTIRUTE_PERSON) PersonDTO updated, BindingResult bindingResult, RedirectAttributes attributes) { LOGGER.debug("Edit person form was submitte...
@Test public void preUpdate() { Person built = Person.getBuilder(FIRST_NAME, LAST_NAME).build(); built.prePersist(); try { Thread.sleep(1000); } catch (InterruptedException e) { } built.preUpdate(); Date creationTime = built.getCreationTime(); Date modificationTime = built.getModificationTime(); assertNotNull(creationT...
@PreUpdate public void preUpdate() { modificationTime = new Date(); }
Person { @PreUpdate public void preUpdate() { modificationTime = new Date(); } }
Person { @PreUpdate public void preUpdate() { modificationTime = new Date(); } }
Person { @PreUpdate public void preUpdate() { modificationTime = new Date(); } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastName(); @Transient String getName(); Date getModificationTime(); long getVersion(); void update(String ...
Person { @PreUpdate public void preUpdate() { modificationTime = new Date(); } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastName(); @Transient String getName(); Date getModificationTime(); long getVersion(); void update(String ...
@Test public void showList() { List<Person> persons = new ArrayList<Person>(); when(personServiceMock.findAll()).thenReturn(persons); Model model = new BindingAwareModelMap(); String view = controller.showList(model); verify(personServiceMock, times(1)).findAll(); verifyNoMoreInteractions(personServiceMock); assertEqua...
@RequestMapping(value = REQUEST_MAPPING_LIST, method = RequestMethod.GET) public String showList(Model model) { LOGGER.debug("Rendering person list page"); List<Person> persons = personService.findAll(); model.addAttribute(MODEL_ATTRIBUTE_PERSONS, persons); model.addAttribute(MODEL_ATTRIBUTE_SEARCH_CRITERIA, new Search...
PersonController extends AbstractController { @RequestMapping(value = REQUEST_MAPPING_LIST, method = RequestMethod.GET) public String showList(Model model) { LOGGER.debug("Rendering person list page"); List<Person> persons = personService.findAll(); model.addAttribute(MODEL_ATTRIBUTE_PERSONS, persons); model.addAttribu...
PersonController extends AbstractController { @RequestMapping(value = REQUEST_MAPPING_LIST, method = RequestMethod.GET) public String showList(Model model) { LOGGER.debug("Rendering person list page"); List<Person> persons = personService.findAll(); model.addAttribute(MODEL_ATTRIBUTE_PERSONS, persons); model.addAttribu...
PersonController extends AbstractController { @RequestMapping(value = REQUEST_MAPPING_LIST, method = RequestMethod.GET) public String showList(Model model) { LOGGER.debug("Rendering person list page"); List<Person> persons = personService.findAll(); model.addAttribute(MODEL_ATTRIBUTE_PERSONS, persons); model.addAttribu...
PersonController extends AbstractController { @RequestMapping(value = REQUEST_MAPPING_LIST, method = RequestMethod.GET) public String showList(Model model) { LOGGER.debug("Rendering person list page"); List<Person> persons = personService.findAll(); model.addAttribute(MODEL_ATTRIBUTE_PERSONS, persons); model.addAttribu...
@Test public void showSearchResultPage() { SearchDTO searchCriteria = createSearchDTO(); Model model = new BindingAwareModelMap(); String view = controller.showSearchResultPage(searchCriteria, model); SearchDTO modelAttribute = (SearchDTO) model.asMap().get(PersonController.MODEL_ATTRIBUTE_SEARCH_CRITERIA); assertEqual...
@RequestMapping(value = "/person/search", method=RequestMethod.POST) public String showSearchResultPage(@ModelAttribute(MODEL_ATTRIBUTE_SEARCH_CRITERIA) SearchDTO searchCriteria, Model model) { LOGGER.debug("Rendering search result page for search criteria: " + searchCriteria); model.addAttribute(MODEL_ATTRIBUTE_SEARCH...
PersonController extends AbstractController { @RequestMapping(value = "/person/search", method=RequestMethod.POST) public String showSearchResultPage(@ModelAttribute(MODEL_ATTRIBUTE_SEARCH_CRITERIA) SearchDTO searchCriteria, Model model) { LOGGER.debug("Rendering search result page for search criteria: " + searchCriter...
PersonController extends AbstractController { @RequestMapping(value = "/person/search", method=RequestMethod.POST) public String showSearchResultPage(@ModelAttribute(MODEL_ATTRIBUTE_SEARCH_CRITERIA) SearchDTO searchCriteria, Model model) { LOGGER.debug("Rendering search result page for search criteria: " + searchCriter...
PersonController extends AbstractController { @RequestMapping(value = "/person/search", method=RequestMethod.POST) public String showSearchResultPage(@ModelAttribute(MODEL_ATTRIBUTE_SEARCH_CRITERIA) SearchDTO searchCriteria, Model model) { LOGGER.debug("Rendering search result page for search criteria: " + searchCriter...
PersonController extends AbstractController { @RequestMapping(value = "/person/search", method=RequestMethod.POST) public String showSearchResultPage(@ModelAttribute(MODEL_ATTRIBUTE_SEARCH_CRITERIA) SearchDTO searchCriteria, Model model) { LOGGER.debug("Rendering search result page for search criteria: " + searchCriter...
@Test public void addErrorMessage() { RedirectAttributes model = new RedirectAttributesModelMap(); Object[] params = new Object[0]; when(messageSourceMock.getMessage(eq(ERROR_MESSAGE_CODE), eq(params), any(Locale.class))).thenReturn(ERROR_MESSAGE); controller.addErrorMessage(model, ERROR_MESSAGE_CODE, params); verify(m...
protected void addErrorMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("adding error message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedErrorMessage = messageSource.getMe...
AbstractController { protected void addErrorMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("adding error message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedErrorMessage ...
AbstractController { protected void addErrorMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("adding error message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedErrorMessage ...
AbstractController { protected void addErrorMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("adding error message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedErrorMessage ...
AbstractController { protected void addErrorMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("adding error message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedErrorMessage ...
@Test public void addFeedbackMessage() { RedirectAttributes model = new RedirectAttributesModelMap(); Object[] params = new Object[0]; when(messageSourceMock.getMessage(eq(FEEDBACK_MESSAGE_CODE), eq(params), any(Locale.class))).thenReturn(FEEDBACK_MESSAGE); controller.addFeedbackMessage(model, FEEDBACK_MESSAGE_CODE, pa...
protected void addFeedbackMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("Adding feedback message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedFeedbackMessage = messageSou...
AbstractController { protected void addFeedbackMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("Adding feedback message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedFeedbac...
AbstractController { protected void addFeedbackMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("Adding feedback message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedFeedbac...
AbstractController { protected void addFeedbackMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("Adding feedback message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedFeedbac...
AbstractController { protected void addFeedbackMessage(RedirectAttributes model, String code, Object... params) { LOGGER.debug("Adding feedback message with code: " + code + " and params: " + params); Locale current = LocaleContextHolder.getLocale(); LOGGER.debug("Current locale is " + current); String localizedFeedbac...
@Test public void createRedirectViewPath() { String redirectView = controller.createRedirectViewPath(REDIRECT_PATH); String expectedView = buildExpectedRedirectViewPath(REDIRECT_PATH); verifyZeroInteractions(messageSourceMock); assertEquals(expectedView, redirectView); }
protected String createRedirectViewPath(String path) { StringBuilder builder = new StringBuilder(); builder.append(VIEW_REDIRECT_PREFIX); builder.append(path); return builder.toString(); }
AbstractController { protected String createRedirectViewPath(String path) { StringBuilder builder = new StringBuilder(); builder.append(VIEW_REDIRECT_PREFIX); builder.append(path); return builder.toString(); } }
AbstractController { protected String createRedirectViewPath(String path) { StringBuilder builder = new StringBuilder(); builder.append(VIEW_REDIRECT_PREFIX); builder.append(path); return builder.toString(); } }
AbstractController { protected String createRedirectViewPath(String path) { StringBuilder builder = new StringBuilder(); builder.append(VIEW_REDIRECT_PREFIX); builder.append(path); return builder.toString(); } }
AbstractController { protected String createRedirectViewPath(String path) { StringBuilder builder = new StringBuilder(); builder.append(VIEW_REDIRECT_PREFIX); builder.append(path); return builder.toString(); } }
@Test public void findAllPersons() { repository.findAllPersons(); ArgumentCaptor<Sort> sortArgument = ArgumentCaptor.forClass(Sort.class); verify(personRepositoryMock, times(1)).findAll(sortArgument.capture()); Sort sort = sortArgument.getValue(); assertEquals(Sort.Direction.ASC, sort.getOrderFor(PROPERTY_LASTNAME).get...
@Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } PaginatingPersonRepositoryImpl(); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } PaginatingPersonRepositoryImpl(); @Override List<Person> findAllPersons(); @Override long findPersonCount(S...
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } PaginatingPersonRepositoryImpl(); @Override List<Person> findAllPersons(); @Override long findPersonCount(S...
@Test public void findPersonCount() { when(personRepositoryMock.count(any(Predicate.class))).thenReturn(PERSON_COUNT); long actual = repository.findPersonCount(SEARCH_TERM); verify(personRepositoryMock, times(1)).count(any(Predicate.class)); verifyNoMoreInteractions(personRepositoryMock); assertEquals(PERSON_COUNT, act...
@Override public long findPersonCount(String searchTerm) { LOGGER.debug("Finding person count with search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public long findPersonCount(String searchTerm) { LOGGER.debug("Finding person count with search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public long findPersonCount(String searchTerm) { LOGGER.debug("Finding person count with search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } PaginatingPersonRepositoryImpl(); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public long findPersonCount(String searchTerm) { LOGGER.debug("Finding person count with search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } PaginatingPersonRepositoryImpl(); @Override List<Person> fi...
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public long findPersonCount(String searchTerm) { LOGGER.debug("Finding person count with search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } PaginatingPersonRepositoryImpl(); @Override List<Person> fi...
@Test public void findPersonsForPage() { List<Person> expected = new ArrayList<Person>(); Page foundPage = new PageImpl<Person>(expected); when(personRepositoryMock.findAll(any(Predicate.class), any(Pageable.class))).thenReturn(foundPage); List<Person> actual = repository.findPersonsForPage(SEARCH_TERM, PAGE_INDEX); Ar...
@Override public List<Person> findPersonsForPage(String searchTerm, int page) { LOGGER.debug("Finding persons for page " + page + " with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), constructPageSpecification(page)); return requestedPage.getContent(); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findPersonsForPage(String searchTerm, int page) { LOGGER.debug("Finding persons for page " + page + " with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), construc...
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findPersonsForPage(String searchTerm, int page) { LOGGER.debug("Finding persons for page " + page + " with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), construc...
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findPersonsForPage(String searchTerm, int page) { LOGGER.debug("Finding persons for page " + page + " with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), construc...
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findPersonsForPage(String searchTerm, int page) { LOGGER.debug("Finding persons for page " + page + " with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), construc...
@Test public void isTrueWithDynamicErrorMessage_ExpressionIsTrue_ShouldNotThrowException() { PreCondition.isTrue(true, "Dynamic error message with parameter: %d", 1L); }
public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
@Test public void isTrueWithDynamicErrorMessage_ExpressionIsFalse_ShouldThrowException() { assertThatThrownBy(() -> PreCondition.isTrue(false, "Dynamic error message with parameter: %d", 1L)) .isExactlyInstanceOf(IllegalArgumentException.class) .hasMessage("Dynamic error message with parameter: 1"); }
public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
@Test public void update() { Person built = Person.getBuilder(FIRST_NAME, LAST_NAME).build(); built.update(FIRST_NAME_UPDATED, LAST_NAME_UPDATED); assertEquals(FIRST_NAME_UPDATED, built.getFirstName()); assertEquals(LAST_NAME_UPDATED, built.getLastName()); }
public void update(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; }
Person { public void update(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } }
Person { public void update(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } }
Person { public void update(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastName(); @Transient String getName(); Date getModificationTime...
Person { public void update(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastName(); @Transient String getName(); Date getModificationTime...
@Test public void isTrueWithStaticErrorMessage_ExpressionIsTrue_ShouldNotThrowException() { PreCondition.isTrue(true, STATIC_ERROR_MESSAGE); }
public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
@Test public void isTrueWithStaticErrorMessage_ExpressionIsFalse_ShouldThrowException() { assertThatThrownBy(() -> PreCondition.isTrue(false, STATIC_ERROR_MESSAGE)) .isExactlyInstanceOf(IllegalArgumentException.class) .hasMessage(STATIC_ERROR_MESSAGE); }
public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); }
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
PreCondition { public static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments) { isTrue(expression, String.format(errorMessageTemplate, errorMessageArguments)); } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessa...
@Test public void notEmpty_StringIsNotEmpty_ShouldNotThrowException() { PreCondition.notEmpty(" ", STATIC_ERROR_MESSAGE); }
public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } }
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } }
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } private PreCondition(); }
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean express...
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean express...
@Test public void notEmpty_StringIsEmpty_ShouldThrowException() { assertThatThrownBy(() -> PreCondition.notEmpty("", STATIC_ERROR_MESSAGE)) .isExactlyInstanceOf(IllegalArgumentException.class) .hasMessage(STATIC_ERROR_MESSAGE); }
public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } }
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } }
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } private PreCondition(); }
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean express...
PreCondition { public static void notEmpty(String string, String errorMessage) { if (string.isEmpty()) { throw new IllegalArgumentException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean express...
@Test public void notNull_ObjectIsNotNull_ShouldNotThrowException() { PreCondition.notNull(new Object(), STATIC_ERROR_MESSAGE); }
public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } }
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } }
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } private PreCondition(); }
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean expressi...
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean expressi...
@Test public void notNull_ObjectIsNull_ShouldThrowException() { assertThatThrownBy(() -> PreCondition.notNull(null, STATIC_ERROR_MESSAGE)) .isExactlyInstanceOf(NullPointerException.class) .hasMessage(STATIC_ERROR_MESSAGE); }
public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } }
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } }
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } private PreCondition(); }
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean expressi...
PreCondition { public static void notNull(Object reference, String errorMessage) { if (reference == null) { throw new NullPointerException(errorMessage); } } private PreCondition(); static void isTrue(boolean expression, String errorMessageTemplate, Object... errorMessageArguments); static void isTrue(boolean expressi...
@Test public void count() { personService.count(SEARCH_TERM); verify(personRepositoryMock, times(1)).findPersonCount(SEARCH_TERM); verifyNoMoreInteractions(personRepositoryMock); }
@Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.findPersonCount(searchTerm); }
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.findPersonCount(searchTerm); } }
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.findPersonCount(searchTerm); } }
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.findPersonCount(searchTerm); } @Transactional @Override Person create(PersonDTO created); @Transactional @Overr...
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.findPersonCount(searchTerm); } @Transactional @Override Person create(PersonDTO created); @Transactional @Overr...
@Test public void create() { PersonDTO created = PersonTestUtil.createDTO(null, FIRST_NAME, LAST_NAME); Person persisted = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personRepositoryMock.save(any(Person.class))).thenReturn(persisted); Person returned = personService.create(created); Argume...
@Transactional @Override public Person create(PersonDTO created) { LOGGER.debug("Creating a new person with information: " + created); Person person = Person.getBuilder(created.getFirstName(), created.getLastName()).build(); return personRepository.save(person); }
RepositoryPersonService implements PersonService { @Transactional @Override public Person create(PersonDTO created) { LOGGER.debug("Creating a new person with information: " + created); Person person = Person.getBuilder(created.getFirstName(), created.getLastName()).build(); return personRepository.save(person); } }
RepositoryPersonService implements PersonService { @Transactional @Override public Person create(PersonDTO created) { LOGGER.debug("Creating a new person with information: " + created); Person person = Person.getBuilder(created.getFirstName(), created.getLastName()).build(); return personRepository.save(person); } }
RepositoryPersonService implements PersonService { @Transactional @Override public Person create(PersonDTO created) { LOGGER.debug("Creating a new person with information: " + created); Person person = Person.getBuilder(created.getFirstName(), created.getLastName()).build(); return personRepository.save(person); } @Tr...
RepositoryPersonService implements PersonService { @Transactional @Override public Person create(PersonDTO created) { LOGGER.debug("Creating a new person with information: " + created); Person person = Person.getBuilder(created.getFirstName(), created.getLastName()).build(); return personRepository.save(person); } @Tr...
@Test public void delete() throws PersonNotFoundException { Person deleted = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personRepositoryMock.findOne(PERSON_ID)).thenReturn(deleted); Person returned = personService.delete(PERSON_ID); verify(personRepositoryMock, times(1)).findOne(PERSON_ID)...
@Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { LOGGER.debug("No person found with id: " + personId...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
@Test public void getName() { Person built = Person.getBuilder(FIRST_NAME, LAST_NAME).build(); String expectedName = constructName(FIRST_NAME, LAST_NAME); assertEquals(expectedName, built.getName()); }
@Transient public String getName() { StringBuilder name = new StringBuilder(); name.append(firstName); name.append(" "); name.append(lastName); return name.toString(); }
Person { @Transient public String getName() { StringBuilder name = new StringBuilder(); name.append(firstName); name.append(" "); name.append(lastName); return name.toString(); } }
Person { @Transient public String getName() { StringBuilder name = new StringBuilder(); name.append(firstName); name.append(" "); name.append(lastName); return name.toString(); } }
Person { @Transient public String getName() { StringBuilder name = new StringBuilder(); name.append(firstName); name.append(" "); name.append(lastName); return name.toString(); } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastNam...
Person { @Transient public String getName() { StringBuilder name = new StringBuilder(); name.append(firstName); name.append(" "); name.append(lastName); return name.toString(); } Long getId(); static Builder getBuilder(String firstName, String lastName); Date getCreationTime(); String getFirstName(); String getLastNam...
@Test(expected = PersonNotFoundException.class) public void deleteWhenPersonIsNotFound() throws PersonNotFoundException { when(personRepositoryMock.findOne(PERSON_ID)).thenReturn(null); personService.delete(PERSON_ID); verify(personRepositoryMock, times(1)).findOne(PERSON_ID); verifyNoMoreInteractions(personRepositoryM...
@Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { LOGGER.debug("No person found with id: " + personId...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
RepositoryPersonService implements PersonService { @Transactional(rollbackFor = PersonNotFoundException.class) @Override public Person delete(Long personId) throws PersonNotFoundException { LOGGER.debug("Deleting person with id: " + personId); Person deleted = personRepository.findOne(personId); if (deleted == null) { ...
@Test public void count() { when(personRepositoryMock.count(any(Specification.class))).thenReturn(PERSON_COUNT); long personCount = personService.count(SEARCH_TERM); verify(personRepositoryMock, times(1)).count(any(Specification.class)); verifyNoMoreInteractions(personRepositoryMock); assertEquals(PERSON_COUNT, personC...
@Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); }
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } }
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } }
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } @Transactional @Override Person create(PersonDTO created); @Transactional ...
RepositoryPersonService implements PersonService { @Transactional @Override public long count(String searchTerm) { LOGGER.debug("Getting person count for search term: " + searchTerm); return personRepository.count(lastNameIsLike(searchTerm)); } @Transactional @Override Person create(PersonDTO created); @Transactional ...
@Test public void findAll() { List<Person> persons = new ArrayList<Person>(); when(personRepositoryMock.findAll(any(Sort.class))).thenReturn(persons); List<Person> returned = personService.findAll(); ArgumentCaptor<Sort> sortArgument = ArgumentCaptor.forClass(Sort.class); verify(personRepositoryMock, times(1)).findAll(...
@Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String...
@Test public void search() { List<Person> expected = new ArrayList<Person>(); Page expectedPage = new PageImpl(expected); when(personRepositoryMock.findAll(any(Specification.class), any(Pageable.class))).thenReturn(expectedPage); List<Person> actual = personService.search(SEARCH_TERM, PAGE_INDEX); ArgumentCaptor<Pageab...
@Transactional(readOnly = true) @Override public List<Person> search(String searchTerm, int pageIndex) { LOGGER.debug("Searching persons with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), constructPageSpecification(pageIndex)); return requestedPage.getContent();...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> search(String searchTerm, int pageIndex) { LOGGER.debug("Searching persons with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), constructPageSpecificat...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> search(String searchTerm, int pageIndex) { LOGGER.debug("Searching persons with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), constructPageSpecificat...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> search(String searchTerm, int pageIndex) { LOGGER.debug("Searching persons with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), constructPageSpecificat...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> search(String searchTerm, int pageIndex) { LOGGER.debug("Searching persons with search term: " + searchTerm); Page requestedPage = personRepository.findAll(lastNameIsLike(searchTerm), constructPageSpecificat...
@Test public void findAll() { List<Person> persons = new ArrayList<Person>(); when(personRepositoryMock.findAllPersons()).thenReturn(persons); List<Person> returned = personService.findAll(); verify(personRepositoryMock, times(1)).findAllPersons(); verifyNoMoreInteractions(personRepositoryMock); assertEquals(persons, r...
@Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAllPersons(); }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAllPersons(); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAllPersons(); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAllPersons(); } @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String searchTerm)...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public List<Person> findAll() { LOGGER.debug("Finding all persons"); return personRepository.findAllPersons(); } @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String searchTerm)...
@Test public void findById() { Person person = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personRepositoryMock.findOne(PERSON_ID)).thenReturn(person); Person returned = personService.findById(PERSON_ID); verify(personRepositoryMock, times(1)).findOne(PERSON_ID); verifyNoMoreInteractions(pe...
@Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); } @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String search...
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); } @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String search...
@Test public void registerUser() { User user = UserData.randomNewUser(); userService.registerUser(user, UserData.randomPassword()); assertEquals("user", user.getRoles()); assertNotNull(user.getPassword()); assertNotNull(user.getSalt()); }
@Transactional(readOnly = false) public void registerUser(User user, String plainPassword) { entryptPassword(user, plainPassword); generateActKey(user); user.setRoles("user"); user.setRegisterDate(Calendar.getInstance().getTime()); user.setNiceName(user.getLoginName()); user.setStatusCode(UserStatus.Pending.code()); us...
UserService extends BaseService { @Transactional(readOnly = false) public void registerUser(User user, String plainPassword) { entryptPassword(user, plainPassword); generateActKey(user); user.setRoles("user"); user.setRegisterDate(Calendar.getInstance().getTime()); user.setNiceName(user.getLoginName()); user.setStatusC...
UserService extends BaseService { @Transactional(readOnly = false) public void registerUser(User user, String plainPassword) { entryptPassword(user, plainPassword); generateActKey(user); user.setRoles("user"); user.setRegisterDate(Calendar.getInstance().getTime()); user.setNiceName(user.getLoginName()); user.setStatusC...
UserService extends BaseService { @Transactional(readOnly = false) public void registerUser(User user, String plainPassword) { entryptPassword(user, plainPassword); generateActKey(user); user.setRoles("user"); user.setRegisterDate(Calendar.getInstance().getTime()); user.setNiceName(user.getLoginName()); user.setStatusC...
UserService extends BaseService { @Transactional(readOnly = false) public void registerUser(User user, String plainPassword) { entryptPassword(user, plainPassword); generateActKey(user); user.setRoles("user"); user.setRegisterDate(Calendar.getInstance().getTime()); user.setNiceName(user.getLoginName()); user.setStatusC...
@Test public void updateUser() { User user = UserData.randomNewUser(); userService.updateUser(user, UserData.randomPassword()); assertNotNull(user.getSalt()); User user2 = UserData.randomNewUser(); userService.updateUser(user2, null); assertNull(user2.getSalt()); }
@Transactional(readOnly = false) public void updateUser(User user, String plainPassword) { if (StringUtils.isNotBlank(plainPassword)) { entryptPassword(user, plainPassword); } userRepository.save(user); }
UserService extends BaseService { @Transactional(readOnly = false) public void updateUser(User user, String plainPassword) { if (StringUtils.isNotBlank(plainPassword)) { entryptPassword(user, plainPassword); } userRepository.save(user); } }
UserService extends BaseService { @Transactional(readOnly = false) public void updateUser(User user, String plainPassword) { if (StringUtils.isNotBlank(plainPassword)) { entryptPassword(user, plainPassword); } userRepository.save(user); } }
UserService extends BaseService { @Transactional(readOnly = false) public void updateUser(User user, String plainPassword) { if (StringUtils.isNotBlank(plainPassword)) { entryptPassword(user, plainPassword); } userRepository.save(user); } User getUser(Long id); User findUserByLoginName(String loginName); User findUser...
UserService extends BaseService { @Transactional(readOnly = false) public void updateUser(User user, String plainPassword) { if (StringUtils.isNotBlank(plainPassword)) { entryptPassword(user, plainPassword); } userRepository.save(user); } User getUser(Long id); User findUserByLoginName(String loginName); User findUser...
@Test public void deleteUser() { userService.deleteUser(2L); Mockito.verify(mockUserDao).delete(2L); try { userService.deleteUser(1L); fail("expected ServicExcepton not be thrown"); } catch (ServiceException e) { } Mockito.verify(mockUserDao, Mockito.never()).delete(1L); }
@Transactional(readOnly = false) public void deleteUser(Long id) { if (isSupervisor(id)) { logger.warn("操作员{}尝试删除超级管理员用户", getCurrentUserName()); throw new ServiceException("不能删除超级管理员用户"); } userRepository.delete(id); }
UserService extends BaseService { @Transactional(readOnly = false) public void deleteUser(Long id) { if (isSupervisor(id)) { logger.warn("操作员{}尝试删除超级管理员用户", getCurrentUserName()); throw new ServiceException("不能删除超级管理员用户"); } userRepository.delete(id); } }
UserService extends BaseService { @Transactional(readOnly = false) public void deleteUser(Long id) { if (isSupervisor(id)) { logger.warn("操作员{}尝试删除超级管理员用户", getCurrentUserName()); throw new ServiceException("不能删除超级管理员用户"); } userRepository.delete(id); } }
UserService extends BaseService { @Transactional(readOnly = false) public void deleteUser(Long id) { if (isSupervisor(id)) { logger.warn("操作员{}尝试删除超级管理员用户", getCurrentUserName()); throw new ServiceException("不能删除超级管理员用户"); } userRepository.delete(id); } User getUser(Long id); User findUserByLoginName(String loginName)...
UserService extends BaseService { @Transactional(readOnly = false) public void deleteUser(Long id) { if (isSupervisor(id)) { logger.warn("操作员{}尝试删除超级管理员用户", getCurrentUserName()); throw new ServiceException("不能删除超级管理员用户"); } userRepository.delete(id); } User getUser(Long id); User findUserByLoginName(String loginName)...
@Test public void entryptPassword() { User user = UserData.randomNewUser(); userService.entryptPassword(user, "admin"); System.out.println(user.getLoginName()); System.out.println("salt: " + user.getSalt()); System.out.println("entrypt password: " + user.getPassword()); }
void entryptPassword(User user, String plainPassword) { byte[] salt = Digests.generateSalt(SALT_SIZE); user.setSalt(Encodes.encodeHex(salt)); byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS); user.setPassword(Encodes.encodeHex(hashPassword)); }
UserService extends BaseService { void entryptPassword(User user, String plainPassword) { byte[] salt = Digests.generateSalt(SALT_SIZE); user.setSalt(Encodes.encodeHex(salt)); byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS); user.setPassword(Encodes.encodeHex(hashPassword)); } }
UserService extends BaseService { void entryptPassword(User user, String plainPassword) { byte[] salt = Digests.generateSalt(SALT_SIZE); user.setSalt(Encodes.encodeHex(salt)); byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS); user.setPassword(Encodes.encodeHex(hashPassword)); } }
UserService extends BaseService { void entryptPassword(User user, String plainPassword) { byte[] salt = Digests.generateSalt(SALT_SIZE); user.setSalt(Encodes.encodeHex(salt)); byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS); user.setPassword(Encodes.encodeHex(hashPassword)); } User...
UserService extends BaseService { void entryptPassword(User user, String plainPassword) { byte[] salt = Digests.generateSalt(SALT_SIZE); user.setSalt(Encodes.encodeHex(salt)); byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS); user.setPassword(Encodes.encodeHex(hashPassword)); } User...
@Test public void testMD5CloneSupportedTrue() throws Exception { InputStream in = mock(InputStream.class); doReturn(true).when(in).markSupported();; MD5DigestCalculatingInputStream md5Digest = new MD5DigestCalculatingInputStream(in); assertTrue(md5Digest.markSupported()); }
@Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; }
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } }
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } MD5DigestCalculatingInputStream(InputStream in); }
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } MD5DigestCalculatingInputStream(InputStream in); @Override boolean markSupported(); byte[] getMd5Digest(); @Override void mark(int readlimit); @Override void res...
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } MD5DigestCalculatingInputStream(InputStream in); @Override boolean markSupported(); byte[] getMd5Digest(); @Override void mark(int readlimit); @Override void res...
@Test public void testServiceInstanceRuntimeParamTakesPrecedence() { String serviceInstanceId = "12345"; CreateBucketRequest request = new CreateBucketRequest("testbucket").withServiceInstanceId(serviceInstanceId); Request<CreateBucketRequest> defaultRequest = new DefaultRequest(Constants.S3_SERVICE_DISPLAY_NAME); Amaz...
protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredentials)) { if (null != createBucketRequest.getServiceInstanceId()) { re...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
@Test public void testServiceInstanceHeaderIsAddedByCredentialProvdier() { String serviceInstanceId = "12345"; CreateBucketRequest request = new CreateBucketRequest("testbucket"); Request<CreateBucketRequest> defaultRequest = new DefaultRequest(Constants.S3_SERVICE_DISPLAY_NAME); AmazonS3Client s3Client = new AmazonS3C...
protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredentials)) { if (null != createBucketRequest.getServiceInstanceId()) { re...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
@Test public void testFromByteBuffer() { String expectedData = "hello world"; String expectedEncodedData = "aGVsbG8gd29ybGQ="; ByteBuffer byteBuffer = ByteBuffer.wrap(expectedData.getBytes()); String encodedData = StringUtils.fromByteBuffer(byteBuffer); assertEquals(expectedEncodedData, encodedData); }
public static String fromByteBuffer(ByteBuffer byteBuffer) { return Base64.encodeAsString(copyBytesFrom(byteBuffer)); }
StringUtils { public static String fromByteBuffer(ByteBuffer byteBuffer) { return Base64.encodeAsString(copyBytesFrom(byteBuffer)); } }
StringUtils { public static String fromByteBuffer(ByteBuffer byteBuffer) { return Base64.encodeAsString(copyBytesFrom(byteBuffer)); } }
StringUtils { public static String fromByteBuffer(ByteBuffer byteBuffer) { return Base64.encodeAsString(copyBytesFrom(byteBuffer)); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); stat...
StringUtils { public static String fromByteBuffer(ByteBuffer byteBuffer) { return Base64.encodeAsString(copyBytesFrom(byteBuffer)); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); stat...
@Test public void testFromByte() { assertEquals("123", StringUtils.fromByte(new Byte("123"))); assertEquals("-99", StringUtils.fromByte(new Byte("-99"))); }
public static String fromByte(Byte b) { return Byte.toString(b); }
StringUtils { public static String fromByte(Byte b) { return Byte.toString(b); } }
StringUtils { public static String fromByte(Byte b) { return Byte.toString(b); } }
StringUtils { public static String fromByte(Byte b) { return Byte.toString(b); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); static String fromLong(Long value); static String fromStr...
StringUtils { public static String fromByte(Byte b) { return Byte.toString(b); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); static String fromLong(Long value); static String fromStr...
@Test(timeout = 10 * 1000) public void replace_ReplacementStringContainsMatchString_DoesNotCauseInfiniteLoop() { assertEquals("aabc", StringUtils.replace("abc", "a", "aa")); }
public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexOf + partToMatc...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
@Test public void replace_EmptyReplacementString_RemovesAllOccurencesOfMatchString() { assertEquals("bbb", StringUtils.replace("ababab", "a", "")); }
public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexOf + partToMatc...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
@Test public void replace_MatchNotFound_ReturnsOriginalString() { assertEquals("abc", StringUtils.replace("abc", "d", "e")); }
public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexOf + partToMatc...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
StringUtils { public static String replace( String originalString, String partToMatch, String replacement ) { StringBuilder buffer = new StringBuilder( originalString.length() ); buffer.append( originalString ); int indexOf = buffer.indexOf( partToMatch ); while (indexOf != -1) { buffer = buffer.replace(indexOf, indexO...
@Test public void lowerCase_NonEmptyString() { String input = "x-amz-InvocAtion-typE"; String expected = "x-amz-invocation-type"; assertEquals(expected, StringUtils.lowerCase(input)); }
public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
@Test public void lowerCase_NullString() { assertNull(StringUtils.lowerCase(null)); }
public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
@Test public void lowerCase_EmptyString() { Assert.assertThat(StringUtils.lowerCase(""), Matchers.isEmptyString()); }
public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } }
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
StringUtils { public static String lowerCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toLowerCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
@Test public void upperCase_NonEmptyString() { String input = "dHkdjj139_)(e"; String expected = "DHKDJJ139_)(E"; assertEquals(expected, StringUtils.upperCase(input)); }
public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
@Test public void testNoIAMHeadersAreAdded() { CreateBucketRequest request = new CreateBucketRequest("testbucket"); Request<CreateBucketRequest> defaultRequest = new DefaultRequest(Constants.S3_SERVICE_DISPLAY_NAME); AmazonS3Client s3Client = new AmazonS3Client(new BasicAWSCredentials("987654321", "123456789")); defaul...
protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredentials)) { if (null != createBucketRequest.getServiceInstanceId()) { re...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 { protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredenti...
@Test public void upperCase_NullString() { assertNull(StringUtils.upperCase((null))); }
public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
@Test public void upperCase_EmptyString() { Assert.assertThat(StringUtils.upperCase(""), Matchers.isEmptyString()); }
public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } }
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value)...
@Test public void testCompare() { assertTrue(StringUtils.compare("truck", "Car") > 0); assertTrue(StringUtils.compare("", "dd") < 0); assertTrue(StringUtils.compare("dd", "") > 0); assertEquals(0, StringUtils.compare("", "")); assertTrue(StringUtils.compare(" ", "") > 0); }
public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder value); stati...
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder value); stati...
@Test (expected = IllegalArgumentException.class) public void testCompare_String1Null() { String str1 = null; String str2 = "test"; int result = StringUtils.compare(str1, str2); }
public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder value); stati...
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder value); stati...
@Test (expected = IllegalArgumentException.class) public void testCompare_String2Null() { String str1 = "test"; String str2 = null; int result = StringUtils.compare(str1, str2); }
public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } }
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder value); stati...
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder value); stati...
@Test public void begins_with_ignore_case() { Assert.assertTrue(StringUtils.beginsWithIgnoreCase("foobar", "FoO")); }
public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); }
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } }
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } }
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromIntege...
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromIntege...
@Test public void begins_with_ignore_case_returns_false_when_seq_doesnot_match() { Assert.assertFalse(StringUtils.beginsWithIgnoreCase("foobar", "baz")); }
public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); }
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } }
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } }
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromIntege...
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromIntege...
@Test public void hasValue() { Assert.assertTrue(StringUtils.hasValue("something")); Assert.assertFalse(StringUtils.hasValue(null)); Assert.assertFalse(StringUtils.hasValue("")); }
public static boolean hasValue(String str) { return !isNullOrEmpty(str); }
StringUtils { public static boolean hasValue(String str) { return !isNullOrEmpty(str); } }
StringUtils { public static boolean hasValue(String str) { return !isNullOrEmpty(str); } }
StringUtils { public static boolean hasValue(String str) { return !isNullOrEmpty(str); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); static String fromLong(Long value); static String...
StringUtils { public static boolean hasValue(String str) { return !isNullOrEmpty(str); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); static String fromLong(Long value); static String...
@Test public void findFirstOccurrence() { Assert.assertEquals((Character) ':', StringUtils.findFirstOccurrence("abc:def/ghi:jkl/mno", ':', '/')); Assert.assertEquals((Character) ':', StringUtils.findFirstOccurrence("abc:def/ghi:jkl/mno", '/', ':')); }
public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Integer.MAX_VALUE ? ...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
@Test public void findFirstOccurrence_NoMatch() { Assert.assertNull(StringUtils.findFirstOccurrence("abc", ':')); }
public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Integer.MAX_VALUE ? ...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestIndex == Intege...
@Test public void testRemoteHostUpdatedWhenAsperaTransferManagerConfigMultiSessionTrue() { AsperaTransferManagerConfig asperaTransferManagerConfig = new AsperaTransferManagerConfig(); asperaTransferManagerConfig.setMultiSession(true); TransferSpec transferSpec = new TransferSpec(); transferSpec.setRemote_host("mysubDom...
public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } }
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } }
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protected AsperaTrans...
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protected AsperaTrans...
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protected AsperaTrans...
@Test public void testParseServiceName() { assertEquals("iam", AwsHostNameUtils.parseServiceName(IAM_ENDPOINT)); assertEquals("iam", AwsHostNameUtils.parseServiceName(IAM_REGION_ENDPOINT)); assertEquals("ec2", AwsHostNameUtils.parseServiceName(EC2_REGION_ENDPOINT)); assertEquals("s3", AwsHostNameUtils.parseServiceName(...
@Deprecated public static String parseServiceName(URI endpoint) { String host = endpoint.getHost(); if (!host.endsWith(".amazonaws.com")) { throw new IllegalArgumentException( "Cannot parse a service name from an unrecognized endpoint (" + host + ")."); } String serviceAndRegion = host.substring(0, host.indexOf(".amazo...
AwsHostNameUtils { @Deprecated public static String parseServiceName(URI endpoint) { String host = endpoint.getHost(); if (!host.endsWith(".amazonaws.com")) { throw new IllegalArgumentException( "Cannot parse a service name from an unrecognized endpoint (" + host + ")."); } String serviceAndRegion = host.substring(0, h...
AwsHostNameUtils { @Deprecated public static String parseServiceName(URI endpoint) { String host = endpoint.getHost(); if (!host.endsWith(".amazonaws.com")) { throw new IllegalArgumentException( "Cannot parse a service name from an unrecognized endpoint (" + host + ")."); } String serviceAndRegion = host.substring(0, h...
AwsHostNameUtils { @Deprecated public static String parseServiceName(URI endpoint) { String host = endpoint.getHost(); if (!host.endsWith(".amazonaws.com")) { throw new IllegalArgumentException( "Cannot parse a service name from an unrecognized endpoint (" + host + ")."); } String serviceAndRegion = host.substring(0, h...
AwsHostNameUtils { @Deprecated public static String parseServiceName(URI endpoint) { String host = endpoint.getHost(); if (!host.endsWith(".amazonaws.com")) { throw new IllegalArgumentException( "Cannot parse a service name from an unrecognized endpoint (" + host + ")."); } String serviceAndRegion = host.substring(0, h...
@Test public void testStandardNoHint() { assertEquals("us-east-1", AwsHostNameUtils.parseRegionName("iam.amazonaws.com", null)); assertEquals("us-west-2", AwsHostNameUtils.parseRegionName("iam.us-west-2.amazonaws.com", null)); assertEquals("us-west-2", AwsHostNameUtils.parseRegionName("ec2.us-west-2.amazonaws.com", nul...
@Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
@Test public void testStandard() { assertEquals("us-east-1", AwsHostNameUtils.parseRegionName("iam.amazonaws.com", "iam")); assertEquals("us-west-2", AwsHostNameUtils.parseRegionName("iam.us-west-2.amazonaws.com", "iam")); assertEquals("us-west-2", AwsHostNameUtils.parseRegionName("ec2.us-west-2.amazonaws.com", "ec2"))...
@Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
@Test public void testBJS() { assertEquals("cn-north-1", AwsHostNameUtils.parseRegionName("iam.cn-north-1.amazonaws.com.cn", "iam")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegionName("ec2.cn-north-1.amazonaws.com.cn", "ec2")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegionName("s3.cn-north-1.amazona...
@Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
@Test public void testS3SpecialRegions() { assertEquals("us-east-1", AwsHostNameUtils.parseRegionName("s3-external-1.amazonaws.com", null)); assertEquals("us-east-1", AwsHostNameUtils.parseRegionName("bucket.name.with.periods.s3-external-1.amazonaws.com", null)); assertEquals("us-gov-west-1", AwsHostNameUtils.parseRegi...
@Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } }
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
AwsHostNameUtils { @Deprecated public static String parseRegionName(URI endpoint) { return parseRegionName(endpoint.getHost(), null); } @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host, final String serviceHint...
@Test public void testRemoteHostUpdatedWhenAsperaTransferManagerConfigMultiSessionFalse() { PowerMockito .when( AsperaLibraryLoader.load() ).thenReturn("/tmp"); AsperaTransferManagerConfig asperaTransferManagerConfig = new AsperaTransferManagerConfig(); asperaTransferManagerConfig.setMultiSession(false); TransferSpec t...
public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } }
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } }
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protected AsperaTrans...
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protected AsperaTrans...
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protected AsperaTrans...
@Test public void testParseRegionWithStandardEndpointsNoHint() { assertEquals("us-east-1", AwsHostNameUtils.parseRegion("iam.amazonaws.com", null)); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("iam.us-west-2.amazonaws.com", null)); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("ec2.us-west-2.amazona...
public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameInInternalConfig; } i...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
@Test public void testParseRegionWithStandardEndpointsWithServiceHint() { assertEquals("us-east-1", AwsHostNameUtils.parseRegion("iam.amazonaws.com", "iam")); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("iam.us-west-2.amazonaws.com", "iam")); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("ec2.us-wes...
public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameInInternalConfig; } i...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
@Test public void testParseRegionWithBJSEndpoints() { assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("iam.cn-north-1.amazonaws.com.cn", "iam")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("ec2.cn-north-1.amazonaws.com.cn", "ec2")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("s3.cn-nor...
public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameInInternalConfig; } i...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
@Test public void testParseRegionWithS3SpecialRegions() { assertEquals("us-east-1", AwsHostNameUtils.parseRegion("s3-external-1.amazonaws.com", null)); assertEquals("us-east-1", AwsHostNameUtils.parseRegion("bucket.name.with.periods.s3-external-1.amazonaws.com", null)); assertEquals("us-gov-west-1", AwsHostNameUtils.pa...
public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameInInternalConfig; } i...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
@Test public void testParseRegionWithIpv4() { assertNull(AwsHostNameUtils.parseRegion("54.231.16.200", null)); }
public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameInInternalConfig; } i...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
AwsHostNameUtils { public static String parseRegion(final String host, final String serviceHint) { if (host == null) { throw new IllegalArgumentException("hostname cannot be null"); } String regionNameInInternalConfig = parseRegionNameByInternalConfig(host); if (regionNameInInternalConfig != null) { return regionNameIn...
@Test public void testRemoteHostUpdatedWhenAsperaTransferConfigMultiSession3RunTime() { AsperaConfig asperaConfig = new AsperaConfig(); asperaConfig.setMultiSession(3); TransferSpec transferSpec = new TransferSpec(); TransferSpecs transferSpecs = new TransferSpecs(); List<TransferSpec> list = new ArrayList<TransferSpec...
public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTargetRateKbps()); } if (!St...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
@Test public void testMultiSessionThresholdUpdatedWhenAsperaTransferConfigRunTime() { AsperaConfig asperaConfig = new AsperaConfig(); asperaConfig.setMultiSessionThreshold(70000); TransferSpec transferSpec = new TransferSpec(); TransferSpecs transferSpecs = new TransferSpecs(); List<TransferSpec> list = new ArrayList<T...
public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTargetRateKbps()); } if (!St...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
@Test public void testMultiSessionFieldIsNotSetToZeroIfDefault() throws JsonProcessingException { AsperaConfig asperaConfig = new AsperaConfig(); TransferSpec transferSpec = new TransferSpec(); TransferSpecs transferSpecs = new TransferSpecs(); List<TransferSpec> list = new ArrayList<TransferSpec>(); list.add(transferS...
public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTargetRateKbps()); } if (!St...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
@Test public void userAgent() { String userAgent = VersionInfoUtils.userAgent(); assertNotNull(userAgent); }
static String userAgent() { String ua = InternalConfig.Factory.getInternalConfig() .getUserAgentTemplate(); if (ua == null) { return "aws-sdk-java"; } ua = ua .replace("aws","ibm-cos") .replace("{platform}", StringUtils.lowerCase(getPlatform())) .replace("{version}", getVersion()) .replace("{os.name}", replaceSpaces(Sy...
VersionInfoUtils { static String userAgent() { String ua = InternalConfig.Factory.getInternalConfig() .getUserAgentTemplate(); if (ua == null) { return "aws-sdk-java"; } ua = ua .replace("aws","ibm-cos") .replace("{platform}", StringUtils.lowerCase(getPlatform())) .replace("{version}", getVersion()) .replace("{os.name}...
VersionInfoUtils { static String userAgent() { String ua = InternalConfig.Factory.getInternalConfig() .getUserAgentTemplate(); if (ua == null) { return "aws-sdk-java"; } ua = ua .replace("aws","ibm-cos") .replace("{platform}", StringUtils.lowerCase(getPlatform())) .replace("{version}", getVersion()) .replace("{os.name}...
VersionInfoUtils { static String userAgent() { String ua = InternalConfig.Factory.getInternalConfig() .getUserAgentTemplate(); if (ua == null) { return "aws-sdk-java"; } ua = ua .replace("aws","ibm-cos") .replace("{platform}", StringUtils.lowerCase(getPlatform())) .replace("{version}", getVersion()) .replace("{os.name}...
VersionInfoUtils { static String userAgent() { String ua = InternalConfig.Factory.getInternalConfig() .getUserAgentTemplate(); if (ua == null) { return "aws-sdk-java"; } ua = ua .replace("aws","ibm-cos") .replace("{platform}", StringUtils.lowerCase(getPlatform())) .replace("{version}", getVersion()) .replace("{os.name}...
@Ignore @Test public void testMultiSessionFieldIsSetToZeroIfSpecified() throws JsonProcessingException { AsperaConfig asperaConfig = new AsperaConfig(); asperaConfig.setMultiSession(0); TransferSpec transferSpec = new TransferSpec(); TransferSpecs transferSpecs = new TransferSpecs(); List<TransferSpec> list = new Array...
public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTargetRateKbps()); } if (!St...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
AsperaTransferManager { public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps()))) { transferSpec.setTarget_rate_kbps(sessionDetails.getTarg...
@Test public void testFromDocumentDoesNotWriteToStderrWhenXmlInvalid() throws SAXException, IOException, ParserConfigurationException { PrintStream err = System.err; ByteArrayOutputStream bytes = new ByteArrayOutputStream(); try { PrintStream err2 = new PrintStream(bytes); System.setErr(err2); XpathUtils.documentFrom("...
public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException { is = new NamespaceRemovingInputStream(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(ERROR_HAN...
XpathUtils { public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException { is = new NamespaceRemovingInputStream(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHand...
XpathUtils { public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException { is = new NamespaceRemovingInputStream(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHand...
XpathUtils { public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException { is = new NamespaceRemovingInputStream(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHand...
XpathUtils { public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException { is = new NamespaceRemovingInputStream(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHand...
@Test public void testErrorLogWhenStatusUpdatedToError() throws Exception{ PowerMockito.mockStatic(faspmanager2.class); PowerMockito .when( faspmanager2.stopTransfer(anyString()) ).thenReturn(true); TransferListener spyTransferListener = spy(TransferListener.class); spyTransferListener.log = mockLog; spyTransferListene...
public synchronized void setStatus(String xferId, String sessionId, String status, long bytes) { log.trace("TransferListener.setStatus >> " + System.nanoTime() + ": " + new Exception().getStackTrace()[1].getClassName()); if(status.equals("INIT") && isNewSession(xferId, sessionId)) { ascpCount++; } else if (status.equal...
TransferListener extends ITransferListener { public synchronized void setStatus(String xferId, String sessionId, String status, long bytes) { log.trace("TransferListener.setStatus >> " + System.nanoTime() + ": " + new Exception().getStackTrace()[1].getClassName()); if(status.equals("INIT") && isNewSession(xferId, sessi...
TransferListener extends ITransferListener { public synchronized void setStatus(String xferId, String sessionId, String status, long bytes) { log.trace("TransferListener.setStatus >> " + System.nanoTime() + ": " + new Exception().getStackTrace()[1].getClassName()); if(status.equals("INIT") && isNewSession(xferId, sessi...
TransferListener extends ITransferListener { public synchronized void setStatus(String xferId, String sessionId, String status, long bytes) { log.trace("TransferListener.setStatus >> " + System.nanoTime() + ": " + new Exception().getStackTrace()[1].getClassName()); if(status.equals("INIT") && isNewSession(xferId, sessi...
TransferListener extends ITransferListener { public synchronized void setStatus(String xferId, String sessionId, String status, long bytes) { log.trace("TransferListener.setStatus >> " + System.nanoTime() + ": " + new Exception().getStackTrace()[1].getClassName()); if(status.equals("INIT") && isNewSession(xferId, sessi...
@Test public void testMD5CloneSupportedFalse() throws Exception { InputStream in = mock(InputStream.class); doReturn(false).when(in).markSupported();; MD5DigestCalculatingInputStream md5Digest = new MD5DigestCalculatingInputStream(in); assertFalse(md5Digest.markSupported()); }
@Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; }
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } }
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } MD5DigestCalculatingInputStream(InputStream in); }
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } MD5DigestCalculatingInputStream(InputStream in); @Override boolean markSupported(); byte[] getMd5Digest(); @Override void mark(int readlimit); @Override void res...
MD5DigestCalculatingInputStream extends SdkFilterInputStream { @Override public boolean markSupported() { return super.markSupported() && digestCanBeCloned; } MD5DigestCalculatingInputStream(InputStream in); @Override boolean markSupported(); byte[] getMd5Digest(); @Override void mark(int readlimit); @Override void res...
@Test public void testExceptionThrownWhenNullS3Client() { expectedEx.expect(SdkClientException.class); new AsperaTransferManagerBuilder("apiKey", null).build(); }
public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); Aspera...
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); Aspera...
@Test public void testExceptionThrownWhenNullS3ApiKey() { expectedEx.expect(SdkClientException.class); new AsperaTransferManagerBuilder(null, mockS3Client).build(); }
public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); Aspera...
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); Aspera...
@Test public void testAsperTransferManagerIsCreated() { AsperaTransferManager transferManager = new AsperaTransferManagerBuilder("apiKey", mockS3Client).build(); assertNotNull(transferManager); }
public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); }
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); Aspera...
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3Client); Aspera...
@Test public void request_null_returns_null(){ Assert.assertNull(UriResourcePathUtils.addStaticQueryParamtersToRequest(null, "foo")); }
public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
@Test public void uri_resource_path_null_returns_null(){ Assert.assertNull(UriResourcePathUtils .addStaticQueryParamtersToRequest(new DefaultRequest<Object> (null , null), null)); }
public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
@Test public void uri_resource_path_doesnot_have_static_query_params_returns_uri_resource_path(){ final String uriResourcePath = "/foo/bar"; Assert.assertEquals(uriResourcePath, UriResourcePathUtils .addStaticQueryParamtersToRequest(new DefaultRequest<Object> (null, null), uriResourcePath)); }
public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(in...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = re...