Skip to content

Commit b18f2a5

Browse files
author
eugenp
committed
minor formatting cleanup
1 parent bdc5943 commit b18f2a5

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

‎spring-boot/src/main/java/org/baeldung/controller/GenericEntityController.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public GenericEntity findByEnum(@PathVariable("mode") Modes mode) {
5454

5555
@GetMapping("/entity/findbyversion")
5656
public ResponseEntity findByVersion(@Version String version) {
57-
return version != null
58-
? new ResponseEntity(entityList.stream().findFirst().get(), HttpStatus.OK)
59-
: new ResponseEntity(HttpStatus.NOT_FOUND);
57+
return version != null ? new ResponseEntity(entityList.stream().findFirst().get(), HttpStatus.OK) : new ResponseEntity(HttpStatus.NOT_FOUND);
6058
}
6159
}

‎spring-boot/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,22 @@ public void givenRequestHasBeenMade_whenMeetsAllOfGivenConditions_thenCorrect()
4545
public void givenRequestHasBeenMade_whenMeetsFindByDateOfGivenConditions_thenCorrect() throws Exception {
4646
MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
4747

48-
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30"))
49-
.andExpect(MockMvcResultMatchers.status().isOk())
50-
.andExpect(MockMvcResultMatchers.content().contentType(contentType))
51-
.andExpect(jsonPath("$.id", equalTo(1)));
48+
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType))
49+
.andExpect(jsonPath("$.id", equalTo(1)));
5250
}
5351

5452
@Test
5553
public void givenRequestHasBeenMade_whenMeetsFindByModeOfGivenConditions_thenCorrect() throws Exception {
5654
MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
5755

58-
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name()))
59-
.andExpect(MockMvcResultMatchers.status().isOk())
60-
.andExpect(MockMvcResultMatchers.content().contentType(contentType))
61-
.andExpect(jsonPath("$.id", equalTo(1)));
56+
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name())).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)).andExpect(jsonPath("$.id", equalTo(1)));
6257
}
6358

6459
@Test
6560
public void givenRequestHasBeenMade_whenMeetsFindByVersionOfGivenConditions_thenCorrect() throws Exception {
6661
MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
6762

68-
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0"))
69-
.andExpect(MockMvcResultMatchers.status().isOk())
70-
.andExpect(MockMvcResultMatchers.content().contentType(contentType))
71-
.andExpect(jsonPath("$.id", equalTo(1)));
63+
mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType))
64+
.andExpect(jsonPath("$.id", equalTo(1)));
7265
}
7366
}

‎spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class ProductInfoRepositoryIntegrationTest {
4444
private static final String EXPECTED_PRICE = "50";
4545

4646
@Before
47-
@Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance
48-
public void setup() throws Exception {
47+
@Ignore // TODO Remove Ignore annotations when running locally with Local DynamoDB instance
48+
public void setup() throws Exception {
4949

5050
try {
5151
dynamoDBMapper = new DynamoDBMapper(amazonDynamoDB);
@@ -64,7 +64,7 @@ public void setup() throws Exception {
6464
}
6565

6666
@Test
67-
@Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance
67+
@Ignore // TODO Remove Ignore annotations when running locally with Local DynamoDB instance
6868
public void givenItemWithExpectedCost_whenRunFindAll_thenItemIsFound() {
6969

7070
ProductInfo productInfo = new ProductInfo(EXPECTED_COST, EXPECTED_PRICE);

0 commit comments

Comments
 (0)