Skip to content

Commit e36be6b

Browse files
committed
refactor: code
1 parent b8ffdb9 commit e36be6b

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/main/java/com/thisaster/testtask/subscription/dto/SubscriptionDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class SubscriptionDTO {
1616

1717
@JsonInclude(JsonInclude.Include.NON_NULL)
1818
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
19-
private Long id;
19+
private long id;
2020
@NotBlank
2121
private String name;
2222
}

src/main/java/com/thisaster/testtask/subscription/entity/Subscription.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public class Subscription {
2323
@Id
2424
@GeneratedValue(strategy = GenerationType.IDENTITY)
25-
private Long id;
25+
private long id;
2626
@Column(unique = true, nullable = false)
2727
private String name;
2828
}

src/main/java/com/thisaster/testtask/user/dto/UserDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class UserDTO {
3434
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
3535
private Set<SubscriptionDTO> subscriptions;
3636

37-
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
37+
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
3838

3939
@NotBlank(message = "Role cannot be blank")
4040
@Pattern(regexp = "^(ADMIN|USER|SUPERVISOR)$", message = "Role must be either admin or user")

src/test/java/com/thisaster/testtask/user/controller/UserControllerTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ void shouldUpdateUser(@Value("classpath:user/updateUser.json") Resource json) th
127127
.andExpect(jsonPath("$.subscriptions[*].name", containsInAnyOrder(
128128
"Premium Plan", "Newsletter", "Yandex Premium"
129129
)))
130-
.andExpect(jsonPath("$.role", is("SUPERVISOR")))
131130
.andReturn();
132131

133132
System.out.println("Result : " + result.getResponse().getContentAsString());

0 commit comments

Comments
 (0)