@Test void testGetUriPath() { EntityType entityType = mock(EntityType.class); when(entityType.getId()).thenReturn("MyJobExecutionEntityType"); JobExecution jobExecution = mock(JobExecution.class); when(jobExecution.getEntityType()).thenReturn(entityType); when(jobExecution.getIdValue()).thenReturn("MyJobExecutionId"); assertEquals("/api/v2/MyJobExecutionEntityType/MyJobExecutionId", getUriPath(jobExecution)); }
public static String getUriPath(JobExecution jobExecution) { return ServletUriComponentsBuilder.fromCurrentRequestUri() .encode() .replacePath(null) .pathSegment( "api", "v2", jobExecution.getEntityType().getId(), jobExecution.getIdValue().toString()) .build() .getPath(); }
JobExecutionUriUtils { public static String getUriPath(JobExecution jobExecution) { return ServletUriComponentsBuilder.fromCurrentRequestUri() .encode() .replacePath(null) .pathSegment( "api", "v2", jobExecution.getEntityType().getId(), jobExecution.getIdValue().toString()) .build() .getPath(); } }
JobExecutionUriUtils { public static String getUriPath(JobExecution jobExecution) { return ServletUriComponentsBuilder.fromCurrentRequestUri() .encode() .replacePath(null) .pathSegment( "api", "v2", jobExecution.getEntityType().getId(), jobExecution.getIdValue().toString()) .build() .getPath(); } private  JobExecutionUriUtils(); }
JobExecutionUriUtils { public static String getUriPath(JobExecution jobExecution) { return ServletUriComponentsBuilder.fromCurrentRequestUri() .encode() .replacePath(null) .pathSegment( "api", "v2", jobExecution.getEntityType().getId(), jobExecution.getIdValue().toString()) .build() .getPath(); } private  JobExecutionUriUtils(); static String getUriPath(JobExecution jobExecution); }
JobExecutionUriUtils { public static String getUriPath(JobExecution jobExecution) { return ServletUriComponentsBuilder.fromCurrentRequestUri() .encode() .replacePath(null) .pathSegment( "api", "v2", jobExecution.getEntityType().getId(), jobExecution.getIdValue().toString()) .build() .getPath(); } private  JobExecutionUriUtils(); static String getUriPath(JobExecution jobExecution);  }