Skip to content

Commit

Permalink
Merge pull request #1052 from dimagi/sk/fix-deprecations
Browse files Browse the repository at this point in the history
fix deprecation warnings
  • Loading branch information
snopoke authored Nov 30, 2021
2 parents f962a76 + c60b118 commit a72f4be
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
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

0 comments on commit a72f4be

Please sign in to comment.