.extracting("devOpsPlatformSettingUuid", "key")
.containsExactly(almSettingDto.getUuid(), almSettingDto.getKey());
assertThat(newValue)
- .hasToString("{\"devOpsPlatformSettingUuid\": \"1\", \"key\": \"key\", \"devOpsPlatformName\": \"id1\", \"url\": \"url\", \"appId\": \"id1\", \"clientId\": \"cid1\" }");
+ .hasToString("{\"devOpsPlatformSettingUuid\": \""+almSettingDto.getUuid()+"\", \"key\": \""+almSettingDto.getKey()+"\", \"devOpsPlatformName\": \"id1\", \"url\": \"url\", \"appId\": \"id1\", \"clientId\": \"cid1\" }");
almSettingDto.setPrivateKey("updated private key");
almSettingDto.setAppId("updated app id");
assertThat(newValue)
.extracting("devOpsPlatformSettingUuid", "key", "appId", "devOpsPlatformName", "url", "clientId")
.containsExactly(almSettingDto.getUuid(), almSettingDto.getKey(), almSettingDto.getAppId(), almSettingDto.getAppId(), almSettingDto.getUrl(), almSettingDto.getClientId());
- assertThat(newValue).hasToString("{\"devOpsPlatformSettingUuid\": \"1\", \"key\": \"updated key\", \"devOpsPlatformName\": \"updated app id\", "
- + "\"url\": \"updated url\", \"appId\": \"updated app id\", \"clientId\": \"cid1\" }");
+ assertThat(newValue).hasToString("{\"devOpsPlatformSettingUuid\": \""+almSettingDto.getUuid()+"\", \"key\": \""+almSettingDto.getKey()
+ +"\", \"devOpsPlatformName\": \""+almSettingDto.getAppId()+"\", "
+ + "\"url\": \""+almSettingDto.getUrl()+"\", \"appId\": \""+almSettingDto.getAppId()+"\", \"clientId\": \""+almSettingDto.getClientId()+"\" }");
}
@Test
*/
package org.sonar.db.notification;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;
db.commit();
assertThat(dao.selectOldest(3))
- .extracting(NotificationQueueDto::getUuid)
- .containsExactlyElementsOf(Arrays.asList("1", "2", "3"));
+ .extracting(NotificationQueueDto::getData)
+ .map(bytes -> new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject())
+ .extracting("type")
+ .containsExactlyElementsOf(List.of("foo_0", "foo_1", "foo_2"));
}
private List<String> selectAllUuid() {
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.sonar.api.utils.System2;
-import org.sonar.core.util.SequenceUuidFactory;
import org.sonar.core.util.UuidFactory;
+import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.alm.integration.pat.AlmPatsDbTester;
import org.sonar.db.almsettings.AlmSettingsDbTester;
import org.sonar.db.audit.AuditDbTester;
*/
public class DbTester extends AbstractDbTester<TestDbImpl> {
- private final UuidFactory uuidFactory = new SequenceUuidFactory();
+ private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
private final System2 system2;
private final AuditPersister auditPersister;
private DbClient client;