You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/01/12 11:02:06 UTC
[james-project] 07/20: JAMES-3472 JMAP Probe method name
clarification
This is an automated email from the ASF dual-hosted git repository.
rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit a2be7b819bee96e91959fa23bb2df3664ca2e44b
Author: LanKhuat <dl...@linagora.com>
AuthorDate: Thu Jan 7 10:16:35 2021 +0700
JAMES-3472 JMAP Probe method name clarification
---
.../java/org/apache/james/jmap/draft/JmapGuiceProbe.java | 9 ++-------
.../rfc8621/contract/MailboxChangesMethodContract.scala | 16 ++++++++--------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapGuiceProbe.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapGuiceProbe.java
index a71dff2..676e7f5 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapGuiceProbe.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapGuiceProbe.java
@@ -26,7 +26,6 @@ import javax.inject.Inject;
import org.apache.james.core.Username;
import org.apache.james.jmap.JMAPServer;
import org.apache.james.jmap.api.change.EmailChangeRepository;
-import org.apache.james.jmap.api.change.MailboxChange;
import org.apache.james.jmap.api.change.MailboxChangeRepository;
import org.apache.james.jmap.api.change.State;
import org.apache.james.jmap.api.model.AccountId;
@@ -95,15 +94,11 @@ public class JmapGuiceProbe implements GuiceProbe {
Mono.from(messageFastViewProjection.clear()).block();
}
- public void saveMailboxChange(MailboxChange change) {
- mailboxChangeRepository.save(change).block();
- }
-
- public State getLastestState(AccountId accountId) {
+ public State getLatestMailboxState(AccountId accountId) {
return mailboxChangeRepository.getLatestState(accountId).block();
}
- public State getLastestStateWithDelegation(AccountId accountId) {
+ public State getLatestMailboxStateWithDelegation(AccountId accountId) {
return mailboxChangeRepository.getLatestStateWithDelegation(accountId).block();
}
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala
index 7ecf86f..1771910 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxChangesMethodContract.scala
@@ -1279,7 +1279,7 @@ trait MailboxChangesMethodContract {
@Test
def mailboxChangesShouldFailWhenAccountIdNotFound(server: GuiceJamesServer): Unit = {
val jmapGuiceProbe:JmapGuiceProbe = server.getProbe(classOf[JmapGuiceProbe])
- val oldState: State = jmapGuiceProbe.getLastestState(AccountId.fromUsername(BOB))
+ val oldState: State = jmapGuiceProbe.getLatestMailboxState(AccountId.fromUsername(BOB))
val request =
s"""{
@@ -1437,9 +1437,9 @@ trait MailboxChangesMethodContract {
val response = `given`
.header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
.body(request)
- .when
+ .when
.post
- .`then`
+ .`then`
.statusCode(SC_OK)
.contentType(JSON)
.extract
@@ -1886,17 +1886,17 @@ trait MailboxChangesMethodContract {
private def waitForNextState(server: GuiceJamesServer, accountId: AccountId, initialState: State): State = {
val jmapGuiceProbe: JmapGuiceProbe = server.getProbe(classOf[JmapGuiceProbe])
awaitAtMostTenSeconds.untilAsserted {
- () => assertThat(jmapGuiceProbe.getLastestState(accountId)).isNotEqualTo(initialState)
+ () => assertThat(jmapGuiceProbe.getLatestMailboxState(accountId)).isNotEqualTo(initialState)
}
- jmapGuiceProbe.getLastestState(accountId)
+ jmapGuiceProbe.getLatestMailboxState(accountId)
}
private def waitForNextStateWithDelegation(server: GuiceJamesServer, accountId: AccountId, initialState: State): State = {
val jmapGuiceProbe: JmapGuiceProbe = server.getProbe(classOf[JmapGuiceProbe])
- awaitAtMostTenSeconds.untilAsserted{ () => assertThat(jmapGuiceProbe.getLastestStateWithDelegation(accountId)).isNotEqualTo(initialState) }
+ awaitAtMostTenSeconds.untilAsserted{ () => assertThat(jmapGuiceProbe.getLatestMailboxStateWithDelegation(accountId)).isNotEqualTo(initialState) }
- jmapGuiceProbe.getLastestStateWithDelegation(accountId)
+ jmapGuiceProbe.getLatestMailboxStateWithDelegation(accountId)
}
private def provisionSystemMailboxes(server: GuiceJamesServer): State = {
@@ -1959,6 +1959,6 @@ trait MailboxChangesMethodContract {
assertThat(createdSize).isEqualTo(5)
}
- jmapGuiceProbe.getLastestState(AccountId.fromUsername(BOB))
+ jmapGuiceProbe.getLatestMailboxState(AccountId.fromUsername(BOB))
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org