Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deprecation warnings #1052

Merged
merged 2 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private void updateObject(ToBeFixed fixObject, JdbcTemplate jdbcTemplate) {

if (menuSessionId != null && !"".equals(menuSessionId)) {
String query = "SELECT appid FROM menu_sessions WHERE id = ?";
String menuAppId = jdbcTemplate.queryForObject(query, new Object[] { menuSessionId }, String.class);
String menuAppId = jdbcTemplate.queryForObject(query, String.class, menuSessionId);
if (menuAppId != null && !"".equals(menuAppId)) {
executeUpdate(jdbcTemplate, menuAppId, sessionId);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testSaveAndLoad() {
formSessionRepo.saveAndFlush(session);
entityManager.clear(); // clear the EM cache to force a re-fetch from DB
SerializableFormSession loaded = JpaTestUtils.unwrapProxy(
formSessionRepo.getOne(session.getId())
formSessionRepo.getById(session.getId())
);
assertThat(loaded).usingRecursiveComparison().ignoringFields("dateCreated", "version").isEqualTo(session);
Instant dateCreated = loaded.getDateCreated();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testSaveAndLoad() {
menuSessionRepo.saveAndFlush(session);
entityManager.clear(); // clear the EM cache to force a re-fetch from DB
SerializableMenuSession loaded = JpaTestUtils.unwrapProxy(
menuSessionRepo.getOne(session.getId())
menuSessionRepo.getById(session.getId())
);
assertThat(loaded).usingRecursiveComparison().isEqualTo(session);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void setUp() throws Exception {
Mockito.reset(datadogMock);
Mockito.reset(menuSessionFactory);
Mockito.reset(menuSessionRunnerService);
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
mockFormController = MockMvcBuilders.standaloneSetup(formController).build();
mockFormSubmissionController = MockMvcBuilders.standaloneSetup(formSubmissionController).build();
mockUtilController = MockMvcBuilders.standaloneSetup(utilController).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyString;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/commcare/formplayer/tests/GroupTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.commcare.formplayer.utils.TestContext;

import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;

/**
* Fills out the "Basic Tests > Groups" Form from the QA plan.
Expand Down Expand Up @@ -115,4 +115,4 @@ public void testMultiSelectGroups() throws Exception {
public void testInnerOuterGroups() throws Exception {
NewFormResponse newSessionResponse = startNewForm("requests/new_form/new_form_group.json", "xforms/groups.xml");
}
}
}
4 changes: 2 additions & 2 deletions src/test/java/org/commcare/formplayer/tests/NewFormTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.commcare.formplayer.utils.TestContext;

import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;

/**
* Created by willpride on 1/14/16.
Expand Down Expand Up @@ -63,4 +63,4 @@ protected String getMockRestoreFileName() {
public void editFormWithUserData() throws Exception {
startNewForm("requests/new_form/edit_user_data.json", "xforms/edit_user_data.xml");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class RestoreFactoryTest {
@BeforeEach
public void setUp() throws Exception {
Mockito.reset(restoreFactorySpy);
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
AuthenticatedRequestBean requestBean = new AuthenticatedRequestBean();
requestBean.setRestoreAs(asUsername);
requestBean.setUsername(username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class TestContext {

public TestContext() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
}

@Bean
Expand Down