minor formatting cleanup
This commit is contained in:
parent
bdc59432a6
commit
b18f2a58c8
|
@ -54,8 +54,6 @@ public class GenericEntityController {
|
|||
|
||||
@GetMapping("/entity/findbyversion")
|
||||
public ResponseEntity findByVersion(@Version String version) {
|
||||
return version != null
|
||||
? new ResponseEntity(entityList.stream().findFirst().get(), HttpStatus.OK)
|
||||
: new ResponseEntity(HttpStatus.NOT_FOUND);
|
||||
return version != null ? new ResponseEntity(entityList.stream().findFirst().get(), HttpStatus.OK) : new ResponseEntity(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,29 +45,22 @@ public class SpringBootApplicationIntegrationTest {
|
|||
public void givenRequestHasBeenMade_whenMeetsFindByDateOfGivenConditions_thenCorrect() throws Exception {
|
||||
MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
|
||||
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30"))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.content().contentType(contentType))
|
||||
.andExpect(jsonPath("$.id", equalTo(1)));
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType))
|
||||
.andExpect(jsonPath("$.id", equalTo(1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenRequestHasBeenMade_whenMeetsFindByModeOfGivenConditions_thenCorrect() throws Exception {
|
||||
MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
|
||||
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name()))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.content().contentType(contentType))
|
||||
.andExpect(jsonPath("$.id", equalTo(1)));
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name())).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)).andExpect(jsonPath("$.id", equalTo(1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenRequestHasBeenMade_whenMeetsFindByVersionOfGivenConditions_thenCorrect() throws Exception {
|
||||
MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
|
||||
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0"))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.content().contentType(contentType))
|
||||
.andExpect(jsonPath("$.id", equalTo(1)));
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType))
|
||||
.andExpect(jsonPath("$.id", equalTo(1)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ public class ProductInfoRepositoryIntegrationTest {
|
|||
private static final String EXPECTED_PRICE = "50";
|
||||
|
||||
@Before
|
||||
@Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance
|
||||
public void setup() throws Exception {
|
||||
@Ignore // TODO Remove Ignore annotations when running locally with Local DynamoDB instance
|
||||
public void setup() throws Exception {
|
||||
|
||||
try {
|
||||
dynamoDBMapper = new DynamoDBMapper(amazonDynamoDB);
|
||||
|
@ -64,7 +64,7 @@ public class ProductInfoRepositoryIntegrationTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance
|
||||
@Ignore // TODO Remove Ignore annotations when running locally with Local DynamoDB instance
|
||||
public void givenItemWithExpectedCost_whenRunFindAll_thenItemIsFound() {
|
||||
|
||||
ProductInfo productInfo = new ProductInfo(EXPECTED_COST, EXPECTED_PRICE);
|
||||
|
|
Loading…
Reference in New Issue